Module: Simpal::API::Orders
- Defined in:
- lib/simpal/api/orders.rb
Overview
Class Method Summary collapse
-
.authorize(id, params = {}, headers: {}, client: nil) ⇒ Hash
Authorize the payment for an order.
-
.capture(id, params = {}, headers: {}, client: nil) ⇒ Hash
Capture the payment for an order.
-
.create(params = {}, headers: {}, client: nil) ⇒ Hash
Create an order.
-
.retrieve(id, headers: {}, client: nil) ⇒ Hash
Retrieve an order.
-
.update(id, params = [], headers: {}, client: nil) ⇒ Hash
Update an order.
Class Method Details
.authorize(id, params = {}, headers: {}, client: nil) ⇒ Hash
Authorize the payment for an order.
56 57 58 59 60 |
# File 'lib/simpal/api/orders.rb', line 56 def self.(id, params = {}, headers: {}, client: nil) client = Simpal.client_for(client) response = client.connection.post("/v2/checkout/orders/#{id}/authorize", params, headers) response.body end |
.capture(id, params = {}, headers: {}, client: nil) ⇒ Hash
Capture the payment for an order.
70 71 72 73 74 |
# File 'lib/simpal/api/orders.rb', line 70 def self.capture(id, params = {}, headers: {}, client: nil) client = Simpal.client_for(client) response = client.connection.post("/v2/checkout/orders/#{id}/capture", params, headers) response.body end |
.create(params = {}, headers: {}, client: nil) ⇒ Hash
Create an order.
15 16 17 18 19 |
# File 'lib/simpal/api/orders.rb', line 15 def self.create(params = {}, headers: {}, client: nil) client = Simpal.client_for(client) response = client.connection.post('/v2/checkout/orders', params, headers) response.body end |
.retrieve(id, headers: {}, client: nil) ⇒ Hash
Retrieve an order.
42 43 44 45 46 |
# File 'lib/simpal/api/orders.rb', line 42 def self.retrieve(id, headers: {}, client: nil) client = Simpal.client_for(client) response = client.connection.get("/v2/checkout/orders/#{id}", headers) response.body end |
.update(id, params = [], headers: {}, client: nil) ⇒ Hash
Update an order.
29 30 31 32 33 |
# File 'lib/simpal/api/orders.rb', line 29 def self.update(id, params = [], headers: {}, client: nil) client = Simpal.client_for(client) response = client.connection.patch("/v2/checkout/orders/#{id}", params, headers) response.body end |