Class: Whmcs::Order
Overview
WHMCS::Order is the class for managing orders
Class Method Summary collapse
-
.accept_order(params = {}) ⇒ Object
Accept an order.
-
.add_order(params = {}) ⇒ Object
Create a new order.
-
.cancel_order(params = {}) ⇒ Object
Cancel an order.
-
.delete_order(params = {}) ⇒ Object
Delete an order.
-
.fraud_order(params = {}) ⇒ Object
Mark an order as fraud.
-
.get_order_statuses ⇒ Object
Get order statuses.
-
.get_orders(params = {}) ⇒ Object
Get orders.
-
.get_products(params = {}) ⇒ Object
Get products.
-
.get_promotions(params = {}) ⇒ Object
Get promotions.
-
.pending_order(params = {}) ⇒ Object
Place an order in pending.
Methods inherited from Base
Class Method Details
.accept_order(params = {}) ⇒ Object
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:
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
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
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
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_statuses ⇒ Object
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:
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:
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:
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
119 120 121 122 |
# File 'lib/whmcs/order.rb', line 119 def self.pending_order(params = {}) params.merge!(:action => 'pendingorder') send_request(params) end |