Am so close, I think?
Running CIM PHP sample code and all is working. However, want to redirect to authorize.net for payment profile create. Have added get token to index.php as follows:
...
<form method=post action=profile_delete.php> <b>Delete Customer Profile</b><br> customerProfileId <input type=text name=customerProfileId value='<?php echo $customerProfileId; ?>'><br> <input type=submit name=submit value=submit> </form> <hr>
<form method=post action=get_token.php> <b>Get Hosted Profile Page Id Token:</b><br> customerProfileId <input type=text name=customerProfileId value='<?php echo $customerProfileId; ?>'><br> <input type=submit name=submit value=submit> </form> <hr>
</body> </html>
Added get_token.php
<html>
<body>
<?php
/*
D I S C L A I M E R
WARNING: ANY USE BY YOU OF THE SAMPLE CODE PROVIDED IS AT YOUR OWN RISK.
Authorize.Net provphpides this code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.
Authorize.Net owns and retains all right, title and interest in and to the Automated Recurring Billing intellectual property.
*/
include_once ("vars.php");
include_once ("util.php");
//build xml to post
$content =
"<?xml version=\"1.0\" encoding=\"utf-8\"?>
<getHostedProfilePageRequest xmlns=\"AnetApi/xml/v1/schema/AnetApiSchema.xsd\">"
. MerchantAuthenticationBlock().
"<customerProfileId>" . $_POST["customerProfileId"] . "</customerProfileId>
</getHostedProfilePageRequest>";
$response = send_xml_request($content);
$parsedresponse = parse_api_response($response);
if ("Ok" == $parsedresponse->messages->resultCode) {
$token=$parsedresponse->token;
echo "<P>The Token Is: $token";
}
echo "<br><a href=index.php?customerProfileId="
. urlencode($_POST["customerProfileId"])
. ">Continue</a><br>";
echo $token;
?>
<form method="post" action="https://test.authorize.net/profile/manage"
id="formAuthorizeNetPage" style="display:none;">
<input type="hidden" name="Token"
value="pfGaUNntoTxZYeqqYDjGCQ4qyCHcsXGXLJ2i7MPCEiH6CH5n5qKqcl8EBiTClxu01BSeH5eZg7LVUVVzw5kJKVMitQ3pyMB5UZCduMWd6Ku9aT2gyFm69EKMGfyWPmI4p+Bb4TJf2F07rInSrn2MWlM6f2xd7aRu1XBn0WXoPxK1j9FMGX2CNCoCBp3cOXB7"
/>
</form>
<input type=”button” onclick= "document.getElementById(
'formAuthorizeNetPage').submit();">Manage my payment and shipping
information</button>
</body>
</html>
Click get token on index and token is displayed, Yea. Click manage payment and shipping and immediatly get "The page has timed out. Please go back to the beginning and try again". Tried putting value = $token in place of the value="pfG..." and get "Missing or invalid token.".
Therefore, I beleive the dummy token in the sample script isnt accepted and my attempt to use my $token isnt valid.
Anyone?
Solved! Go to Solution.
02-28-2012 07:07 AM
Resolved:
<form method="post" action="https://test.authorize.net/profile/manage" id="formAuthorizeNetPage" style="display:none;"> <input type="hidden" name="Token" value="<?php echo $token; ?>" />
02-28-2012 07:34 AM
Resolved:
<form method="post" action="https://test.authorize.net/profile/manage" id="formAuthorizeNetPage" style="display:none;"> <input type="hidden" name="Token" value="<?php echo $token; ?>" />
02-28-2012 07:34 AM