Sha256: ed344edfb21113e5d83a60d0356c4f0a31b4a773b68160998362074e1aeba207
Contents?: true
Size: 1.15 KB
Versions: 8
Compression:
Stored size: 1.15 KB
Contents
require_relative '../service' module Adyen class OrdersApi < Service attr_accessor :service, :version def initialize(client, version = DEFAULT_VERSION) super(client, version, 'Checkout') end def orders(request, headers: {}) endpoint = '/orders'.gsub(/{.+?}/, '%s') endpoint = endpoint.gsub(%r{^/}, '') endpoint = format(endpoint) action = { method: 'post', url: endpoint } @client.call_adyen_api(@service, action, request, headers, @version) end def cancel_order(request, headers: {}) endpoint = '/orders/cancel'.gsub(/{.+?}/, '%s') endpoint = endpoint.gsub(%r{^/}, '') endpoint = format(endpoint) action = { method: 'post', url: endpoint } @client.call_adyen_api(@service, action, request, headers, @version) end def get_balance_of_gift_card(request, headers: {}) endpoint = '/paymentMethods/balance'.gsub(/{.+?}/, '%s') endpoint = endpoint.gsub(%r{^/}, '') endpoint = format(endpoint) action = { method: 'post', url: endpoint } @client.call_adyen_api(@service, action, request, headers, @version) end end end
Version data entries
8 entries across 8 versions & 1 rubygems