I am attempting to setup a donation form using the FaaS API. I have followed all the directions/examples and also read through topics in the support forum but I still haven't been able to fix a problem I am having. I am getting an error returned that the basket is empty after I attempt to submit a donation. I need someone to look over my code and figure out what I am doing wrong. The donation page is located at: https://www.idex.org/new/take-action/donate
Announcement
Collapse
No announcement yet.
Error: basket is empty
Collapse
X
-
Good day @danowens:
The issue you are having only happens if Quantity is set to 0 or UnitPrice is not passed to the API. This condition also happens if the names are not matching - meaning UnitPrice and Quantity are not named the same, e.g. UnitPrice1, Quantity1, UnitPrice2, Quantity2. All names need to be set as one family.
When dealing with API issues you may want to post to the Verify processor so you can see what you are posting. It can help you with identifying the issue:
Simply change the post URL to the above & you will see all the variables you are posting to the API processor.
Here is the result of reviewing your page:
Processed 2 transactions as follows:
Considering the MODE is set to Production using 4111 card number should be declined:
Line 511: <input type="hidden" name="OrderMode" id="OrderMode" value="Production" />
Transaction 1: $35
All static amounts worked correctly with a decline. The following is what you have for the static amounts:
<input type="radio" name="UnitPrice" id="radio5" value="1000" />
The above matches the other required fields you have: Lines 500 – 503
<input name="ItemID" type="hidden" id="ItemID" value="1" /><br />
<input name="ItemName" type="hidden" id="ItemName" value="Donation" /><br />
<input name="Quantity" type="hidden" id="Quantity" value="1" /><br />
<input name="UnitDeductible" type="hidden" id="UnitDeductible" value="100%" /><br />
When I tested the OTHER field I received the error:
Err= The basket is empty
Let us now look at your OTHER field code considering all other amounts are working fine and this is the only one with an issue:
Line 127: <input name="Other1" type="text" style="width: 80px" id="Other1" onclick="document.getElementById('other').click(); " />
As stated in the manual: http://manual.clickandpledge.com/For...ct_Information
Item names need to be tagged uniformly with the same number. I am sure you see the issue by now.
The OTHER field is called: name="Other1"
Whereas the quantity and other fields are called without a number:
<input name="ItemID" type="hidden" id="ItemID" value="1" /><br />
<input name="ItemName" type="hidden" id="ItemName" value="Donation" /><br />
<input name="Quantity" type="hidden" id="Quantity" value="1" /><br />
<input name="UnitDeductible" type="hidden" id="UnitDeductible" value="100%" /><br />
To fix the issue it is recommended that you change all your names to ItemID1, ItemName1, Quantity1, UnitDeductible1 and all radio button names to ItemName1.
All names need to be in a set family. Since you have only 1 set you need to number them all with 1. If you had multiple families the numbers need to be assigned accordingly – for example check the following example:
Sorry for the long email but I wanted to make sure you see the big picture and understand why you are having the issue.
Let us know if you need more help.Regards,
Click & Pledge Support Department
Join us @ the educational webinars: https://clickandpledge.com/webinars/
Live Support- read more: https://support.clickandpledge.com/s/article/general-information-live-support/
Comment