Example #1
0
				$successMsg .= $type . ' ID : '.$xmlresponse->TokenId . "<br>";
			}
			else {
			  	//handle response (basic error handling
			  	$failMsg .=  "Fatal Error: <br> ";
				$failMsg .= "Response: ". $xmlresponse->Errors->Error->Message ."<br>";
			}
		}
	}

}
$failMsg = '';
$successMsg = '';
if (isset($_POST['accessKey']) && isset($_POST['accessSecret']) && @$_POST['accountType']) {
	$live = $_POST['accountType'] == 'live';
	$aws = new AmazonTokenCreator($live);
	$aws->process('Caller',$_POST['accessKey'],$_POST['accessSecret'], $successMsg, $failMsg);
	$aws->process('Recipient',$_POST['accessKey'],$_POST['accessSecret'], $successMsg,$failMsg);
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11">
<html>
<head>
	<title>Amazon Flexible Payment System</title>
	<meta name="robots" content="noindex, nofollow" />
	<style type="text/css">
		@import url("../../../../admin/Styles/styles.css");
	</style>
</head>
            // Setup the proxy settings if there are any
            $response = curl_exec($ch);
            $xmlresponse = new SimpleXMLElement($response);
        }
        if (!empty($xmlresponse)) {
            //handle HTTP response. Fatal error if did not pass this step
            if ($xmlresponse->Status == 'Success') {
                echo $type . ' ID : ' . $xmlresponse->TokenId . "<br>";
            } else {
                //handle response (basic error handling
                echo "Fatal Error: <br> ";
                echo "Response: " . $xmlresponse->Errors->Error->Message . "<br>";
            }
        }
    }
}
if (isset($_POST['accessKey']) && isset($_POST['accessSecret'])) {
    $aws = new AmazonTokenCreator();
    $aws->process('Caller', $_POST['accessKey'], $_POST['accessSecret']);
    $aws->process('Recipient', $_POST['accessKey'], $_POST['accessSecret']);
}
?>

<form method="POST">

	Access ID : <input id="accessKey" name="accessKey"></input>
	Access Secret Key : <input id="accessSecret" name="accessSecret"></input>
	<input type="submit" value="Generate Tokens"></input>

</form>