Class: Adyen::PaymentsApi
- Defined in:
- lib/adyen/services/checkout/payments_api.rb
Instance Attribute Summary collapse
-
#service ⇒ Object
Returns the value of attribute service.
-
#version ⇒ Object
Returns the value of attribute version.
Attributes inherited from Service
Instance Method Summary collapse
- #card_details(request, headers: {}) ⇒ Object
- #donations(request, headers: {}) ⇒ Object
-
#initialize(client, version = DEFAULT_VERSION) ⇒ PaymentsApi
constructor
A new instance of PaymentsApi.
- #payment_methods(request, headers: {}) ⇒ Object
- #payments(request, headers: {}) ⇒ Object
- #payments_details(request, headers: {}) ⇒ Object
- #sessions(request, headers: {}) ⇒ Object
Methods inherited from Service
Constructor Details
#initialize(client, version = DEFAULT_VERSION) ⇒ PaymentsApi
Returns a new instance of PaymentsApi.
8 9 10 11 12 |
# File 'lib/adyen/services/checkout/payments_api.rb', line 8 def initialize(client, version = DEFAULT_VERSION) @service = "Checkout" @client = client @version = version end |
Instance Attribute Details
#service ⇒ Object
Returns the value of attribute service.
6 7 8 |
# File 'lib/adyen/services/checkout/payments_api.rb', line 6 def service @service end |
#version ⇒ Object
Returns the value of attribute version.
6 7 8 |
# File 'lib/adyen/services/checkout/payments_api.rb', line 6 def version @version end |
Instance Method Details
#card_details(request, headers: {}) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/adyen/services/checkout/payments_api.rb', line 14 def card_details(request, headers: {} ) """ Get the list of brands on the card """ endpoint = "/cardDetails".gsub(/{.+?}/, '%s') endpoint = endpoint.gsub(/^\//, "") endpoint = endpoint % [] action = { method: "post", url: endpoint} @client.call_adyen_api(@service, action, request, headers, @version) end |
#donations(request, headers: {}) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/adyen/services/checkout/payments_api.rb', line 26 def donations(request, headers: {} ) """ Start a transaction for donations """ endpoint = "/donations".gsub(/{.+?}/, '%s') endpoint = endpoint.gsub(/^\//, "") endpoint = endpoint % [] action = { method: "post", url: endpoint} @client.call_adyen_api(@service, action, request, headers, @version) end |
#payment_methods(request, headers: {}) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/adyen/services/checkout/payments_api.rb', line 38 def payment_methods(request, headers: {} ) """ Get a list of available payment methods """ endpoint = "/paymentMethods".gsub(/{.+?}/, '%s') endpoint = endpoint.gsub(/^\//, "") endpoint = endpoint % [] action = { method: "post", url: endpoint} @client.call_adyen_api(@service, action, request, headers, @version) end |
#payments(request, headers: {}) ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/adyen/services/checkout/payments_api.rb', line 50 def payments(request, headers: {} ) """ Start a transaction """ endpoint = "/payments".gsub(/{.+?}/, '%s') endpoint = endpoint.gsub(/^\//, "") endpoint = endpoint % [] action = { method: "post", url: endpoint} @client.call_adyen_api(@service, action, request, headers, @version) end |
#payments_details(request, headers: {}) ⇒ Object
62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/adyen/services/checkout/payments_api.rb', line 62 def payments_details(request, headers: {} ) """ Submit details for a payment """ endpoint = "/payments/details".gsub(/{.+?}/, '%s') endpoint = endpoint.gsub(/^\//, "") endpoint = endpoint % [] action = { method: "post", url: endpoint} @client.call_adyen_api(@service, action, request, headers, @version) end |
#sessions(request, headers: {}) ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/adyen/services/checkout/payments_api.rb', line 74 def sessions(request, headers: {} ) """ Create a payment session """ endpoint = "/sessions".gsub(/{.+?}/, '%s') endpoint = endpoint.gsub(/^\//, "") endpoint = endpoint % [] action = { method: "post", url: endpoint} @client.call_adyen_api(@service, action, request, headers, @version) end |