Class: ActiveMerchant::Billing::LoanPaymentProAchGateway
- Inherits:
-
LoanPaymentProGateway
- Object
- Gateway
- LoanPaymentProGateway
- ActiveMerchant::Billing::LoanPaymentProAchGateway
- Defined in:
- lib/active_merchant/billing/gateways/loan_payment_pro_ach.rb
Constant Summary collapse
- API_VERSION =
'1.4.2.36'.freeze
Constants inherited from LoanPaymentProGateway
ActiveMerchant::Billing::LoanPaymentProGateway::RESPONSE_CODE_MAPPING
Constants inherited from Gateway
Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::RECURRING_DEPRECATION_MESSAGE, Gateway::STANDARD_ERROR_CODE
Instance Attribute Summary
Attributes inherited from Gateway
Instance Method Summary collapse
- #authorize(money, bank_account, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ LoanPaymentProAchGateway
constructor
A new instance of LoanPaymentProAchGateway.
- #purchase(money, bank_account, options = {}) ⇒ Object
- #refund(money, authorization, options = {}) ⇒ Object
- #void(authorization, options = {}) ⇒ Object
Methods inherited from LoanPaymentProGateway
#capture, #scrub, #store, #supports_scrubbing?, #unstore, #verify
Methods inherited from Gateway
#add_field_to_post_if_present, #add_fields_to_post_if_present, #card_brand, card_brand, #generate_unique_id, inherited, #scrub, #supported_countries, supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #supports_scrubbing?, #test?
Methods included from Versionable
Methods included from CreditCardFormatting
#expdate, #format, #strftime_yyyymm, #strftime_yyyymmdd_last_day
Methods included from PostsData
included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request
Constructor Details
#initialize(options = {}) ⇒ LoanPaymentProAchGateway
Returns a new instance of LoanPaymentProAchGateway.
9 10 11 12 |
# File 'lib/active_merchant/billing/gateways/loan_payment_pro_ach.rb', line 9 def initialize( = {}) requires!(, :login, :password) super end |
Instance Method Details
#authorize(money, bank_account, options = {}) ⇒ Object
27 28 29 |
# File 'lib/active_merchant/billing/gateways/loan_payment_pro_ach.rb', line 27 def (money, bank_account, = {}) purchase(money, bank_account, .merge(method: :Authorize)) end |
#purchase(money, bank_account, options = {}) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/active_merchant/billing/gateways/loan_payment_pro_ach.rb', line 14 def purchase(money, bank_account, = {}) post = { Method: .delete(:method) || :Debit, ReferenceNumber: [:order_id] || SecureRandom.uuid, Name: bank_account.name, Amount: amount(money), RoutingNumber: bank_account.routing_number, AccountNumber: bank_account.account_number } commit(post) end |
#refund(money, authorization, options = {}) ⇒ Object
39 40 41 42 43 44 45 46 |
# File 'lib/active_merchant/billing/gateways/loan_payment_pro_ach.rb', line 39 def refund(money, , = {}) post = { Method: :Refund, TransactionId: .to_s.split('|').first, Amount: amount(money) } commit(post) end |
#void(authorization, options = {}) ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/active_merchant/billing/gateways/loan_payment_pro_ach.rb', line 31 def void(, = {}) post = { Method: :Cancel, TransactionId: .to_s.split('|').first } commit(post) end |