Jump to content

api::addorder - Please explain/sort this out


Deffe

Recommended Posts

Hi ppl!

 

Im developing a custom made cart for our companys hosting sollution and I am just about to inject the data into the whmcs.

 

But I ran into some problems, or perhaps more confusion.

 

Why do you format your order/cart array like this?

 

$postfields["action"] = "addorder";

$postfields["clientid"] = "1";

$postfields["pid[0]"] = "1";

$postfields["domain[0]"] = "whmcs.com";

$postfields["billingcycle[0]"] = "monthly";

$postfields["pid[1]"] = "1";

$postfields["domain[1]"] = "whmcs2.com";

$postfields["billingcycle[1]"] = "monthly";

$postfields["pid[2]"] = "5";

$postfields["domain[2]"] = "whmcs3.com";

$postfields["billingcycle[2]"] = "annually";

$postfields["noemail"] = "true";

$postfields["paymentmethod"] = "authorize";

 

My cart/array/oject is built in a normal fashion structure. I cant find a reason for formating the items like this.

 

I could easily format my order into this but I just cant understand Why you choose to do it like this? Please explain since I am sure there is a very good and logical reason for it. :roll:

 

My current array looks like this.

Array

(

[domains] => Array

(

[0] => Array

(

[type] => register

[productID] => 0

[domain] => xxx.se

[serviceID] =>

[extraInformation] =>

[regperiod] => 1

[eppcode] =>

[tld] => se

[price] => 49

)

 

)

 

[products] => Array

(

[0] => Array

(

[pid] => 3

[domain] => xxx.se

[name] => Basic

[price] => 75

)

 

)

 

[action] => addorder

[paymentmethod] => faktura

[clientid] => 6

)

 

but yours is ... well just strange. why ?=) 8)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated