Class: Leetchi::Transfer

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

Overview

The Transfer class if you want to make any transfer between two wallets

Class Method Summary collapse

Class Method Details

.create(data) ⇒ Object

Create a transfer from one personal wallet to another wallet

  • Args :

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

      * [Tag]
      * [PayerID]
      * [BeneficiaryID]
      * Amount
      * [ClientFeeAmount] (In preproduction environnment only, soon in production)
      * [PayerWalletID]
      * [BeneficiaryWalletID]
      
  • Returns :

    • A transfer object



19
20
21
# File 'lib/leetchi/transfer.rb', line 19

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

.details(transfer_id) ⇒ Object

Get a transfer

  • Args :

    • tranfer_id -> The id of the transfer you want to retrieve

  • Returns :

    • A transfer object



30
31
32
# File 'lib/leetchi/transfer.rb', line 30

def self.details(transfer_id)
  get_request(File.join('transfers', transfer_id.to_s))
end

.get_refund(transfer_refund_id) ⇒ Object

Get a refund transfer object

  • Args :

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

  • Returns :

    • A transfer refund object



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

def self.get_refund(transfer_refund_id)
  get_request(File.join('transfer-refunds', transfer_refund_id.to_s))
end

.refund(data) ⇒ Object

Refund a contribution from a personal wallet to a shared walletTransferID

  • Args :

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

      * TransfertID
      * UserID
      
  • Returns :

    • A transfer refund object



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

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