Announcement

Collapse
No announcement yet.

"Basket is empty" error, but all fields are correct

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • "Basket is empty" error, but all fields are correct

    We have a form connected to FaaS. You can see it here: https://financialwomensf.org/raffle-internal-sales. (You may need to log in - use username: FWSF2015 and PW: member2015$. When we post a test transaction, even though all the fields are populated and named correctly, we get a "Basket is empty" error.

    Here's the HTML of the key fields:

    <tr>
    <td align="right" width="180">Number of Raffle Tickets</td>
    <td><input id="Quantity1" type="text" name="Quantity1" size="5" data-parsley-type="integer" />
    <input id="ItemID1" type="hidden" name="ItemID1" value="1" />
    <input id="ItemName1" type="hidden" name="ItemName1" value="Raffle Ticket" />
    <input id="UnitPrice1" type="hidden" name="UnitPrice1" value="100" />
    <input name="SKU1" type="hidden" id="SKU1" value="ABC-1234" />
    <input name="Campaign1" type="hidden" id="Campaign1" value="Raffle Tickets" />
    <input id="UnitDeductible1" type="hidden" name="UnitDeductible1" value="0" /> (<em>each ticket is $100</em>)</td>
    </tr>
    <tr>
    <td align="right" width="180">Additional Donation:</td>
    <td><input id="Quantity2" type="hidden" name="Quantity2" value="1" size="5" />
    <input id="ItemID2" type="hidden" name="ItemID2" value="2" />
    <input id="ItemName2" type="hidden" name="ItemName2" value="Additional Donation" />
    <input id="UnitPrice2" type="text" name="UnitPrice2" size="5" data-parsley-type="integer" />
    <input name="SKU2" type="hidden" id="SKU2" value="ABC-1234" />
    <input name="Campaign2" type="hidden" id="Campaign2" value="Other Donation" />
    <input id="UnitDeductible2" type="hidden" name="UnitDeductible2" value="0" /> (<em>whole-dollar amount</em>)</td>
    </tr>

    The attributes with "parsley" in them are for the form-validation library.

    If we send the form to the C&P "Verify" URL, we see a "Site insecure" message, saying the form is invalid and will not post. But, the site is secure and the URL uses the "https" protocol. And the site's security seal is also on the page.

    And, here's what the URL looks like with all the field data:

    "https://verify.faas.cloud.clickandpledge.com/?Quantity1=11&ItemID1=1&ItemName1=Raffle+Ticket&Un itPrice1=100&SKU1=ABC-1234&Campaign1=Raffle+Tickets&UnitDeductible1=0&Qu antity2=1&ItemID2=2&ItemName2=Additional+Donation& UnitPrice2=1990&SKU2=ABC-1234&Campaign2=Other+Donation&UnitDeductible2=0"

    So, what might the problem be here?

    Thanks!
    Last edited by Lew; 08-08-2015, 11:49 PM.

  • #2
    Good day @Lew,

    When I go the linked page I get a blank page and don't see any forms. I even logged in with the information provided and still could not see the form.

    I need to see the form to determine why the item posted is not being read. As for site secure message it is not something to worry about with the verify. The verify tries to read certain attributes and reports what it reads.

    When the error message states basket is empty it means either the item name is missing or the quantity is 0.

    May I suggest that you remove all validations during the testing phase to make sure you are posting the right information. Once that has been established you can add the validation.

    Once we see the form we can figure out the issue.
    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


    • #3
      Hi,

      Thank you for your reply!

      Sorry about the login not working - I gave you incorrect credentials. Try "Board" for username and "$network$" for password, and then go to that link, and you will see the form now.

      I tried this without the validations, as you suggested, but same results - "Basket is empty". I've left the validations turned off so you can experiment. But you can look at the posted URL and see that the ItemName is very much there, as is a non-zero quantity. Here it is again (and this is what's posted when the form is submitted, in one of my tests):

      "https://verify.faas.cloud.clickandpledge.com/?Quantity1=11&ItemID1=1&ItemName1=Raffle+Ticket&Un itPrice1=100&SKU1=ABC-1234&Campaign1=Raffle+Tickets&UnitDeductible1=0&Qu antity2=1&ItemID2=2&ItemName2=Additional+Donation& UnitPrice2=1990&SKU2=ABC-1234&Campaign2=Other+Donation&UnitDeductible2=0".

      So the field names and values do appear to be present and correct.

      Anyway, I hope it's something simple and you'll be able to show me any error quickly. Thanks for your help with this - appreciated!

      Lew

      Comment


      • #4
        Good day!

        Is it OK if we post dummy data for testing to this form? https://financialwomensf.org/raffle-internal-sales
        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


        • #5
          Hi again,

          One question related to this: We have two input fields dealing with the products here - a count of tickets and and additional donation. Now, the point of the form is to sell the tickets, so this will ALWAYS be a non-zero value. BUT, the "Additional Donation" is an optional field, and may have a "Quantity" of zero.

          Will this affect the processing? If so, how do we set up the form so that this optional field is processed correctly by C&P, with a zero value for the donation amount (i.e., the "Quantity2" field will be zero)?

          (In my above testing, this field was always NON-ZERO, and I still get the "Basket is empty" error; I was careful to ensure this had something in it, so it doesn't explain the current error; but we do need to be able to process a zero value here, so please let me know how to set this up for that.)

          Thanks!

          Comment


          • #6
            Hi - our replies crossed.

            Yes, absolutely. Just use a credit card number of "4" followed by 15 "1"s - so, 4111 1111 1111 1111 (without spaces). Any CVV value, as well as any expiration date, works with this CC number.

            Comment


            • #7
              Good day!

              We need to remove the URL restriction you have placed on the account since we cannot test the form on our local servers.

              Just letting you know. Once we are done you may add it again.
              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


              • #8
                Good day!

                Why do you have:

                HTML Code:
                <form id="raffle-form" action="https://faas.cloud.clickandpledge.com" method="get">
                method=get is invalid.

                method should be set to post since you are posting it to us.

                During office hours we discussed this as an alternative but it was not meant for it to be in the form method.

                If you wish to have the postback to be in the form of POST then use the following node:



                The form will work if you change the form method to POST as shown below

                HTML Code:
                <form id="raffle-form" action="https://faas.cloud.clickandpledge.com" method="post">
                Please try it and let us know if it works.
                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


                • #9
                  Oh! Before I forget.

                  Once done testing please make sure to enable the post restrictions as were set before (Portal > Account Info > Profile > API). We do not recommend that you enable that feature during testing. While developing you want least amount restrictions during the debugging. Once a program works one may add more restrictions and test. This will not introduce complications during testing.

                  Hope it helps.
                  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


                  • #10
                    Hi,

                    I just saw an email come through with the receipt for a transaction. So obviously whatever you did worked. So, reading your reply, it suggests that I need to change the method. But I specifically asked Kamran about this the other day on one of the daily support call-ins you host, and he said to use "GET" unless we wanted the entire form posted back, which we don't.

                    If GET is incorrect, then you should change your documentation, as it is currently unclear. In your docs, you state that "GET" is the default, and now you're saying that it's incorrect. Please update - or add more information to the docs - to indicate the correct value and make that the default as your doc is the initial source of any information on using FaaS. Plus, as I say, Kamran specifically told me to use "GET". And that's why I'm using it.

                    I know the difference between GET and POST, and in my first version of this form, I did have "POST", until I was told to change it. Also, what is the difference between your "Postback" field - which doesn't suggest that it's an attribute of the <form> tag itself, and the <form method=''>? To me they're two different things - even if they affect the results the same way. One (Postback) seems to be part of the form's payload, whereas "method" is a property or attribute of the <form> tag. Again, I suggest you update your docs to clearly reflect this distinction.

                    Plus, if this is the problem - GET vs. POST - then why am I getting a "Basket is empty" error? Surely there's no correspondence between these two, so your error message is likewise misleading. Perhaps there's some way you can trap the method and return some other error indicating that the form method isn't appropriate.

                    Anyway, I am glad that the solution is a very easy one. I will change the form right now and test it again, and will let you know the results.

                    Thanks for working on this on a Sunday - much appreciate your timely and helpful response to this. Overall, between your forum and office hours, your support is really quite outstanding - and, for products as deep and wide as all your C&P offerings, it's certainly needed and very valuable. So thanks again for the help!

                    Comment


                    • #11
                      Good day!

                      We can gladly change the documentation if it is causing confusion. May I ask where we are suggesting that this should be GET? All examples omit this method as the default is POST.

                      The option that was discussed in the office hours is the "Postback" method. Please see: http://manual.clickandpledge.com/For....html#Postback

                      Please send us the link to the documentation that needs to be changed and we will go ahead and review it.
                      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


                      • #12
                        Hi,

                        OK, I did change the method to post and it works fine, as you suggested it would. That's great. Thanks again for the clarification.

                        Now, a couple of quick questions:

                        In the receipt email, there's a heading "Comments & Other Info", and it has one of the form's fields and value listed (Salesperson name = xxx) in our case. Now, why is this particular field chosen to be listed here? And, what do I need to do to have another field appear here? Specifically, in our case, I'd like the "Ticket Number" field/value appear; it's in the same section of the form ("Additional Information").

                        Next, I asked earlier about what happens if the "Additional Donation" field is posted with a zero value. This will most often be the case with most people completing this form. Will that result in an "Empty basket" error? And, if so, what should I do in the form to allow a zero value here?

                        In terms of the docs, there's nothing in the documentation about what method to set in the <form> tag. You do have a section on Postback - in the URL you sent me. There, it states that "GET" is the default. But again, the problem here is that this describes one part of the form's payload. It talks about the "field" (FaaS Field name) as being "GET" or "POST". But the solution you provided me doesn't involved a field called "Postback" - which we don't even have in our form; the solution is about a <form> tag attribute. And this is where you need to make the distinction clearer, by explaining what should be in the <form< tag's "method" attribute and what should be in the form field called "Postback".

                        Thanks again!

                        Comment


                        • #13
                          One other thing to please change in your documentation:

                          Under the "Service Response" section, you give an example of what the URL looks like on a successful authorization. But there's no example for the other return types. I was able to figure out what the URL is for an error condition because I did get an error. But I need to see the URL for a "Declined" condition. I have PHP code that parses the URL, but I don't know what to look for in the query part of the URL that you return. So if you could please show me an example URL with the "Declined" response, and then also update your documentation to show all three returned-URLs, that would be great.

                          Thanks!

                          Comment


                          • #14
                            Good day!

                            Answers to your questions:

                            You asked: "In the receipt email, there's a heading "Comments & Other Info", and it has one of the form's fields and value listed (Salesperson name = xxx) in our case. Now, why is this particular field chosen to be listed here? And, what do I need to do to have another field appear here? Specifically, in our case, I'd like the "Ticket Number" field/value appear; it's in the same section of the form ("Additional Information")."

                            Reply: The Salesperson is the custom question / answer that you have posted. All Q&A's are posted in the receipt. If you wish to have the ticket number on the receipt you need to send it to the API as custom question and answer. I believe in this case you want to have both of these fields as hidden since the ticket number is not a user input. for example:

                            HTML Code:
                            <input name="FieldName1" type="hidden" value="Ticket Number"/>
                            <input name="FieldValue1" type="hidden" value="123ABC" />
                            Of course the ticket number needs to be posted after the user clicks submit so some sort of JS needs to be calculating and sending it. I am sure you get the idea.

                            You asked: "Next, I asked earlier about what happens if the "Additional Donation" field is posted with a zero value. This will most often be the case with most people completing this form. Will that result in an "Empty basket" error? And, if so, what should I do in the form to allow a zero value here?"

                            Reply: When the quantity is 0 the value will not post. You may test your form here: http://secureform.cloud.clickandpledge.net/forum/25686/ [your form was copied to our servers for testing and account information was changed.]

                            Here is a few observation that you will also notice in the example we used for testing.

                            When the field attribute is set to disable the value is not posting to the API. If you use readonly it will work- see: http://www.w3schools.com/tags/att_input_readonly.asp

                            once used readonly attribute the raffle number posted. se
                            Click image for larger version

Name:	2015-08-09_14-06-44.jpg
Views:	41
Size:	15.3 KB
ID:	18334


                            Hope this helps.
                            Last edited by CnP.Support; 08-09-2015, 01:15 PM.
                            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


                            • #15
                              OK, thank you - I was able to change the form so that the ticket number does appear. One problem solved!

                              Next, you say that if the Quantity is zero, the value won't post. But what if it's not zero (say, 1) and the UnitPrice is zero? That seems to work in our case: I've set the "Additional Donation" value to Quantity = 1 and the UnitPrice to zero, and that does successfully post; it also posts if the UnitPrice field is empty. And that's perfectly fine behavior.

                              So could you please confirm that if Quantity is non-zero and UnitPrice is zero or empty, that the form will post successfully?

                              Thanks!

                              Comment

                              Working...
                              X