Class: ActiveMerchant::Billing::PaystationGateway
- Defined in:
- lib/active_merchant/billing/gateways/paystation.rb
Constant Summary collapse
- SUCCESSFUL_RESPONSE_CODE =
an “error code” of “0” means “No error - transaction successful”
'0'
- SUCCESSFUL_FUTURE_PAYMENT =
an “error code” of “34” means “Future Payment Stored OK”
'34'
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
- #authorize(money, credit_card, options = {}) ⇒ Object
- #capture(money, authorization_token, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ PaystationGateway
constructor
A new instance of PaystationGateway.
- #purchase(money, payment_source, options = {}) ⇒ Object
- #refund(money, authorization, options = {}) ⇒ Object
- #store(credit_card, 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 = {}) ⇒ PaystationGateway
Returns a new instance of PaystationGateway.
25 26 27 28 |
# File 'lib/active_merchant/billing/gateways/paystation.rb', line 25 def initialize( = {}) requires!(, :paystation_id, :gateway_id) super end |
Instance Method Details
#authorize(money, credit_card, options = {}) ⇒ Object
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/active_merchant/billing/gateways/paystation.rb', line 30 def (money, credit_card, = {}) post = new_request add_invoice(post, ) add_amount(post, money, ) add_credit_card(post, credit_card) (post, ) commit(post) end |
#capture(money, authorization_token, options = {}) ⇒ Object
41 42 43 44 45 46 47 48 49 |
# File 'lib/active_merchant/billing/gateways/paystation.rb', line 41 def capture(money, , = {}) post = new_request add_invoice(post, ) add_amount(post, money, ) (post, , [:credit_card_verification]) commit(post) end |
#purchase(money, payment_source, options = {}) ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/active_merchant/billing/gateways/paystation.rb', line 51 def purchase(money, payment_source, = {}) post = new_request add_invoice(post, ) add_amount(post, money, ) if payment_source.is_a?(String) add_token(post, payment_source) else add_credit_card(post, payment_source) end add_customer_data(post, ) if .has_key?(:customer) commit(post) end |
#refund(money, authorization, options = {}) ⇒ Object
79 80 81 82 83 84 85 86 |
# File 'lib/active_merchant/billing/gateways/paystation.rb', line 79 def refund(money, , ={}) post = new_request add_amount(post, money, ) add_invoice(post, ) add_refund_specific_fields(post, ) commit(post) end |
#store(credit_card, options = {}) ⇒ Object
68 69 70 71 72 73 74 75 76 |
# File 'lib/active_merchant/billing/gateways/paystation.rb', line 68 def store(credit_card, = {}) post = new_request add_invoice(post, ) add_credit_card(post, credit_card) store_credit_card(post, ) commit(post) end |