order api; basket parameter names

General ShopSite user discussion

order api; basket parameter names

Postby lumpynose » Fri Sep 29, 2006 12:23 pm

In the order api it says that the basket or B values are of the format B0x where 0x is two digits. The software I'll be using to interface to ShopSite, Spring/Java, and that others will be using, PHP, expects the FORM field names to have square brackets around the numbers, for FORM fields that are lists; for example B-Name[01], B-Name[02], etc.

I'm not sure if they expect the number in brackets to be at the end, but that's where I've always seen them.

Is it possible to configure ShopSite to use B values in this format, with the numbers in brackets at the end?

Thanks
lumpynose
 
Posts: 4
Joined: Fri Sep 29, 2006 12:06 pm

Postby robm » Fri Sep 29, 2006 12:36 pm

The variables cannot be altered coming from ShopSite, but your order API script could certainly convert them into alternately named variables using brackets. This should be easy to do with a simple for loop in perl, php, etc... Then you can pass the variable array to your other programs.
robm
 
Posts: 463
Joined: Fri Aug 04, 2006 5:46 pm
Location: Connecticut

Postby lumpynose » Fri Sep 29, 2006 12:40 pm

I could do that but I would greatly prefer to not go that route. With Spring, if they're in the format with the square brackets it has helper classes that do validation, error checking, and binding. If I do what you say I have to bypass all that and I lose all of its advantages.

robm wrote:The variables cannot be altered coming from ShopSite, but your order API script could certainly convert them into alternately named variables using brackets. This should be easy to do with a simple for loop in perl, php, etc... Then you can pass the variable array to your other programs.
lumpynose
 
Posts: 4
Joined: Fri Sep 29, 2006 12:06 pm

Postby loren_d_c » Fri Sep 29, 2006 12:58 pm

Sorry, but there is no way to change the names of the variables output by the Order API.

-Loren
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere


Return to User Forum

Who is online

Users browsing this forum: Bing [Bot] and 102 guests

cron