Skip to content

Commit

Permalink
Add new payment method: Japan Bank Transfer (furikomi)
Browse files Browse the repository at this point in the history
  • Loading branch information
wiz committed Sep 9, 2019
1 parent af95fcc commit f2d93fd
Show file tree
Hide file tree
Showing 11 changed files with 1,349 additions and 0 deletions.
11 changes: 11 additions & 0 deletions common/src/main/proto/pb.proto
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,7 @@ message PaymentAccountPayload {
PromptPayAccountPayload prompt_pay_account_payload = 25;
AdvancedCashAccountPayload advanced_cash_account_payload = 26;
InstantCryptoCurrencyAccountPayload instant_crypto_currency_account_payload = 27;
JapanBankAccountPayload japan_bank_account_payload = 28;
}
map<string, string> exclude_from_json_data = 15;
}
Expand Down Expand Up @@ -862,6 +863,16 @@ message NationalBankAccountPayload {
message SameBankAccountPayload {
}

message JapanBankAccountPayload {
string bank_name = 1;
string bank_code = 2;
string bank_branch_name = 3;
string bank_branch_code = 4;
string bank_account_type = 5;
string bank_account_name = 6;
string bank_account_number = 7;
}

message SpecificBanksAccountPayload {
repeated string accepted_banks = 1;
}
Expand Down
119 changes: 119 additions & 0 deletions core/src/main/java/bisq/core/payment/JapanBankAccount.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
/*
* This file is part of Bisq.
*
* Bisq is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* Bisq is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
* License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/

package bisq.core.payment;

import bisq.core.payment.payload.JapanBankAccountPayload;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.payment.payload.PaymentMethod;
import bisq.core.payment.payload.JapanBankAccountPayload;

import org.jetbrains.annotations.NotNull;

import lombok.Getter;
import lombok.Setter;

import bisq.core.locale.Country;
import bisq.core.locale.FiatCurrency;
import bisq.core.payment.payload.JapanBankAccountPayload;

public final class JapanBankAccount extends PaymentAccount
{
public JapanBankAccount()
{
super(PaymentMethod.JAPAN_BANK);
setSingleTradeCurrency(new FiatCurrency("JPY"));
}

@Override
protected PaymentAccountPayload createPayload()
{
return new JapanBankAccountPayload(paymentMethod.getId(), id);
}

// bank name
public String getBankName()
{
return ((JapanBankAccountPayload) paymentAccountPayload).getBankName();
}
public void setBankName(String bankName)
{
System.out.println("setBankName(): "+bankName);
System.out.println("paymentAccountPayload is null? "+(paymentAccountPayload == null));
((JapanBankAccountPayload) paymentAccountPayload).setBankName(bankName);
}

// bank number
public String getBankCode()
{
return ((JapanBankAccountPayload) paymentAccountPayload).getBankCode();
}
public void setBankCode(String bankCode)
{
((JapanBankAccountPayload) paymentAccountPayload).setBankCode(bankCode);
}

// branch name
public String getBankBranchName()
{
return ((JapanBankAccountPayload) paymentAccountPayload).getBankBranchName();
}
public void setBankBranchName(String bankBranchName)
{
((JapanBankAccountPayload) paymentAccountPayload).setBankBranchName(bankBranchName);
}

// branch number
public String getBankBranchCode()
{
return ((JapanBankAccountPayload) paymentAccountPayload).getBankBranchCode();
}
public void setBankBranchCode(String bankBranchCode)
{
((JapanBankAccountPayload) paymentAccountPayload).setBankBranchCode(bankBranchCode);
}

// account type
public String getBankAccountType()
{
return ((JapanBankAccountPayload) paymentAccountPayload).getBankAccountType();
}
public void setBankAccountType(String bankAccountType)
{
((JapanBankAccountPayload) paymentAccountPayload).setBankAccountType(bankAccountType);
}

// account number
public String getBankAccountNumber()
{
return ((JapanBankAccountPayload) paymentAccountPayload).getBankAccountNumber();
}
public void setBankAccountNumber(String bankAccountNumber)
{
((JapanBankAccountPayload) paymentAccountPayload).setBankAccountNumber(bankAccountNumber);
}

// account name
public String getBankAccountName()
{
return ((JapanBankAccountPayload) paymentAccountPayload).getBankAccountName();
}
public void setBankAccountName(String bankAccountName)
{
((JapanBankAccountPayload) paymentAccountPayload).setBankAccountName(bankAccountName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public static PaymentAccount getPaymentAccount(PaymentMethod paymentMethod) {
return new SameBankAccount();
case PaymentMethod.SPECIFIC_BANKS_ID:
return new SpecificBanksAccount();
case PaymentMethod.JAPAN_BANK_ID:
return new JapanBankAccount();
case PaymentMethod.ALI_PAY_ID:
return new AliPayAccount();
case PaymentMethod.WECHAT_PAY_ID:
Expand Down
Loading

0 comments on commit f2d93fd

Please sign in to comment.