Class: Billplz::Bill

Inherits:
Model
  • Object
show all
Defined in:
lib/billplz/bill.rb

Instance Attribute Summary

Attributes inherited from Model

#endpoint, #payload, #response

Instance Method Summary collapse

Methods inherited from Model

#api_url, #initialize, #parsed_json, #request, #success?

Constructor Details

This class inherits a constructor from Billplz::Model

Instance Method Details

#createObject



5
6
7
8
# File 'lib/billplz/bill.rb', line 5

def create
  requires!(@payload, :collection_id, :email, :name, :amount, :callback_url)
  request(:post, @payload)
end

#deleteObject



16
17
18
19
20
# File 'lib/billplz/bill.rb', line 16

def delete
  requires!(@payload, :bill_id)
  @api_url = "#{@api_url}/#{@payload[:bill_id]}"
  request(:delete, nil)
end

#getObject



10
11
12
13
14
# File 'lib/billplz/bill.rb', line 10

def get
  requires!(@payload, :bill_id)
  @api_url = "#{@api_url}/#{@payload[:bill_id]}"
  request(:get, nil)
end