Class: Docdata::Order::Client
- Inherits:
-
Object
- Object
- Docdata::Order::Client
- Defined in:
- lib/docdata/order/client.rb
Overview
Client for the Docdata Order API.
Constant Summary collapse
- XMLNS_DDP =
'http://www.docdatapayments.com/services/paymentservice/1_3/'- DDP_VERSION =
'1.3'
Instance Method Summary collapse
- #create(options = {}) ⇒ Object
-
#initialize(name, password, options = {}) ⇒ Client
constructor
A new instance of Client.
- #payment_methods(options = {}) ⇒ Object
- #refund(options = {}) ⇒ Object
- #start(options = {}) ⇒ Object
- #status(options = {}) ⇒ Object
Constructor Details
#initialize(name, password, options = {}) ⇒ Client
Returns a new instance of Client.
12 13 14 |
# File 'lib/docdata/order/client.rb', line 12 def initialize(name, password, = {}) = .merge(merchant: { name: name, password: password }) end |
Instance Method Details
#create(options = {}) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/docdata/order/client.rb', line 16 def create( = {}) params = .merge() response = call(:create, CreateRequest.new(params)) CreateResponse.new(params, response) end |
#payment_methods(options = {}) ⇒ Object
44 45 46 47 48 49 |
# File 'lib/docdata/order/client.rb', line 44 def payment_methods( = {}) params = .merge() response = call(:list_payment_methods, ListPaymentMethodsRequest.new(params)) ListPaymentMethodsResponse.new(params, response) end |
#refund(options = {}) ⇒ Object
37 38 39 40 41 42 |
# File 'lib/docdata/order/client.rb', line 37 def refund( = {}) params = .merge() response = call(:refund, RefundRequest.new(params)) RefundResponse.new(params, response) end |
#start(options = {}) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/docdata/order/client.rb', line 23 def start( = {}) params = .merge() response = call(:start, StartRequest.new(params)) StartResponse.new(params, response) end |
#status(options = {}) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/docdata/order/client.rb', line 30 def status( = {}) params = .merge() response = call(:status_extended, ExtendedStatusRequest.new(params)) ExtendedStatusResponse.new(params, response) end |