module Simpal::API::Payments::Authorizations
@see developer.paypal.com/docs/api/payments/v2/#authorizations
Public Class Methods
Capture an authorized payment.
@param id [String] The ID of an authorized payment. @param params [Hash] The parameters for the capture request. @param headers [Hash] The custom headers to add to the request. @param client [Simpal::Client] The API
client to make the request with. @return [Hash] A Hash representing the captured payment.
# 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
Retrieve an authorized payment.
@param id [String] The ID of an authorized payment. @param headers [Hash] The custom headers to add to the request. @param client [Simpal::Client] The API
client to make the request with. @return [Hash] A Hash representing the authorized payment.
# 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 an authorized payment.
@param id [String] The ID of an authorized payment. @param headers [Hash] The custom headers to add to the request. @param client [Simpal::Client] The API
client to make the request with. @return [Hash] An empty hash.
# 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.body end