Not receiving fieldError elements in CRDonationAPI response

Options

Hi,



We've created a donation form in PageBuilder, with a shadow donation form. I am following Dave Hart's Donation API seminar (Powerpoint slides of 12/9/08). On another forum thread, I was able to find another org who implemented the example code. When using Firefox with Firebug, I can see the XML response with the corresponding pageError and fieldError fields. However, in my implementation, only a generic pageError is returned, which is not enough to notify the user which fields need attention. Can anyone shed any light? I've been told our organization doesn't use strict validation for donations (sorry, I'm not really sure what exactly that entails since I am not authorized to change primary configuration settings), so could this be the problem? The "reason" element comes back as UNSPECIFIED, instead of FIELD_VALIDATION. We could just use client-side JS validation, but that is not ideal.

While it does allow users to submit the form, there is not enough info in just the pageError element to inform the user which fields may be causing the error.

Here is the XML response I receive when submitting a blank donation form:

<?xml version="1.0" encoding="UTF-8"?>

<donationResponse xsi:schemaLocation="http://convio.com/crm/v1.0 http://service.convio.net/xmlschema/crm.public.v1.xsd" xmlns="http://convio.com/crm/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<errors>

<code>101</code>

<message>Error: There was a problem encountered while processing your donation.</message>

<reason>UNSPECIFIED</reason>

<pageError>Error: All donations require a valid billing address. Please enter a billing address before proceeding.</pageError>

</errors>

</donationResponse>

Here is the XML response received on the other org's site, also submitting a blank donation form:

<?xml version="1.0" encoding="UTF-8"?>

<donationResponse xsi:schemaLocation="http://convio.com/crm/v1.0 http://service.convio.net/xmlschema/crm.public.v1.xsd" xmlns="http://convio.com/crm/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<errors>

<code>101</code>

<message>Error: There was a problem encountered while processing your donation.</message>

<reason>FIELD_VALIDATION</reason>

<pageError>There was a problem processing your request. Please see below.</pageError>

<fieldError>An email address is required.</fieldError>

<fieldError>A state or province is required.</fieldError>

<fieldError>A last name is required.</fieldError>

<fieldError>A zip or postal code is required.</fieldError>

<fieldError>A street address is required.</fieldError>

<fieldError>A first name is required.</fieldError>

<fieldError>A city is required.</fieldError>

</errors>

</donationResponse>

Tagged:

Comments

  • Thanks, Jeff Kingsland. Turns out I had the "validate" param as a hidden form value, set to false. Now it's returning the reason code of FIELD_VALIDATION. My fieldErrors are still not coming out quite right but I'm sure I'll figure it out in the shadow form.

Categories