lib/adyen/services/checkout.rb in adyen-ruby-api-library-6.2.0 vs lib/adyen/services/checkout.rb in adyen-ruby-api-library-6.3.0

- old
+ new

@@ -1,21 +1,21 @@ require_relative "service" module Adyen class Checkout < Service - DEFAULT_VERSION = 68 + DEFAULT_VERSION = 70 def initialize(client, version = DEFAULT_VERSION) service = "Checkout" method_names = [ :payment_session, :origin_keys, :sessions ] with_application_info = [ - :payment_session, + :payment_session ] super(client, version, service, method_names, with_application_info) end @@ -40,11 +40,11 @@ when 0 Adyen::CheckoutLink.new(@client, @version) else action = "paymentLinks" args[1] ||= {} # optional headers arg - @client.call_adyen_api(@service, action, args[0], args[1], @version, true) + @client.call_adyen_api(@service, action, args[0], args[1], @version) end end def payment_methods(*args) case args.size @@ -73,10 +73,14 @@ end def modifications @modifications ||= Adyen::Modifications.new(@client, @version) end + + def stored_payment_methods + @stored_payment_methods ||= Adyen::StoredPaymentMethods.new(@client, @version) + end end class CheckoutDetail < Service def initialize(client, version = DEFAULT_VERSION) @service = "Checkout" @@ -91,10 +95,20 @@ def result(request, headers = {}) action = "payments/result" @client.call_adyen_api(@service, action, request, headers, @version) end + + def donations(request, headers = {}) + action = "donations" + @client.call_adyen_api(@service, action, request, headers, @version) + end + + def card_details(request, headers = {}) + action = "cardDetails" + @client.call_adyen_api(@service, action, request, headers, @version) + end end class CheckoutLink < Service def initialize(client, version = DEFAULT_VERSION) @service = "Checkout" @@ -102,16 +116,16 @@ @version = version end def get(linkId, headers = {}) action = { method: 'get', url: "paymentLinks/" + linkId } - @client.call_adyen_api(@service, action, {}, headers, @version, true) + @client.call_adyen_api(@service, action, {}, headers, @version) end def update(linkId, request, headers = {}) action = { method: 'patch', url: "paymentLinks/" + linkId } - @client.call_adyen_api(@service, action, request, headers, @version, false) + @client.call_adyen_api(@service, action, request, headers, @version) end end class CheckoutMethod < Service def initialize(client, version = DEFAULT_VERSION) @@ -159,34 +173,52 @@ @version = version end def capture(linkId, request, headers = {}) action = "payments/" + linkId + "/captures" - @client.call_adyen_api(@service, action, request, headers, @version, false) + @client.call_adyen_api(@service, action, request, headers, @version) end def cancel(linkId, request, headers = {}) action = "payments/" + linkId + "/cancels" - @client.call_adyen_api(@service, action, request, headers, @version, false) + @client.call_adyen_api(@service, action, request, headers, @version) end def genericCancel(request, headers = {}) action = "cancels" @client.call_adyen_api(@service, action, request, headers, @version) end def refund(linkId, request, headers = {}) action = "payments/" + linkId + "/refunds" - @client.call_adyen_api(@service, action, request, headers, @version, false) + @client.call_adyen_api(@service, action, request, headers, @version) end def reversal(linkId, request, headers = {}) action = "payments/" + linkId + "/reversals" - @client.call_adyen_api(@service, action, request, headers, @version, false) + @client.call_adyen_api(@service, action, request, headers, @version) end def amountUpdate(linkId, request, headers = {}) action = "payments/" + linkId + "/amountUpdates" - @client.call_adyen_api(@service, action, request, headers, @version, false) + @client.call_adyen_api(@service, action, request, headers, @version) end end -end + + class StoredPaymentMethods < Service + def initialize(client, version = DEFAULT_VERSION) + @service = "Checkout" + @client = client + @version = version + end + + def get(query_array={}, headers = {}) + action = { method: 'get', url: "storedPaymentMethods" + create_query_string(query_array)} + @client.call_adyen_api(@service, action, {}, headers, @version) + end + + def delete(recurringId, query_array={}, headers = {}) + action = { method: 'delete', url: "storedPaymentMethods/%s" % recurringId + create_query_string(query_array)} + @client.call_adyen_api(@service, action, {}, headers, @version) + end + end +end \ No newline at end of file