Announcement

Collapse
No announcement yet.

Error 2052

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

  • Error 2052

    Can someone please look over the XML we're posting for payment and tell me what's wrong with it?

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <CnPAPI xmlns="urn:APISchema.xsd">
        <Version>12</Version>
        <Engine>
            <Request>
                <Operation>
                    <OperationType>Transaction</OperationType>
                    <IPAddress>IP_ADDRESS</IPAddress>
                </Operation>
                <Authentication>
                    <AccountGuid>ACCOUNT_GUID</AccountGuid>
                    <AccountID>ACCOUNT_ID</AccountID>
                </Authentication>
                <Order>
                    <OrderMode>Test</OrderMode>
                    <CardHolder>
                        <BillingInformation>
                            <BillingFirstName>damon</BillingFirstName>
                            <BillingLastName>edwards</BillingLastName>
                            <BillingEmail>[email protected]</BillingEmail>
                            <BillingPhone>7603176315</BillingPhone>
                        </BillingInformation>
                        <BillingAddress>
                            <BillingAddress1>41750 RANCHO LAS PALMAS DR, STE D1</BillingAddress1>
                            <BillingCity>RANCHO MIRAGE</BillingCity>
                            <BillingStateProvince>CA</BillingStateProvince>
                            <BillingPostalCode>92270</BillingPostalCode>
                            <BillingCountryCode>840</BillingCountryCode>
                        </BillingAddress>
                        <ShippingInformation>
                            <ShippingAddress>
                                <ShippingAddress1>41750 RANCHO LAS PALMAS DR, STE D1</ShippingAddress1>
                                <ShippingCity>RANCHO MIRAGE</ShippingCity>
                                <ShippingStateProvince>CA</ShippingStateProvince>
                                <ShippingPostalCode>92270</ShippingPostalCode>
                                <ShippingCountryCode>840</ShippingCountryCode>
                            </ShippingAddress>
                        </ShippingInformation>
                        <PaymentMethod>
                            <PaymentType>CreditCard</PaymentType>
                            <CreditCard>
                                <NameOnCard>damon edwards</NameOnCard>
                                <CardNumber>4111111111111111</CardNumber>
                                <Cvv2>123</Cvv2>
                                <ExpirationDate>04/18</ExpirationDate>
                            </CreditCard>
                        </PaymentMethod>
                    </CardHolder>
                    <OrderItemList>
                        <OrderItem>
                            <ItemID>GTRGMY</ItemID>
                            <ItemName>Grammy Guitar</ItemName>
                            <Quantity>1</Quantity>
                            <UnitPrice>15000</UnitPrice>
                            <UnitDeductible>0</UnitDeductible>
                        </OrderItem>
                        <OrderItem>
                            <ItemID>SHTDSSYELULG</ItemID>
                            <ItemName>Do The Sweet Stuff</ItemName>
                            <Quantity>1</Quantity>
                            <UnitPrice>1500</UnitPrice>
                            <UnitDeductible>0</UnitDeductible>
                        </OrderItem>
                        <OrderItem>
                            <ItemID>SHTIGVBLKMLG</ItemID>
                            <ItemName>Thumbs Up T-Shirt</ItemName>
                            <Quantity>2</Quantity>
                            <UnitPrice>1500</UnitPrice>
                            <UnitDeductible>0</UnitDeductible>
                        </OrderItem>
                    </OrderItemList>
                    <Transaction>
                        <TransactionType>Authorize</TransactionType>
                        <CurrentTotals>
                            <TotalDeductible>0</TotalDeductible>
                            <TotalTax>1560</TotalTax>
                            <Total>22442</Total>
                        </CurrentTotals>
                    </Transaction>
                </Order>
            </Request>
        </Engine>
    </CnPAPI>

  • #2
    Good day!

    ItemID is a number and you have used a text. See the schema.

    You can test this in the verify site: https://verify.paas.cloud.clickandpledge.com

    copy and paste the XML there and use the ECHO option. You will see the issue.

    Hope that answers your question.
    Regards,
    Click & Pledge Support Department

    On Salesforce? Help us by rating our app: Click & Pledge Donor Management on AppExchange

    Join us @ the educational webinars: https://clickandpledge.com/webinars/
    Live Support available Join between 3:00 - 3:30 p.m. ET Monday - Thursday: https://clickandpledge.com/webinars/
    Are you on Salesforce? Join us at the Power of Us Hub: https://powerofus.force.com/0F980000000CjpC

    Comment


    • #3
      Sweet, thanks! I was able to get that working but now I'm getting "Transaction total amount error". If I add the amounts up by hand in the below XML it comes out to match the <Total> element. One of the items has a Quantity of 2, do I actually need to split that into its own <OrderItem> for it to add up correctly??

      Code:
      <?xml version="1.0" encoding="UTF-8"?>
      <CnPAPI xmlns="urn:APISchema.xsd">
          <Version>12</Version>
          <Engine>
              <Request>
                  <Operation>
                      <OperationType>Transaction</OperationType>
                      <IPAddress>IP_ADDRESS</IPAddress>
                  </Operation>
                  <Authentication>
                      <AccountGuid>ACCOUNT_GUID</AccountGuid>
                      <AccountID>ACCOUNT_ID</AccountID>
                  </Authentication>
                  <Order>
                      <OrderMode>Test</OrderMode>
                      <CardHolder>
                          <BillingInformation>
                              <BillingFirstName>damon</BillingFirstName>
                              <BillingLastName>edwards</BillingLastName>
                              <BillingEmail>[email protected]</BillingEmail>
                              <BillingPhone>7603176315</BillingPhone>
                          </BillingInformation>
                          <BillingAddress>
                              <BillingAddress1>41750 RANCHO LAS PALMAS DR, STE D1</BillingAddress1>
                              <BillingCity>RANCHO MIRAGE</BillingCity>
                              <BillingStateProvince>CA</BillingStateProvince>
                              <BillingPostalCode>92270</BillingPostalCode>
                              <BillingCountryCode>840</BillingCountryCode>
                          </BillingAddress>
                          <ShippingInformation>
                              <ShippingAddress>
                                  <ShippingAddress1>41750 RANCHO LAS PALMAS DR, STE D1</ShippingAddress1>
                                  <ShippingCity>RANCHO MIRAGE</ShippingCity>
                                  <ShippingStateProvince>CA</ShippingStateProvince>
                                  <ShippingPostalCode>92270</ShippingPostalCode>
                                  <ShippingCountryCode>840</ShippingCountryCode>
                              </ShippingAddress>
                          </ShippingInformation>
                          <PaymentMethod>
                              <PaymentType>CreditCard</PaymentType>
                              <CreditCard>
                                  <NameOnCard>damon edwards</NameOnCard>
                                  <CardNumber>4111111111111111</CardNumber>
                                  <Cvv2>123</Cvv2>
                                  <ExpirationDate>02/19</ExpirationDate>
                              </CreditCard>
                          </PaymentMethod>
                      </CardHolder>
                      <OrderItemList>
                          <OrderItem>
                              <ItemName>Grammy Guitar</ItemName>
                              <Quantity>1</Quantity>
                              <UnitPrice>15000</UnitPrice>
                              <UnitDeductible>0</UnitDeductible>
                              <SKU>GTRGMY</SKU>
                          </OrderItem>
                          <OrderItem>
                              <ItemName>Do The Sweet Stuff</ItemName>
                              <Quantity>1</Quantity>
                              <UnitPrice>1500</UnitPrice>
                              <UnitDeductible>0</UnitDeductible>
                              <SKU>SHTDSSYELULG</SKU>
                          </OrderItem>
                          <OrderItem>
                              <ItemName>Thumbs Up T-Shirt</ItemName>
                              <Quantity>2</Quantity>
                              <UnitPrice>1500</UnitPrice>
                              <UnitDeductible>0</UnitDeductible>
                              <SKU>SHTIGVBLKMLG</SKU>
                          </OrderItem>
                      </OrderItemList>
                      <Shipping>
                          <ShippingMethod>UPS - UPS Ground</ShippingMethod>
                          <ShippingValue>1382</ShippingValue>
                          <ShippingTax>0</ShippingTax>
                      </Shipping>
                      <Transaction>
                          <TransactionType>Authorize</TransactionType>
                          <CurrentTotals>
                              <TotalTax>1560</TotalTax>
                              <TotalDeductible>0</TotalDeductible>
                              <Total>22442</Total>
                          </CurrentTotals>
                      </Transaction>
                  </Order>
              </Request>
          </Engine>
      </CnPAPI>

      Comment


      • #4
        I get the same error if I add the <TotalShipping> element as well

        Code:
        <?xml version="1.0" encoding="UTF-8"?>
        <CnPAPI xmlns="urn:APISchema.xsd">
            <Version>12</Version>
            <Engine>
                <Request>
                    <Operation>
                        <OperationType>Transaction</OperationType>
                        <IPAddress>IP_ADDRESS</IPAddress>
                    </Operation>
                    <Authentication>
                        <AccountGuid>ACCOUNT_GUID</AccountGuid>
                        <AccountID>ACCOUNT_ID</AccountID>
                    </Authentication>
                    <Order>
                        <OrderMode>Test</OrderMode>
                        <CardHolder>
                            <BillingInformation>
                                <BillingFirstName>damon</BillingFirstName>
                                <BillingLastName>edwards</BillingLastName>
                                <BillingEmail>[email protected]</BillingEmail>
                                <BillingPhone>7603176315</BillingPhone>
                            </BillingInformation>
                            <BillingAddress>
                                <BillingAddress1>41750 RANCHO LAS PALMAS DR, STE D1</BillingAddress1>
                                <BillingCity>RANCHO MIRAGE</BillingCity>
                                <BillingStateProvince>CA</BillingStateProvince>
                                <BillingPostalCode>92270</BillingPostalCode>
                                <BillingCountryCode>840</BillingCountryCode>
                            </BillingAddress>
                            <ShippingInformation>
                                <ShippingAddress>
                                    <ShippingAddress1>41750 RANCHO LAS PALMAS DR, STE D1</ShippingAddress1>
                                    <ShippingCity>RANCHO MIRAGE</ShippingCity>
                                    <ShippingStateProvince>CA</ShippingStateProvince>
                                    <ShippingPostalCode>92270</ShippingPostalCode>
                                    <ShippingCountryCode>840</ShippingCountryCode>
                                </ShippingAddress>
                            </ShippingInformation>
                            <PaymentMethod>
                                <PaymentType>CreditCard</PaymentType>
                                <CreditCard>
                                    <NameOnCard>damon edwards</NameOnCard>
                                    <CardNumber>4111111111111111</CardNumber>
                                    <Cvv2>123</Cvv2>
                                    <ExpirationDate>03/20</ExpirationDate>
                                </CreditCard>
                            </PaymentMethod>
                        </CardHolder>
                        <OrderItemList>
                            <OrderItem>
                                <ItemName>Grammy Guitar</ItemName>
                                <Quantity>1</Quantity>
                                <UnitPrice>15000</UnitPrice>
                                <UnitDeductible>0</UnitDeductible>
                                <SKU>GTRGMY</SKU>
                            </OrderItem>
                            <OrderItem>
                                <ItemName>Do The Sweet Stuff</ItemName>
                                <Quantity>1</Quantity>
                                <UnitPrice>1500</UnitPrice>
                                <UnitDeductible>0</UnitDeductible>
                                <SKU>SHTDSSYELULG</SKU>
                            </OrderItem>
                            <OrderItem>
                                <ItemName>Thumbs Up T-Shirt</ItemName>
                                <Quantity>2</Quantity>
                                <UnitPrice>1500</UnitPrice>
                                <UnitDeductible>0</UnitDeductible>
                                <SKU>SHTIGVBLKMLG</SKU>
                            </OrderItem>
                        </OrderItemList>
                        <Shipping>
                            <ShippingMethod>UPS - UPS Ground</ShippingMethod>
                            <ShippingValue>1382</ShippingValue>
                            <ShippingTax>0</ShippingTax>
                        </Shipping>
                        <Transaction>
                            <TransactionType>Authorize</TransactionType>
                            <CurrentTotals>
                                <TotalTax>1560</TotalTax>
                                <TotalShipping>1382</TotalShipping>
                                <TotalDeductible>0</TotalDeductible>
                                <Total>22442</Total>
                            </CurrentTotals>
                        </Transaction>
                    </Order>
                </Request>
            </Engine>
        </CnPAPI>

        Comment


        • #5
          I needed to specify the UnitTax per OrderItem for it to add up correctly..

          Comment


          • #6
            Good day!

            All totals need to add up. The final total is really a sanity check for the transaction. The gateways require that line item totals, discounts, etc. all add up at the end and as such we do that check prior to posting.

            Hope that answers your question.
            Regards,
            Click & Pledge Support Department

            On Salesforce? Help us by rating our app: Click & Pledge Donor Management on AppExchange

            Join us @ the educational webinars: https://clickandpledge.com/webinars/
            Live Support available Join between 3:00 - 3:30 p.m. ET Monday - Thursday: https://clickandpledge.com/webinars/
            Are you on Salesforce? Join us at the Power of Us Hub: https://powerofus.force.com/0F980000000CjpC

            Comment

            Working...
            X