Class: WHMCS::Invoice

Inherits:
Base
  • Object
show all
Defined in:
lib/whmcs/invoice.rb

Overview

WHMCS::Invoice is the class for managing invoices

Class Method Summary collapse

Methods inherited from Base

parse_response, send_request

Class Method Details

.add_billable_item(params = {}) ⇒ Object



156
157
158
159
# File 'lib/whmcs/invoice.rb', line 156

def self.add_billable_item(params = {})
  params.merge!(:action => 'addbillableitem')
  send_request(params)
end

.add_credit(params = {}) ⇒ Object



172
173
174
175
# File 'lib/whmcs/invoice.rb', line 172

def self.add_credit(params = {})
  params.merge!(:action => 'addcredit')
  send_request(params)
end

.add_invoice_payment(params = {}) ⇒ Object



115
116
117
118
# File 'lib/whmcs/invoice.rb', line 115

def self.add_invoice_payment(params = {})
  params.merge!(:action => 'addinvoicepayment')
  send_request(params)
end

.add_transaction(params = {}) ⇒ Object



194
195
196
197
# File 'lib/whmcs/invoice.rb', line 194

def self.add_transaction(params = {})
  params.merge!(:action => 'addtransaction')
  send_request(params)
end

.apply_credit(params = {}) ⇒ Object

Apply Credit

Parameters:

  • :invoiceid - the ID to apply the credit to

  • :amount - the amount of credit to apply (must be less than or equal to clients available credit balance)

See:

docs.whmcs.com/API:Apply_Credit



245
246
247
248
# File 'lib/whmcs/invoice.rb', line 245

def self.apply_credit(params = {})
	params.merge!(:action => 'applycredit')
	send_request(params)
end

.capture_payment(params = {}) ⇒ Object



132
133
134
135
# File 'lib/whmcs/invoice.rb', line 132

def self.capture_payment(params = {})
  params.merge!(:action => 'capturepayment')
  send_request(params)
end

.create_invoice(params = {}) ⇒ Object



62
63
64
65
# File 'lib/whmcs/invoice.rb', line 62

def self.create_invoice(params = {})
  params.merge!(:action => 'createinvoice')
  send_request(params)
end

.get_invoice(params = {}) ⇒ Object



31
32
33
34
# File 'lib/whmcs/invoice.rb', line 31

def self.get_invoice(params = {})
  params.merge!(:action => 'getinvoice')
  send_request(params)
end

.get_invoices(params = {}) ⇒ Object



17
18
19
20
# File 'lib/whmcs/invoice.rb', line 17

def self.get_invoices(params = {})
  params.merge!(:action => 'getinvoices')
  send_request(params)
end

.get_payment_methods(params = {}) ⇒ Object



231
232
233
234
# File 'lib/whmcs/invoice.rb', line 231

def self.get_payment_methods(params = {})
    params.merge!(:action => 'getpaymentmethods')
	send_request(params)
end

.update_invoice(params = {}) ⇒ Object



93
94
95
96
# File 'lib/whmcs/invoice.rb', line 93

def self.update_invoice(params = {})
  params.merge!(:action => 'updateinvoice')
  send_request(params)
end

.update_transaction(params = {}) ⇒ Object

Update Transaction

Parameters:

  • :transactionid - The Transaction ID to update. tblaccounts.id

Optional attributes:

  • :userid - Add Transaction to a user

  • :currency - Currency ID for a transaction

  • :gateway - Gateway to assign transaction to

  • :date - date of transaction YYYYMMDD

  • :description - Description of the transaction

  • :amountin - amount to add to the account

  • :fees - transaction fee you were charged

  • :amountout - if an outgoing enter this

  • :rate - exchange rate based on master currency. Set to 1 if on default currency

  • :transid - Transaction ID you wish to assign

  • :invoiceid - Add transaction to a particular invoice

  • :refundid - Add a refund ID if this is a refund transaction

See:

docs.whmcs.com/API:Update_Transaction



221
222
223
224
# File 'lib/whmcs/invoice.rb', line 221

def self.update_transaction(params = {})
	params.merge!(:action => 'updatetransaction')
	send_request(params)
end