cancel
Showing results for 
Search instead for 
Did you mean: 

Authorize.net Accept Hosted & Customer Profiles

Background:

I'm creating my first Authorize.net Accept Hosted solution. The plan is to use the merchant's custom PHP cart to collect the shipping, billing address then present the hosted form to collect payment. Many of the customers will be 'guest' customers without customer profiles generated in the PHP cart.

I have successfully created an XML token request using CURL and used the return token to request the payment form and populate an iframe.

 

The Problem:

We'd like to pass the billing/shipping info entered into the cart to Auth.net so the customer does not need to re-enter the information. The documentation/examples I have been able to find require use of the SDK to create a customer profile in order to do this.

 

Is there an easier way?

 

My questions:

  1. Can we pass the shipping / billing in the token request?
  2. Can we pass the shipping / billing in the form request?
  3. Any other suggestions on how to pass this billing / shipping info without creating a separate customer profile transaction?
  4. If we have to create a customer profile for each transaction, can we create a customer profile using XML/CURL without incorporating the entire SDK?

Thanks in advance for your help.

mwex501
Member
1 ACCEPTED SOLUTION

Accepted Solutions

Hello,

 

 Yes, you can pass both billing and shipping address infomation to the token reques, which will then be pre-populated in the form :

getHostedPaymentPageRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
   <merchantAuthentication>
      <name>YOUR_LOGIN_ID</name>
      <transactionKey>YOUR_TRANSACTION_KEY</transactionKey>
   </merchantAuthentication>
   <transactionRequest>
      <transactionType>authCaptureTransaction</transactionType>
      <amount>20.00</amount>
      <billTo>
         <firstName>Ellen</firstName>
         <lastName>Johnson</lastName>
         <company>Souveniropolis</company>
         <address>14 Main Street</address>
         <city>Pecan Springs</city>
         <state>TX</state>
         <zip>44628</zip>
         <country>USA</country>
      </billTo>
      <shipTo>
         <firstName>China</firstName>
         <lastName>Bayles</lastName>
         <company>Thyme for Tea</company>
         <address>12 Main Street</address>
         <city>Pecan Springs</city>
         <state>TX</state>
         <zip>44628</zip>
         <country>USA</country>
      </shipTo>
   </transactionRequest>
   <hostedPaymentSettings>
      <setting>
         <settingName>hostedPaymentBillingAddressOptions</settingName>
         <settingValue>{"show": true, "required":true}</settingValue>
      </setting>
      <setting>
         <settingName>hostedPaymentButtonOptions</settingName>
         <settingValue>{"text": "Pay"}</settingValue>
      </setting>
      <setting>
         <settingName>hostedPaymentReturnOptions</settingName>
         <settingValue>{"url":"https://www.mystore.com/good","urlText":"Continue","cancelUrl":"https://www.mystore.com/cancel","cancelUrlText":"Cancel"}</settingValue>
      </setting>
      <setting>
         <settingName>hostedPaymentShippingAddressOptions</settingName>
         <settingValue>{"show": true, "required":true}</settingValue>
      </setting>
   </hostedPaymentSettings>
</getHostedPaymentPageRequest>
Yes, you can also create a customer profile using XML/CURL without incorporating the entire SDK.
Powered by NexWebSites.com -
Certified Authorize.net developers

View solution in original post

NexusSoftware
Trusted Contributor
4 REPLIES 4

Hello,

 

 Yes, you can pass both billing and shipping address infomation to the token reques, which will then be pre-populated in the form :

getHostedPaymentPageRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
   <merchantAuthentication>
      <name>YOUR_LOGIN_ID</name>
      <transactionKey>YOUR_TRANSACTION_KEY</transactionKey>
   </merchantAuthentication>
   <transactionRequest>
      <transactionType>authCaptureTransaction</transactionType>
      <amount>20.00</amount>
      <billTo>
         <firstName>Ellen</firstName>
         <lastName>Johnson</lastName>
         <company>Souveniropolis</company>
         <address>14 Main Street</address>
         <city>Pecan Springs</city>
         <state>TX</state>
         <zip>44628</zip>
         <country>USA</country>
      </billTo>
      <shipTo>
         <firstName>China</firstName>
         <lastName>Bayles</lastName>
         <company>Thyme for Tea</company>
         <address>12 Main Street</address>
         <city>Pecan Springs</city>
         <state>TX</state>
         <zip>44628</zip>
         <country>USA</country>
      </shipTo>
   </transactionRequest>
   <hostedPaymentSettings>
      <setting>
         <settingName>hostedPaymentBillingAddressOptions</settingName>
         <settingValue>{"show": true, "required":true}</settingValue>
      </setting>
      <setting>
         <settingName>hostedPaymentButtonOptions</settingName>
         <settingValue>{"text": "Pay"}</settingValue>
      </setting>
      <setting>
         <settingName>hostedPaymentReturnOptions</settingName>
         <settingValue>{"url":"https://www.mystore.com/good","urlText":"Continue","cancelUrl":"https://www.mystore.com/cancel","cancelUrlText":"Cancel"}</settingValue>
      </setting>
      <setting>
         <settingName>hostedPaymentShippingAddressOptions</settingName>
         <settingValue>{"show": true, "required":true}</settingValue>
      </setting>
   </hostedPaymentSettings>
</getHostedPaymentPageRequest>
Yes, you can also create a customer profile using XML/CURL without incorporating the entire SDK.
Powered by NexWebSites.com -
Certified Authorize.net developers
NexusSoftware
Trusted Contributor

Perfect! Thanks!

BTW is there documentation outlining ALL the possible fields that can be sent with the token request?