Class: ActiveMerchant::Billing::DLocalGateway
- Defined in:
- lib/active_merchant/billing/gateways/d_local.rb
Constant Summary
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, payment, options = {}) ⇒ Object
- #capture(money, authorization, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ DLocalGateway
constructor
A new instance of DLocalGateway.
- #purchase(money, payment, options = {}) ⇒ Object
- #refund(money, authorization, options = {}) ⇒ Object
- #scrub(transcript) ⇒ Object
- #supports_scrubbing? ⇒ Boolean
- #verify(credit_card, options = {}) ⇒ Object
- #void(authorization, 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, #supported_countries, supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #test?
Methods included from CreditCardFormatting
Methods included from PostsData
included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request
Constructor Details
#initialize(options = {}) ⇒ DLocalGateway
Returns a new instance of DLocalGateway.
14 15 16 17 |
# File 'lib/active_merchant/billing/gateways/d_local.rb', line 14 def initialize( = {}) requires!(, :login, :trans_key, :secret_key) super end |
Instance Method Details
#authorize(money, payment, options = {}) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/active_merchant/billing/gateways/d_local.rb', line 26 def (money, payment, = {}) post = {} add_auth_purchase_params(post, money, payment, 'authorize', ) commit('authorize', post, ) end |
#capture(money, authorization, options = {}) ⇒ Object
33 34 35 36 37 38 |
# File 'lib/active_merchant/billing/gateways/d_local.rb', line 33 def capture(money, , = {}) post = {} post[:authorization_id] = add_invoice(post, money, ) if money commit('capture', post, ) end |
#purchase(money, payment, options = {}) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/active_merchant/billing/gateways/d_local.rb', line 19 def purchase(money, payment, = {}) post = {} add_auth_purchase_params(post, money, payment, 'purchase', ) commit('purchase', post, ) end |
#refund(money, authorization, options = {}) ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/active_merchant/billing/gateways/d_local.rb', line 40 def refund(money, , = {}) post = {} post[:payment_id] = post[:notification_url] = [:notification_url] add_invoice(post, money, ) if money commit('refund', post, ) end |
#scrub(transcript) ⇒ Object
65 66 67 68 69 70 |
# File 'lib/active_merchant/billing/gateways/d_local.rb', line 65 def scrub(transcript) transcript. gsub(%r((X-Trans-Key: )\w+), '\1[FILTERED]'). gsub(%r((\"number\\\":\\\")\d+), '\1[FILTERED]'). gsub(%r((\"cvv\\\":\\\")\d+), '\1[FILTERED]') end |
#supports_scrubbing? ⇒ Boolean
61 62 63 |
# File 'lib/active_merchant/billing/gateways/d_local.rb', line 61 def supports_scrubbing? true end |
#verify(credit_card, options = {}) ⇒ Object
54 55 56 57 58 59 |
# File 'lib/active_merchant/billing/gateways/d_local.rb', line 54 def verify(credit_card, = {}) MultiResponse.run(:use_first_response) do |r| r.process { (100, credit_card, ) } r.process(:ignore_result) { void(r., ) } end end |
#void(authorization, options = {}) ⇒ Object
48 49 50 51 52 |
# File 'lib/active_merchant/billing/gateways/d_local.rb', line 48 def void(, = {}) post = {} post[:authorization_id] = commit('void', post, ) end |