Class: PFS::API::TransfersService
- Defined in:
- lib/pfs/api/transfers_service.rb
Instance Attribute Summary
Attributes inherited from Service
Instance Method Summary collapse
- #create(account_id, currency, amount, destination, destination_id, country, first_name, last_name, options = {}) ⇒ Object
- #internal(from_account_id, to_account_id, amount, currency, fee_code, description, terminal_id) ⇒ Object
Methods inherited from Service
Constructor Details
This class inherits a constructor from PFS::API::Service
Instance Method Details
#create(account_id, currency, amount, destination, destination_id, country, first_name, last_name, options = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/pfs/api/transfers_service.rb', line 6 def create(account_id, currency, amount, destination, destination_id, country, first_name, last_name, = {}) data = { currency: currency, paymentamount: amount, accountidentifier: destination, bankidentifier: destination_id, countrycode: country, firstname: first_name, lastname: last_name, } data[:isinstant] = true if [:instant] data[:reference] = [:reference] if [:reference] data[:unstructuredreference] = [:unstructured_reference] if [:unstructured_reference] data[:userdefinedfields] = [:user_defined_fields] if [:user_defined_fields] response = client.post("/BankPayment/#{account_id}/OneOffPayment", data, ) Resources::Transfers::Transfer.new(response, response.body[:data]) end |
#internal(from_account_id, to_account_id, amount, currency, fee_code, description, terminal_id) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/pfs/api/transfers_service.rb', line 24 def internal(from_account_id, to_account_id, amount, currency, fee_code, description, terminal_id) data = { id: from_account_id, toId: to_account_id, amount: amount, currencyCode: currency, description: description, feeCode: fee_code, terminalId: terminal_id, } response = client.post("/Account/CardholderToCardholderTransfer", data) Resources::Transfers::InternalTransfer.new(response, response.body[:data]) end |