No announcement yet.


  • Filter
  • Time
  • Show
Clear All
new posts

  • Director

    Trying to get approval for credit card transaction and getting this error message.

    [OperationResult] => Array
    [ResultCode] => 2051
    [ResultData] => Xml Error
    [TransactionNumber] =>
    See XML Document BELOW OR HERE

    <CnPAPI xmlns="urn:APISchema.xsd">
    <BillingEmail>[email protected]</BillingEmail>
    <BillingAddress1>Post Office Box 1000</BillingAddress1>
    <ShippingAddress1>123 Shipping Avenue</ShippingAddress1>
    <ShippingAddress2>Suite 1234</ShippingAddress2>
    <ShippingCity>John City</ShippingCity>
    <ShippingStateProvince>Big State</ShippingStateProvince>
    <FieldValue>Good Company</FieldValue>
    <FieldValue>Good Job</FieldValue>
    <FieldName>Place of Employment</FieldName>
    <FieldValue>Blacksburg, Virginia</FieldValue>
    <NameOnCard>John Smith</NameOnCard>
    <ItemName>Conference Dinner</ItemName>

  • #2

    The problem that you were seeing is 2 fold. Please see the attached document.

    1) Inside of the CurrentTotals area you were missing TotalDiscount, TotalTax, & TotalDeductible. This was the cause of the XML error.

    2) After correcting this I came across the second error in that the Total attempting to processing is 4500. The correct amount to process is 1800. Here is the breakdown:

    2000 (unit price)
    +400 (unit tax)
    -600 (unit discount)
    =1800 (Total)

    Please save any XML scheme to a Notepad document before posting to the forum.
    Attached Files


    • #3
      nusoap and xml Error

      I have fixed the xml. but still the result is the same. When I post the samex xml content to your i get as success response. I am using nusoap(php) and the code is

      $params = array('instruction'=>$strParam);
      $client = new SoapClient('', true);
      $client->soap_defencoding = 'UTF-8';
      $result = $client->call('Operation', $params);
      echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';

      a test page is available at
      Click & Pledge API- PHP Example


      • #4
        XML Post


        The problem is with your code. The challenge we have is we don't have PHP programmers in our team. We know a number of people have used PHP and are using it quite successfully.

        One issue we have seen before is extra space at the beginning of the page. Typically the header has a bad opening. I recall one case where the openning bracket < was missing and one that had a $ sign at the beggining.

        Can you double check what you are posting .. any way you can post it to a page and see exactly what it is you are posting?

        Have you used our sample code to post your XML and see if that works?

        Click & Pledge Support Department.
        Click & Pledge Support Department

        Join us @ the educational webinars:
        Live Support- read more: