Class: ActiveMerchant::Billing::KomojuGateway
- Defined in:
- lib/active_merchant/billing/gateways/komoju.rb
Constant Summary collapse
- STANDARD_ERROR_CODE_MAPPING =
{ 'bad_verification_value' => 'incorrect_cvc', 'card_expired' => 'expired_card', 'card_declined' => 'card_declined', 'invalid_number' => 'invalid_number' }
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
-
#initialize(options = {}) ⇒ KomojuGateway
constructor
A new instance of KomojuGateway.
- #purchase(money, payment, options = {}) ⇒ Object
- #refund(money, identification, options = {}) ⇒ Object
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 CreditCardFormatting
#expdate, #format, #strftime_yyyymm
Methods included from PostsData
included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request
Constructor Details
#initialize(options = {}) ⇒ KomojuGateway
Returns a new instance of KomojuGateway.
22 23 24 25 |
# File 'lib/active_merchant/billing/gateways/komoju.rb', line 22 def initialize( = {}) requires!(, :login) super end |
Instance Method Details
#purchase(money, payment, options = {}) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/active_merchant/billing/gateways/komoju.rb', line 27 def purchase(money, payment, = {}) post = {} post[:amount] = amount(money) post[:description] = [:description] add_payment_details(post, payment, ) post[:currency] = [:currency] || default_currency post[:external_order_num] = [:order_id] if [:order_id] post[:tax] = [:tax] if [:tax] add_fraud_details(post, ) commit('/payments', post) end |
#refund(money, identification, options = {}) ⇒ Object
40 41 42 |
# File 'lib/active_merchant/billing/gateways/komoju.rb', line 40 def refund(money, identification, = {}) commit("/payments/#{identification}/refund", {}) end |