Class: ActiveMerchant::Billing::IatsPaymentsGateway
- Defined in:
- lib/active_merchant/billing/gateways/iats_payments.rb
Constant Summary collapse
- ACTIONS =
{ purchase: "ProcessCreditCardV1", purchase_check: "ProcessACHEFTV1", refund: "ProcessCreditCardRefundWithTransactionIdV1", refund_check: "ProcessACHEFTRefundWithTransactionIdV1", store: "CreateCreditCardCustomerCodeV1", unstore: "DeleteCustomerCodeV1" }
Constants inherited from Gateway
Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::CURRENCIES_WITHOUT_FRACTIONS, Gateway::DEBIT_CARDS, Gateway::RECURRING_DEPRECATION_MESSAGE, Gateway::STANDARD_ERROR_CODE
Instance Attribute Summary
Attributes inherited from Gateway
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ IatsPaymentsGateway
constructor
A new instance of IatsPaymentsGateway.
- #purchase(money, payment, options = {}) ⇒ Object
- #refund(money, authorization, options = {}) ⇒ Object
- #store(credit_card, options = {}) ⇒ Object
- #unstore(authorization, options = {}) ⇒ Object
Methods inherited from Gateway
#card_brand, card_brand, #generate_unique_id, inherited, non_fractional_currency?, #scrub, supported_countries, #supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #supports_scrubbing?, #test?
Methods included from CreditCardFormatting
Methods included from PostsData
included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request
Constructor Details
#initialize(options = {}) ⇒ IatsPaymentsGateway
Returns a new instance of IatsPaymentsGateway.
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/active_merchant/billing/gateways/iats_payments.rb', line 25 def initialize(={}) if([:login]) ActiveMerchant.deprecated("The 'login' option is deprecated in favor of 'agent_code' and will be removed in a future version.") [:agent_code] = [:login] end [:region] = 'na' unless [:region] requires!(, :agent_code, :password, :region) super end |
Instance Method Details
#purchase(money, payment, options = {}) ⇒ Object
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/active_merchant/billing/gateways/iats_payments.rb', line 37 def purchase(money, payment, ={}) post = {} add_invoice(post, money, ) add_payment(post, payment) add_address(post, ) add_ip(post, ) add_description(post, ) commit((payment.is_a?(Check) ? :purchase_check : :purchase), post) end |
#refund(money, authorization, options = {}) ⇒ Object
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/active_merchant/billing/gateways/iats_payments.rb', line 48 def refund(money, , ={}) post = {} transaction_id, payment_type = () post[:transaction_id] = transaction_id add_invoice(post, -money, ) add_ip(post, ) add_description(post, ) commit((payment_type == 'check' ? :refund_check : :refund), post) end |
#store(credit_card, options = {}) ⇒ Object
59 60 61 62 63 64 65 66 67 68 |
# File 'lib/active_merchant/billing/gateways/iats_payments.rb', line 59 def store(credit_card, = {}) post = {} add_payment(post, credit_card) add_address(post, ) add_ip(post, ) add_description(post, ) add_store_defaults(post) commit(:store, post) end |
#unstore(authorization, options = {}) ⇒ Object
70 71 72 73 74 75 76 |
# File 'lib/active_merchant/billing/gateways/iats_payments.rb', line 70 def unstore(, = {}) post = {} post[:customer_code] = add_ip(post, ) commit(:unstore, post) end |