This class is an instantion of the Command class, that executes a command pertaining to processing order information, in the default case from the database. This class should only be instantiated by dispatchMBAPI() found in include/mbapi/mbapi.php. Something similar to the following XML should be passed to dispatchMBAPI() when you want to call the ProcessOrder command:
<mbapi> <command><!-- None --></command> <subCommand><!-- string --></subCommand> <params> <orderFormID><!-- int --></orderFormID> <paymentType><!-- int --></paymentType> <secondary><!-- int --></secondary> <invoiceID><!-- int --></invoiceID> <fraudLevelAction><!-- int --></fraudLevelAction> <fraudLevelActionStatus><!-- int --></fraudLevelActionStatus> <enableInvoiceEmail><!-- int --></enableInvoiceEmail> <disableProvisioning><!-- int --></disableProvisioning> <disableInvoicing><!-- int --></disableInvoicing> <disableCharging><!-- int --></disableCharging> <disableBillingShares><!-- int --></disableBillingShares> <disableFraudguardian><!-- int --></disableFraudguardian> <disableClientUpdates><!-- int --></disableClientUpdates> <overrideDateDue><!-- int --></overrideDateDue> <overrideTransactionType><!-- string --></overrideTransactionType> <client> <clientID><!-- int --></clientID> <clientFirstName><!-- string --></clientFirstName> <clientLastName><!-- string --></clientLastName> <clientEmail><!-- string --></clientEmail> <clientCompany><!-- string --></clientCompany> <clientComments><!-- string --></clientComments> <contactUsername><!-- string --></contactUsername> <contactPassword><!-- string --></contactPassword> <languageID><!-- string --></languageID> <countriesID><!-- int --></countriesID> <themeID><!-- int --></themeID> <companyID><!-- int --></companyID> <clientSignupIP><!-- int --></clientSignupIP> <clientLastIP><!-- int --></clientLastIP> </client> <clientContact> <clientContactID><!-- int --></clientContactID> <contactAddress1><!-- string --></contactAddress1> <contactAddress2><!-- string --></contactAddress2> <contactCity><!-- string --></contactCity> <contactState><!-- string --></contactState> <contactZip><!-- string --></contactZip> <contactPhone1><!-- string --></contactPhone1> <contactPhone2><!-- string --></contactPhone2> <contactFax><!-- string --></contactFax> </clientContact> <clientBillingAccount> <billingAccountID><!-- int --></billingAccountID> <billingAccountType><!-- int --></billingAccountType> <billingCardNameOnCard><!-- string --></billingCardNameOnCard> <billingCardType><!-- int --></billingCardType> <billingCardNum><!-- string --></billingCardNum> <billingCardExpMonth><!-- string --></billingCardExpMonth> <billingCardExpYear><!-- string --></billingCardExpYear> <billingCardIssueNum><!-- string --></billingCardIssueNum> <billingCardStartDate><!-- string --></billingCardStartDate> <cardCVV2><!-- string --></cardCVV2> <billingBankName><!-- string --></billingBankName> <billingBankState><!-- string --></billingBankState> <billingBankAbaCode><!-- string --></billingBankAbaCode> <billingBankAccountNum><!-- string --></billingBankAccountNum> <billingBankLicenseNum><!-- string --></billingBankLicenseNum> <billingBankLicenseState><!-- string --></billingBankLicenseState> <billingBankDob><!-- string --></billingBankDob> </clientBillingAccount> <domainRegistrant> <registrantFirstName><!-- string --></registrantFirstName> <registrantLastName><!-- string --></registrantLastName> <registrantAddress1><!-- string --></registrantAddress1> <registrantAddress2><!-- string --></registrantAddress2> <registrantCity><!-- string --></registrantCity> <registrantStateProvince><!-- string --></registrantStateProvince> <registrantPostalCode><!-- string --></registrantPostalCode> <registrantOrganizationName><!-- string --></registrantOrganizationName> <registrantJobTitle><!-- string --></registrantJobTitle> <registrantEmail><!-- string --></registrantEmail> <registrantPhone><!-- string --></registrantPhone> <registrantFax><!-- string --></registrantFax> <registrantCountry><!-- string --></registrantCountry> </domainRegistrant> <attributes> <attribute> <attributeID><!-- int --></attributeID> <questionID><!-- int --></questionID> <answers> <answer><!-- string --></answer> </answers> </attribute> </attributes> <packageUsername><!-- string --></packageUsername> <packagePassword><!-- string --></packagePassword> <products> <ID><!-- int --></ID> <parentProductID><!-- int --></parentProductID> <productID><!-- int --></productID> <productVariantID><!-- int --></productVariantID> <packageDateNextRenewal><!-- int --></packageDateNextRenewal> <cycleID><!-- int --></cycleID> <couponID><!-- int --></couponID> <couponPrice><!-- double --></couponPrice> <couponNumCycles><!-- int --></couponNumCycles> <quantity><!-- int --></quantity> <taxZoneGroupID><!-- int --></taxZoneGroupID> <comments><!-- string --></comments> <price><!-- double --></price> <setup><!-- double --></setup> <addons> <addon> <productName><!-- string --></productName> <productID><!-- int --></productID> <productVariantID><!-- int --></productVariantID> <couponID><!-- int --></couponID> <couponPrice><!-- double --></couponPrice> <couponNumCycles><!-- int --></couponNumCycles> <quantity><!-- int --></quantity> <taxZoneGroupID><!-- int --></taxZoneGroupID> <price><!-- double --></price> <setup><!-- double --></setup> </addon> </addons> <domain> <domainType><!-- int --></domainType> <domainID><!-- int --></domainID> <domainSLD><!-- string --></domainSLD> <domainTLD><!-- string --></domainTLD> <domainIDNLanguage><!-- string --></domainIDNLanguage> <domainTransferKey><!-- string --></domainTransferKey> <extraInfo> <x><!-- string --></x> </extraInfo> </domain> <attributes> <attribute> <attributeID><!-- int --></attributeID> <questionID><!-- int --></questionID> <answers> <answer><!-- string --></answer> </answers> </attribute> </attributes> </products> <provisionRules> <disableProvisionIDs> <serverGroupID><!-- int --></serverGroupID> </disableProvisionIDs> <provisionDateRule> <domainID><!-- int --></domainID> <serverGroupID><!-- int --></serverGroupID> <provisionDate><!-- int --></provisionDate> </provisionDateRule> </provisionRules> </params> </mbapi>
None
mbapi
command
subCommand
REQUIRED This is either "process" or "preview" depending on what you want.
"preview" will do the following:
"process" will do the following:
params
orderFormID
REQUIRED The ID in ModernBill of the order form for which this order is being placed.
paymentType
REQUIRED This is the numeric ID if the type of payment we are going to take.
Acceptable values and their meanings are:
secondary
This is the "configGroupID" if the third party gateway to use in MB if needed.
invoiceID
This is the invoiceID if an existing invoice that you want to charge for. An example of why this is needed would be:
Customer comes through order process, uses a credit card, the card gets declined because they used the wrong one or whatever other reason, and they come through the payment part of the order again to pay with a different card or in a different manner.
When that happens you would run the ProcessCheckout command the first time, then save the invoiceID that it gives you, and just pass in that invoiceID when running it a second time so that your system does not get cluttered with unpaid invoices.
fraudLevelAction
REQUIRED This is an integer value that represents what actions ProcessCheckout should perform based on a persons fraud score and your ModernBill fraud threshold settings. Possible values and their meanings are:
fraudLevelActionStatus
This is a node that will be used to manage where we are in the process for things such as fraud call
enableInvoiceEmail
If set to 1 the system will allow the invoicing process to send out emails.
disableProvisioning
If set to 1 the system will not make provisioning system queue entries for any products.
disableInvoicing
If set to 1 the system will not create an invoice.
disableCharging
If set to 1 the system will not try to charge for the invoice if it gets generated.
disableBillingShares
If set to 1 the system will not create the shares between the billing account and the packages.
disableFraudguardian
If set to 1 the system will not run the fraudguardian module.
disableClientUpdates
If set to 1 the system will not update existing clients' information.
overrideDateDue
If a value is provided the due date for the invoice that is generated will be set to this timestamp.
overrideTransactionType
Set this to override the transaction type in the system for transactions. Can be either "auth" or "charge".
client
This is the group where we specify client level information, or the clientID we are working with.
clientID
CONDITIALLY REQUIRED IF the client is an existing client OR a new client but you have done a "preview" call and saved the clientID it returned, then put it here, otherwise do not use this node.
clientFirstName
The client's firstname. Required for updates of existing clients and new clients.
clientLastName
The client's lastname. Required for updates of existing clients and new clients.
clientEmail
The client's email address. Required for updates of existing clients and new clients.
clientCompany
The client's company name. Required for updates of existing clients and new clients.
clientComments
Comments on this client. Required for updates of existing clients and new clients.
contactUsername
The client's MB username. Required for updates of existing clients and new clients.
contactPassword
The client's MB password. Required for updates of existing clients and new clients.
languageID
The client's languageID. Required for updates of existing clients and new clients. Can be aquired through the languages table
countriesID
The client's countriesID. Required for updates of existing clients and new clients. Can be aquired through the countries table
themeID
The client's themeID. Required for updates of existing clients and new clients. This is likely "1" unless you have created your own themes. If so, it can be aquired from the themes table.
companyID
Always "1".
clientSignupIP
The integer version of the clients IP address at time of signup.
clientLastIP
The integer version of the clients IP address at their last pageload.
clientContact
This is the group where we specify client contact level information.
clientContactID
CONDITIALLY REQUIRED IF the client is an existing client OR a new client but you have done a "preview" call and saved the clientContactID it returned, then put it here, otherwise do not use this node.
contactAddress1
The contact's first address line. Required for updates of existing contacts and new contacts.
contactAddress2
The contact's second address line. Required for updates of existing contacts and new contacts.
contactCity
The contact's city. Required for updates of existing contacts and new contacts.
contactState
The contact's state. Required for updates of existing contacts and new contacts.
contactZip
The contact's zip. Required for updates of existing contacts and new contacts.
contactPhone1
The contact's first phone. Required for updates of existing contacts and new contacts.
contactPhone2
The contact's second phone. Required for updates of existing contacts and new contacts.
contactFax
The contact's fax. Required for updates of existing contacts and new contacts.
clientBillingAccount
This is the group where we specify billing account information.
billingAccountID
CONDITIALLY REQUIRED IF the billing account is an existing account OR a new account but you have done a "preview" call and saved the billingAccountID it returned, then put it here, otherwise do not use this node.
billingAccountType
This is an int value that represents what type of billing account this is. Valid values and their meanings are below.
billingCardNameOnCard
Name on the credit card IF this is a cc account.
billingCardType
Integer representing the type of credit card. Valid values and their meanings are below.
billingCardNum
The credit card number for this account.
billingCardExpMonth
The 2 digit expiration month of the afore mentioned credit card.
billingCardExpYear
The 4 digit expiration year of the afore mentioned credit card.
billingCardIssueNum
Issue number sometimes required by some cards in Europe.
billingCardStartDate
Start date sometimes required by some cards in Europe.
cardCVV2
The CVV2 code on the back of the card, sometimes referred to as other things such as CVD code, CV2, CVV, or just plain "verification number".
NOTE: This value is NOT stored anywhere in ModernBill.
billingBankName
Bank name used for echeck and bank draft accounts.
billingBankState
Bank state used for echeck and bank draft accounts.
billingBankAbaCode
Bank aba code used for echeck and bank draft accounts.
billingBankAccountNum
Bank account number used for echeck and bank draft accounts.
billingBankLicenseNum
Drivers license number used for echeck and bank draft accounts.
billingBankLicenseState
Drivers license state used for echeck and bank draft accounts.
billingBankDob
Date of Birth used for echeck and bank draft accounts.
domainRegistrant
This is the group where we specify registrant information for any domains that we may be registering.
registrantFirstName
First name for registrant record.
registrantLastName
Last name for registrant record.
registrantAddress1
First address line for registrant record.
registrantAddress2
Second name for registrant record.
registrantCity
City for registrant record.
registrantStateProvince
State or province for registrant record.
registrantPostalCode
Zip or postal code for registrant record.
registrantOrganizationName
Organization for registrant record.
registrantJobTitle
Job title for registrant record.
registrantEmail
Email address for registrant record.
registrantPhone
Phone number for registrant record.
registrantFax
Fax number for registrant record.
registrantCountry
Two digit country ISO code for registrant record.
attributes
This is the group that we put attribute records in that are for the client record.
attribute
This a group record that holds all information about an attribute that is going to tie to the current client. There can be multiple instances of this group.
attributeID
The ID of the attribute to use when creating the client_attributes record from the following answers.
questionID
The ID of the question in MB for which the following answers are provided. This can be aquired through the questions table.
answers
Group that holds X number of answer nodes.
answer
A string value that is one-of/the answer for the preceding question. There may be multiple instances of this node in this place.
packageUsername
Username to use for accounts that get provisioned for the packages that are created during this order.
packagePassword
Password to use for accounts that get provisioned for the packages that are created during this order.
products
This group holds all information needed for each specific product in this order. This may be repeated like:
<products> ( . . . ) </products> <products> ( . . . ) </products>
ID
This is a "unique to this order" ID that is used to express parent/child/domain relationships between products. Following is an example of how this may be used:
<products> <ID>1111</ID> (domain product information) </products> <products> <ID>2222</ID> (hosting product information) <domain> <domainType>2</domainType> (2 = existing domain, see domainType for more information) <domainID>1111</domainID> </domain> <addons> <addon> (dependant addon information, dependant = inherits cycle and number of times to bill from parent product) </addon> </addons> </products> <products> <ID>3333</ID> <parentProductID>2222</parentProductID> (independantly billed addon product information, independant = has own cycle and number of times to bill) </products>In the above example, we buy a domain (ID 1111) and a hosting product (ID 2222) with an addon, and an independant addon (ID 3333) for the hosting package. Having domainType 2 and domainID 1111 tells the system to associate the domain with 1111 as it's ID to the current product. Having parentProductID as 2222 tells the system to set the packageID of the item with ID 2222 as the parentPackageID of the current package which makes that package get treated as an addon to its parent.
parentProductID
See docs above.
productID
Product ID in MB. This can be aquired through the GetProducts command.
productVariantID
Product Variant ID in MB. This can be aquired through the GetProductVariants command.
packageDateNextRenewal
Timestamp of the next renewal date for the product being purchased, now if you want this package to be on the invoice that gets generated now.
cycleID
The cycle ID in MB of the cycle this product needs to renew on. This can be aquired through the GetCycles command.
couponID
The coupon ID in MB of the coupon that will apply to this product. This can be aquired through the GetCoupons command.
couponPrice
The price to charge for this product while the above coupon is in effect.
couponNumCycles
The number of cycles (first time inclusive) to use the coupon price instead of the regular price for billing.
quantity
The quantity of this product, currently not used in provisioning. Only use this when selling non-provisioning things that are exactly alike. ie - hosting packages are not the same because they have different domains associated with them.
taxZoneGroupID
The ID of the tax zone group to apply to this product. This can be aquired through the GetTaxZoneGroups command.
comments
If you specify something here it will be the product comments (most times longer description than just the name) that will be used for display purposes on the package details and invoices for this product INSTEAD of the main product's comments. If left blank the main product comments will be used instead.
price
The regular price to charge for this product.
setup
The setup price to charge for this product.
addons
The group that holds dependant addons for this product.
addon
The group that holds this specific dependant addon's information.
productName
The display name for this addon. Best thing to do for this is something of the form "Question: Value" where Question is something like "Disk Space" and Value is something like "5GB"
productID
The product ID in MB that this addon is for. This can be aquired through the GetProducts command.
productVariantID
The product variant ID in MB that this addon is for. This can be aquired through the GetProducts command.
couponID
The coupon ID in MB of the coupon that will apply to this product. This can be aquired through the GetCoupons command.
couponPrice
The price to charge for this product while the above coupon is in effect.
couponNumCycles
The number of cycles (first time inclusive) to use the coupon price instead of the regular price for billing.
quantity
The quantity of this product, currently not used in provisioning. Only use this when selling non-provisioning things that are exactly alike. ie - hosting packages are not the same because they have different domains associated with them.
taxZoneGroupID
The ID of the tax zone group to apply to this product. This can be aquired through the GetTaxZoneGroups command.
price
The regular price to charge for this addon.
setup
The setup price to charge for this addon.
domain
This group holds the information for a domain that is to be associated with this product. The 4 possible scenario's that may cause a domain to be associated are:
1. This product is a domain registration product.
2. This product is a domain transfer product.
3. This product is not a domain product and needs a domain that we have in this order associated with it.
4. This product is not a domain product and needs a domain that we have outside this order associate with it.
domainType
This is the type of this domain association. Below are the possible values and their meanings.
domainID
This is the ID used to associate domains to the current product. It's meaning and content is different for each scenario. Possible values for each scenario are below.
1. OR 2. Parent product is a domain registration or transfer product:
NOT REQUIRED 3. Parent product is NOT a domain registration product and we are associating a domain in this order
The <ID> of the domain registration product in this order to associate with.
4. Parent product is NOT a domain registration product and we are associating a domain NOT in this order
NOT required.
domainSLD
This is the SLD of the domain name. This is required for domain scenarios 1. 2. and 4.
example: the "domain-name" in "domain-name.co.uk"
domainTLD
This is the TLD of the domain name. This is required for domain scenarios 1. 2. and 4.
example: the "co.uk" in "domain-name.co.uk"
domainIDNLanguage
The 2 character ISO2 code for the language of this domain. This is only needed when registering IDN's.
domainTransferKey
This is the transfer key (or epp code) that gives you permission to transfer a domain from one registrar or account to another.
extraInfo
This group holds extra information that may or may not be required to register domains of certain TLD's such as .co.uk domains.
x
You just use a key = value form to create your extra information in here where key = x and value = y. You may specify as much information here as you like. It will be passed untouched to the registrar module when the domain registration or transfer call id performed.
attributes
This is the group that we put attribute records in that are for the package record.
attribute
This a group record that holds all information about an attribute that is going to tie to the current product's package. There can be multiple instances of this group.
attributeID
The ID of the attribute to use when creating the package_attributes record from the following answers.
questionID
The ID of the question in MB for which the following answers are provided. This can be aquired through the questions table.
answers
Group that holds X number of answer nodes.
answer
A string value that is one-of/the answer for the preceding question. There may be multiple instances of this node in this place.
provisionRules
This group holds specific provisioning rules.
disableProvisionIDs
This group holds the server group ID's of the server groups for which you do not want to create the provisioning system queue entries.
serverGroupID
Server group ID, this can be aquired through a GetServerGroups Command.
provisionDateRule
This group holds information that controls WHEN something gets set to provision.
domainID
The ID of the domain registration product (in the above example it would be "1111") for which this date rule applies.
serverGroupID
The ID of the server group for which this date rule applies.
provisionDate
The date in the form of a timestamp to use as the run date for the system queue entries meant to provision the items referred to above.