Class: Leetchi::Contribution

Inherits:
Ressource show all
Defined in:
lib/leetchi/contribution.rb

Overview

A contribution help you deposit money to a wallet.

Class Method Summary collapse

Class Method Details

.create(data) ⇒ Object

Create a contribution

  • Args :

    • data -> A JSON with the following attributes (Square brackets for optionals):

      * [Tag]
      * UserID
      * WalletID
      * Amount
      * [ClientFeeAmount]
      * ReturnURL
      * [TemplateURL]
      * [RegisterMeanOfPayment]
      * [PaymentCardID]
      
  • Returns :

    • A contribution object



21
22
23
# File 'lib/leetchi/contribution.rb', line 21

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

.details(contribution_id) ⇒ Object

Get a contribution

  • Args :

    • contribution_id -> The id of the contribution you want to retrieve

  • Returns :

    • A contribution object



32
33
34
# File 'lib/leetchi/contribution.rb', line 32

def self.details(contribution_id)
  get_request(File.join('contributions', contribution_id.to_s))
end

.get_refund(contribution_refund_id) ⇒ Object

Get a refund object

  • Args :

    • contribution_refund_id -> The id of the refund you want to retrieve

  • Returns :

    • A refund object



57
58
59
# File 'lib/leetchi/contribution.rb', line 57

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

.refund(data) ⇒ Object

Refund a given contribution

  • Args :

    • data -> A JSON with the following attributes (Square brackets for optionals):

      * [Tag]
      * ContributionID
      * UserID
      
  • Returns :

    • A refund object



46
47
48
# File 'lib/leetchi/contribution.rb', line 46

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