Class: Leetchi::Card

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

Overview

A payment card.

Class Method Summary collapse

Class Method Details

.create(data) ⇒ Object

Create a payment card

  • Args :

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

      * [Tag]
      * OwnerID
      * ReturnURL
      * [TemplateURL]
      
  • Returns :

    • A payment card object



16
17
18
# File 'lib/leetchi/card.rb', line 16

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

.delete(card_id) ⇒ Object

Delete a payment card

  • Args :

    • card_id -> The id of the card you want to delete

  • Returns :

    • A “OK” string on success



38
39
40
# File 'lib/leetchi/card.rb', line 38

def self.delete(card_id)
  delete_request(File.join('cards', card_id.to_s))
end

.details(card_id) ⇒ Object

Get a payment card

  • Args :

    • card_id -> The id of the card you want to retrieve

  • Returns :

    • A payment card object



27
28
29
# File 'lib/leetchi/card.rb', line 27

def self.details(card_id)
  get_request(File.join('cards', card_id.to_s))
end