Module: Simpal::API::Payments::Authorizations
- Defined in:
- lib/simpal/api/payments/authorizations.rb
Overview
Class Method Summary collapse
-
.capture(id, params = {}, headers: {}, client: nil) ⇒ Hash
Capture an authorized payment.
-
.reauthorize(id, params = {}, headers: {}, client: nil) ⇒ Hash
Reauthorize an authorized payment.
-
.retrieve(id, headers: {}, client: nil) ⇒ Hash
Retrieve an authorized payment.
-
.void(id, headers: {}, client: nil) ⇒ Boolean
Void an authorized payment.
Class Method Details
.capture(id, params = {}, headers: {}, client: nil) ⇒ Hash
Capture an authorized payment.
32 33 34 35 36 |
# File 'lib/simpal/api/payments/authorizations.rb', line 32 def self.capture(id, params = {}, headers: {}, client: nil) client = Simpal.client_for(client) response = client.connection.post("/v2/payments/authorizations/#{id}/capture", params, headers) response.body end |
.reauthorize(id, params = {}, headers: {}, client: nil) ⇒ Hash
Reauthorize an authorized payment.
46 47 48 49 50 |
# File 'lib/simpal/api/payments/authorizations.rb', line 46 def self.(id, params = {}, headers: {}, client: nil) client = Simpal.client_for(client) response = client.connection.post("/v2/payments/authorizations/#{id}/reauthorize", params, headers) response.body end |
.retrieve(id, headers: {}, client: nil) ⇒ Hash
Retrieve an authorized payment.
18 19 20 21 22 |
# File 'lib/simpal/api/payments/authorizations.rb', line 18 def self.retrieve(id, headers: {}, client: nil) client = Simpal.client_for(client) response = client.connection.get("/v2/payments/authorizations/#{id}", headers) response.body end |
.void(id, headers: {}, client: nil) ⇒ Boolean
Void an authorized payment.
59 60 61 62 63 |
# File 'lib/simpal/api/payments/authorizations.rb', line 59 def self.void(id, headers: {}, client: nil) client = Simpal.client_for(client) response = client.connection.post("/v2/payments/authorizations/#{id}/void", nil, headers) response.success? end |