module Simpal::API::Payments::Captures

@see developer.paypal.com/docs/api/payments/v2/#captures

Public Class Methods

refund(id, params = {}, headers: {}, client: nil) click to toggle source

Refund a captured payment.

@param id [String] The ID of a captured payment. @param params [Hash] The parameters for the refund 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/captures.rb, line 32
def self.refund(id, params = {}, headers: {}, client: nil)
  client = Simpal.client_for(client)
  response = client.connection.post("/v2/payments/captures/#{id}/refund", params, headers)
  response.body
end
retrieve(id, headers: {}, client: nil) click to toggle source

Retrieve a captured payment.

@param id [String] The ID of a captured 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 captured payment.

# File lib/simpal/api/payments/captures.rb, line 18
def self.retrieve(id, headers: {}, client: nil)
  client = Simpal.client_for(client)
  response = client.connection.get("/v2/payments/captures/#{id}", headers)
  response.body
end