Displaying the Form
To implement hosted customer profile management access by using a redirect to Authorize.Net, follow these steps:
Step 1 - When you receive the token returned by the GetHostedProfilePageResponse function call, put a hidden form somewhere on your page (the value for the token will be the value returned by the function call).
If you are using the test environment, replace secure.authorize.net/profile/manage with test.authorize.net/profile/manage.
<form method="post" action="https://secure.authorize.net/profile/manage">
<input type="hidden" name="token" value="pfGaUNntEKMGfyWPmI4p+Bb4TJf2F0NCoCBp3cOXB7"/>
<input type="submit" value="Manage my payment and shipping information"/>
Step 2 - Add a button on your page that redirects the customer to Authorize.Net's secure site. You can customize the text:
<input type="button" onclick= "document.getElementById( 'formAuthorizeNetPage').submit();">Manage my payment and shipping information</input>
In this example, the Manage my payment and shipping information button directs users to the Authorize.Net Customer Information Manager Hosted page, where they can:
- Create a new payment profile
- Update or delete current credit card or bank information
- Enter a new shipping address
- Update or delete current shipping address
However, it is beneficial to provide some small amount of information indirectly through a third page. You can embed our hosted form in an IFrame, which enables us to embed your IFrameCommunicator inside our hosted form. This channel of communication allows us to send messages to your IFrameCommunicator page. As long as your communicator page is hosted on the same domain as your main page, it can to communicate
This channel of communication is used to pass a few basic messages to your site:
- Ideal height and width of the window--allows you to resize the frame and avoid any scrollbars from appearing.
- Changes Saved--returned whenever the customer saves changes to their profile. You can use this notification to know when to look for those changes through the Customer Profiles API.
- Request Cancelled--returned when the merchant backs out of the hosted form.
NOTE: You must use HTTPS when using IFrameCommunicator.