Class: Whmcs::Order

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

Overview

WHMCS::Order is the class for managing orders

Class Method Summary collapse

Methods inherited from Base

parse_response, send_request

Class Method Details

.accept_order(params = {}) ⇒ Object

Accept an order

Parameters:

  • :orderid - the Order ID

See:

wiki.whmcs.com/API:Accept_Order



105
106
107
108
# File 'lib/whmcs/order.rb', line 105

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

.add_order(params = {}) ⇒ Object

Create a new order

Parameters:

  • :clientid - client id for order

  • :pid - product id

  • :domain - domain name

  • :billingcycle - onetime, monthly, quarterly, semiannually, etc..

  • :addons - comma seperated list of addon ids

  • :customfields - a base64 encoded serialized array of custom field values

  • :configoptions - a base64 encoded serialized array of configurable product options

  • :domaintype - set for domain registration - register or transfer

  • :regperiod - 1,2,3,etc…

  • :dnsmanagement - true to enable

  • :emailforwarding - true to enable

  • :idprotection - true to enable

  • :eppcode - if transfer

  • :nameserver1 - first nameserver (req for domain reg only)

  • :nameserver2 - second nameserver

  • :nameserver3 - third nameserver

  • :nameserver4 - fourth nameserver

  • :paymentmethod - paypal, authorize, etc…

  • :promocode - pass coupon code to apply to the order (optional)

  • :affid - affiliate ID if you want to assign the order to an affiliate (optional)

  • :noinvoice - set true to not generate an invoice for this order

  • :noemail - set true to surpress the order confirmation email

  • :clientip - can be used to pass the customers IP (optional)

See:

wiki.whmcs.com/API:Add_Order



36
37
38
39
# File 'lib/whmcs/order.rb', line 36

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

.cancel_order(params = {}) ⇒ Object

Cancel an order

Parameters:

  • :orderid - the Order ID

See:

wiki.whmcs.com/API:Cancel_Order



133
134
135
136
# File 'lib/whmcs/order.rb', line 133

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

.delete_order(params = {}) ⇒ Object

Delete an order

Parameters:

  • :orderid - the Order ID

See:

wiki.whmcs.com/API:Delete_Order



161
162
163
164
# File 'lib/whmcs/order.rb', line 161

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

.fraud_order(params = {}) ⇒ Object

Mark an order as fraud

Parameters:

  • :orderid - the Order ID

See:

wiki.whmcs.com/API:Fraud_Order



147
148
149
150
# File 'lib/whmcs/order.rb', line 147

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

.get_order_statusesObject

Get order statuses

See:

wiki.whmcs.com/API:Get_Order_Statuses



91
92
93
94
# File 'lib/whmcs/order.rb', line 91

def self.get_order_statuses
  params.merge!(:action => 'getorderstatuses')
  send_request(params)
end

.get_orders(params = {}) ⇒ Object

Get orders

Parameters:

  • :limitstart - The record number to start at (default = 0)

  • :limitnum - The number of order records to return (default = 25)

See:

wiki.whmcs.com/API:Get_Orders



51
52
53
54
# File 'lib/whmcs/order.rb', line 51

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

.get_products(params = {}) ⇒ Object

Get products

Parameters:

  • :pid - can be used to just retrieve the details of a specific product ID

  • :gid - can be passed to just retrieve products in a specific group

  • :module - can be passed to just retrieve products assigned to a specific module

See:

wiki.whmcs.com/API:Get_Products



67
68
69
70
# File 'lib/whmcs/order.rb', line 67

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

.get_promotions(params = {}) ⇒ Object

Get promotions

Parameters:

  • :code - the specific promotion code to return information for (optional)

See:

wiki.whmcs.com/API:Get_Promotions



81
82
83
84
# File 'lib/whmcs/order.rb', line 81

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

.pending_order(params = {}) ⇒ Object

Place an order in pending

Parameters:

  • :orderid - the Order ID

See:

wiki.whmcs.com/API:Pending_Order



119
120
121
122
# File 'lib/whmcs/order.rb', line 119

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