Skip to content

Commit c4ebb61

Browse files
authored
Merge pull request #14 from divyavarghs13/master
Committed for generating random Account Number.
2 parents 683f0ab + ca26c81 commit c4ebb61

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

PaymentTransactions/credit-bank-account.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ function creditBankAccount(transactionId, callback) {
1515
var bankAccountType = new ApiContracts.BankAccountType();
1616
bankAccountType.setAccountType(ApiContracts.BankAccountTypeEnum.SAVINGS);
1717
bankAccountType.setRoutingNumber('121042882');
18-
bankAccountType.setAccountNumber('123456789');
18+
//added code
19+
var bankAccountNum = Math.floor(Math.random() * 9999999999) + 10000;
20+
bankAccountType.setAccountNumber(bankAccountNum.toString());
1921
bankAccountType.setNameOnAccount('John Doe');
2022
paymentType.setBankAccount(bankAccountType);
2123

@@ -86,7 +88,7 @@ function creditBankAccount(transactionId, callback) {
8688
}
8789

8890
if (require.main === module) {
89-
creditBankAccount('2259770464', function(){
91+
creditBankAccount("MerchantID-0001", function(){
9092
console.log('creditBankAccount call complete.');
9193
});
9294
}

PaymentTransactions/debit-bank-account.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ function debitBankAccount(callback) {
1313
var bankAccountType = new ApiContracts.BankAccountType();
1414
bankAccountType.setAccountType(ApiContracts.BankAccountTypeEnum.SAVINGS);
1515
bankAccountType.setRoutingNumber('121042882');
16-
bankAccountType.setAccountNumber('123456789');
16+
//added code
17+
var bankAccountNum = Math.floor(Math.random() * 9999999999) + 10000;
18+
bankAccountType.setAccountNumber(bankAccountNum.toString());
1719
bankAccountType.setNameOnAccount('John Doe');
1820

1921
var paymentType = new ApiContracts.PaymentType();

0 commit comments

Comments
 (0)