Class: ActiveMerchant::Billing::AleloGateway
- Defined in:
- lib/active_merchant/billing/gateways/alelo.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
-
#initialize(options = {}) ⇒ AleloGateway
constructor
A new instance of AleloGateway.
- #purchase(money, payment, options = {}) ⇒ Object
- #refund(money, authorization, options = {}) ⇒ Object
- #scrub(transcript) ⇒ Object
- #supports_scrubbing? ⇒ Boolean
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 = {}) ⇒ AleloGateway
Returns a new instance of AleloGateway.
19 20 21 22 |
# File 'lib/active_merchant/billing/gateways/alelo.rb', line 19 def initialize( = {}) requires!(, :client_id, :client_secret) super end |
Instance Method Details
#purchase(money, payment, options = {}) ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/active_merchant/billing/gateways/alelo.rb', line 24 def purchase(money, payment, = {}) post = {} add_order(post, ) add_amount(post, money) add_payment(post, payment) add_geolocation(post, ) add_extra_data(post, ) commit('capture/transaction', post, ) end |
#refund(money, authorization, options = {}) ⇒ Object
35 36 37 38 39 |
# File 'lib/active_merchant/billing/gateways/alelo.rb', line 35 def refund(money, , = {}) request_id = .split('#').first [:http] = { method: :put, prevent_encrypt: true } commit('capture/transaction/refund', { requestId: request_id }, , :put) end |
#scrub(transcript) ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'lib/active_merchant/billing/gateways/alelo.rb', line 45 def scrub(transcript) force_utf8(transcript.encode). gsub(%r((Authorization: Bearer )[\w -]+), '\1[FILTERED]'). gsub(%r((client_id=|Client-Id:)[\w -]+), '\1[FILTERED]\2'). gsub(%r((client_secret=|Client-Secret:)[\w -]+), '\1[FILTERED]\2'). gsub(%r((access_token\":\")[^\"]*), '\1[FILTERED]'). gsub(%r((publicKey\":\")[^\"]*), '\1[FILTERED]') end |
#supports_scrubbing? ⇒ Boolean
41 42 43 |
# File 'lib/active_merchant/billing/gateways/alelo.rb', line 41 def supports_scrubbing? true end |