Accept an ACH Payment
Taking a Payment
You first want to collect bank account information and populate a BankAccount object.
var bankAccount = BankAccount(personName = "Jim Parsnip",
bankType = "savings",
bankAccount = "9876543210",
bankRouting = "021000021",
addressZip = "32822")
Once you have a BankAccount object, create a _TransactionRequest _object with it and pass it to Omni’s pay method.
let transactionRequest = TransactionRequest(amount: Amount(cents: 3), bankAccount: bankAccount)
omni?.pay(transactionRequest: transactionRequest, completion: { completedTransaction in
self.log("Finished transaction successfully")
}, error: { error in
self.log(error)
})
Tokenizing
To tokenize a card, complete the following:
omni.tokenize(card, completion: { (paymentMethod) in
}) { error in
}
Testing
If you’d like to try tokenization without real payment information, you can use the _BankAccount.testBankAccount() _methods to get a test bank account.
let bankAccount = BankAccount.testBankAccount()
If you want to test failures, you can use the following method:
let failingBankAccount = BankAccount.failingTestBankAccount()
Or you can create the BankAccount object with the following testing payment information:
BANK ROUTING & ACCOUNT NUMBERS
Routing #: 021000021
Account #: 9876543210
To test failing bank accounts, use the given routing number and any other account number.
Updated 7 months ago