Problem: When proceeding with payment using Authorize.Net and an existing saved payment method, the order is placed with the billing address saved in the existing customer payment profile, rather than the billing address selected on the checkout page.
So, in this case, how can I send a request to update the Customer Payment Profile before the payment authorization request at 'https://test.authorize.net/Payment/Api.ashx'?.
โ11-08-2024 02:48 AM
We offer a Hosted Customer Profile feature similar to Hosted Payment, enabling you to manage your profiles. For more information, please visit this page: Customer Profiles.
โ11-15-2024 05:05 PM
@sachinpawar wrote:Problem: When proceeding with payment using Authorize.Net and an existing saved payment method, the order is placed with the billing address saved in the existing customer payment profile, rather than the billing address selected on the checkout page.
So, in this case, how can I send a request to update the Customer Payment Profile before the payment authorization request at ':https://test.authorize.net/Payment/Api.ashx'?.
Use the updateCustomerPaymentProfile API
Before sending the payment authorization request, you must update the customer's payment profile with the selected billing address. Use the updateCustomerPaymentProfileRequest API method provided by Authorize.Net.
Structure the Update Request
Prepare the request payload with the necessary details, including:
customerProfileId (unique ID of the customer profile).
paymentProfileId (unique ID of the payment method to update).
Updated billTo object with the new billing address.
<updateCustomerPaymentProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<merchantAuthentication>
<name>YourAPILoginID</name>
<transactionKey>YourTransactionKey</transactionKey>
</merchantAuthentication>
<customerProfileId>123456789</customerProfileId>
<paymentProfile>
<customerPaymentProfileId>987654321</customerPaymentProfileId>
<billTo>
<firstName>John</firstName>
<lastName>Doe</lastName>
<address>123 Updated St.</address>
<city>Updated City</city>
<state>CA</state>
<zip>90001</zip>
<country>USA</country>
</billTo>
</paymentProfile>
<validationMode>liveMode</validationMode>
</updateCustomerPaymentProfileRequest>
Send the Update Request
Post the XML request to the Authorize.Net API endpoint. Ensure you handle the response to confirm that the update was successful before proceeding to the payment authorization. Proceed with Payment Authorization
After successfully updating the payment profile, you can initiate the payment request with the updated billing address.
โ12-06-2024 05:49 AM