Class: Leetchi::ImmediateContribution

Inherits:
Ressource
  • Object
show all
Defined in:
lib/leetchi/immediate_contribution.rb

Overview

An immediate contribution is a request to process directly a payment with a payment card already registred by the user.

Class Method Summary collapse

Class Method Details

.create(data) ⇒ Object

Create an immediate contribution

  • Args :
    • data -> A JSON with the following attributes (Square brackets for optionals): * [Tag] * UserID * WalletID * Amount * PaymentCardID * [ClientFeeAmount]
  • Returns :
    • An immediate contribution object


18
19
20
# File 'lib/leetchi/immediate_contribution.rb', line 18

def self.create(data)
  post_request('immediate-contributions', data)
end

.details(immediate_contribution_id) ⇒ Object

Get an immediate contribution

  • Args :
    • immediate_contribution_id -> The id of the immediate contribution you want to retrieve
  • Returns :
    • An immediate contribution object


29
30
31
# File 'lib/leetchi/immediate_contribution.rb', line 29

def self.details(immediate_contribution_id)
  get_request(File.join('immediate-contributions', immediate_contribution_id.to_s))
end

.get_refund(immediate_contribution_refund_id) ⇒ Object

Get a refund object

  • Args :
    • immediate_contribution_refund_id -> The id of the refund you want to retrieve
  • Returns :
    • A refund object


54
55
56
# File 'lib/leetchi/immediate_contribution.rb', line 54

def self.get_refund(immediate_contribution_refund_id)
  get_request(File.join('refunds', immediate_contribution_refund_id.to_s))
end

.refund(data) ⇒ Object

Refund a given immediate contribution

  • Args :
    • data -> A JSON with the following attributes (Square brackets for optionals): * [Tag] * ImmediateContributionID * UserID
  • Returns :
    • A refund object


43
44
45
# File 'lib/leetchi/immediate_contribution.rb', line 43

def self.refund(data)
  post_request(File.join('refunds'), data)
end