forked from Adyen/adyen-ruby-api-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
binLookup.rb
30 lines (24 loc) · 895 Bytes
/
binLookup.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
require_relative './service'
module Adyen
class BinLookup < Service
attr_accessor :service, :version
DEFAULT_VERSION = 54
def initialize(client, version = DEFAULT_VERSION)
super(client, version, 'BinLookup')
end
def get3ds_availability(request, headers: {})
endpoint = '/get3dsAvailability'.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_cost_estimate(request, headers: {})
endpoint = '/getCostEstimate'.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