cancel
Showing results for 
Search instead for 
Did you mean: 

Authorize.net getHostedPaymentPageRequest

Hello,

Is there a way I can send some information about each transaction while getting a token from getHostedPaymentPageRequest. I tried with order but the order doesn't get back in getTransactionDetails.

 

Once the payment is success, I want to retrieve the same information which is sent while creating the getHostedPaymentPageRequest in getTransactionDetails response of webhooks?

 

Basically I want to send certain information while creating the hosted page and retrieve it when I get the transaction details.

ankurdoshi
Member
6 REPLIES 6
@ankurdoshi

The getTransactionDetails function will return the entire transaction. Not one thing about that transaction request is omitted.
Renaissance
All Star

As per the documentation, we should get all the information in get Transaction details. But it fails on the hosted page where we enter the Credit card number with Error Message: 

 

Request: 

https://apitest.authorize.net/xml/v1/request.api

 

{ 
   "getHostedPaymentPageRequest":{ 
      "merchantAuthentication":{ 
         "name":"XXXXX",
         "transactionKey":"XXXXX"
      },
      "transactionRequest":{ 
         "transactionType":"authCaptureTransaction",
         "amount":"1.0",
         "profile":{ 
            "customerProfileId":"1298312983"
         },
         "order":{ 
            "invoiceNumber":"Invoice1234",
            "description":null,
            "discountAmount":0.00,
            "taxIsAfterDiscount":false,
            "purchaseOrderDateUTC":"2019-10-25",
            "amexDataTAA1":"12345678912312",
            "amexDataTAA2":"abcdefghijk"
         }
      },
      "hostedPaymentSettings":{ 
         "setting":[ 
            { 
               "settingName":"hostedPaymentReturnOptions",
               "settingValue":"{\"showReceipt\": false, \"url\": \"  http://test.com/success   \", \"urlText\": \"Continue\", \"cancelUrl\": \" http://test.com/failure \", \"cancelUrlText\": \"Cancel\"}"
            },
            { 
               "settingName":"hostedPaymentButtonOptions",
               "settingValue":"{\"text\": \"Pay\"}"
            },
            { 
               "settingName":"hostedPaymentStyleOptions",
               "settingValue":"{\"bgColor\": \"blue\"}"
            },
            { 
               "settingName":"hostedPaymentPaymentOptions",
               "settingValue":"{\"cardCodeRequired\": false, \"showCreditCard\": true, \"showBankAccount\": true}"
            },
            { 
               "settingName":"hostedPaymentSecurityOptions",
               "settingValue":"{\"captcha\": false}"
            },
            { 
               "settingName":"hostedPaymentShippingAddressOptions",
               "settingValue":"{\"show\": false, \"required\": false}"
            },
            { 
               "settingName":"hostedPaymentBillingAddressOptions",
               "settingValue":"{\"show\": true, \"required\": false}"
            },
            { 
               "settingName":"hostedPaymentCustomerOptions",
               "settingValue":"{\"showEmail\": false, \"requiredEmail\": false, \"addPaymentProfile\": true}"
            },
            { 
               "settingName":"hostedPaymentOrderOptions",
               "settingValue":"{\"show\": true, \"merchantName\": \"TEST TEST\"}"
            },
            { 
               "settingName":"hostedPaymentIFrameCommunicatorUrl",
               "settingValue":"{\"url\": \"https://mysite.com/special\"}"
            }
         ]
      }
   }
}

Response:

{"resultCode":"Error","messageCode":"E00001","messageText":"Unexpected error. Please try again."}

Not sure what this error means?

 

 

 

@ankurdoshi

What is amexdataTAA1?

I thought I can use this to send extra information. Its available in schema definition.

https://apitest.authorize.net/xml/v1/schema/AnetApiSchema.xsd

 

<xs:complexType name="orderType">
<xs:sequence>
<xs:element name="invoiceNumber" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="20"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="description" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="255"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="discountAmount" minOccurs="0" type="xs:decimal"/>
<xs:element name="taxIsAfterDiscount" type="xs:boolean" minOccurs="0"> </xs:element>
<xs:element name="totalTaxTypeCode" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="3"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="purchaserVATRegistrationNumber" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="21"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="merchantVATRegistrationNumber" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="21"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="vatInvoiceReferenceNumber" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="15"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="purchaserCode" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="17"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="summaryCommodityCode" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="4"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="purchaseOrderDateUTC" minOccurs="0" type="xs:date"/>
<xs:element name="supplierOrderReference" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="25"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="authorizedContactName" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="36"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="cardAcceptorRefNumber" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="25"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="amexDataTAA1" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="40"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="amexDataTAA2" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="40"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="amexDataTAA3" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="40"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="amexDataTAA4" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="40"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>

Is there any other parameters where I can send additional information and get it back in get transaction details?

 

Tried with removed the field as well but still the same error.

 

{ 
   "getHostedPaymentPageRequest":{ 
      "merchantAuthentication":{ 
         "name":"XXXXX",
         "transactionKey":"XXXXX"
      },
      "transactionRequest":{ 
         "transactionType":"authCaptureTransaction",
         "amount":"1.0",
         "profile":{ 
            "customerProfileId":"1298312983"
         },
         "order":{ 
            "invoiceNumber":"Invoice1234",
            "description":"test",
            "discountAmount":0.00,
            "taxIsAfterDiscount":false,
            "purchaseOrderDateUTC":"2019-10-25"
         }
      },
      "hostedPaymentSettings":{ 
         "setting":[ 
            { 
               "settingName":"hostedPaymentReturnOptions",
               "settingValue":"{\"showReceipt\": false, \"url\": \"  http://test.com/success   \", \"urlText\": \"Continue\", \"cancelUrl\": \" http://test.com/failure \", \"cancelUrlText\": \"Cancel\"}"
            },
            { 
               "settingName":"hostedPaymentButtonOptions",
               "settingValue":"{\"text\": \"Pay\"}"
            },
            { 
               "settingName":"hostedPaymentStyleOptions",
               "settingValue":"{\"bgColor\": \"blue\"}"
            },
            { 
               "settingName":"hostedPaymentPaymentOptions",
               "settingValue":"{\"cardCodeRequired\": false, \"showCreditCard\": true, \"showBankAccount\": true}"
            },
            { 
               "settingName":"hostedPaymentSecurityOptions",
               "settingValue":"{\"captcha\": false}"
            },
            { 
               "settingName":"hostedPaymentShippingAddressOptions",
               "settingValue":"{\"show\": false, \"required\": false}"
            },
            { 
               "settingName":"hostedPaymentBillingAddressOptions",
               "settingValue":"{\"show\": true, \"required\": false}"
            },
            { 
               "settingName":"hostedPaymentCustomerOptions",
               "settingValue":"{\"showEmail\": false, \"requiredEmail\": false, \"addPaymentProfile\": true}"
            },
            { 
               "settingName":"hostedPaymentOrderOptions",
               "settingValue":"{\"show\": true, \"merchantName\": \"TEST TEST\"}"
            },
            { 
               "settingName":"hostedPaymentIFrameCommunicatorUrl",
               "settingValue":"{\"url\": \"https://mysite.com/special\"}"
            }
         ]
      }
   }
}
@ankurdoshi

That request still has fields that I’m not sure belong. I suggest that you create a request using the API reference request fields. Each top level property of the request will have its properties listed in child
nodes. So order will be listed like this-

•order
••Invoice number
••Description

Use only fields from the API reference and your request should go through fine.