Created
November 16, 2012 20:44
-
-
Save rkellermeyer/4090747 to your computer and use it in GitHub Desktop.
Auth.net PHP samples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once '../anet_php_sdk/AuthorizeNet.php'; // The SDK | |
$url = "http://YOURSITE.tld/post_result.php"; | |
$api_login_id = '######'; | |
$transaction_key = '#############'; | |
$md5_setting = '######'; // Your MD5 Setting | |
$amount = "5.99"; | |
AuthorizeNetDPM::directPostDemo($url, $api_login_id, $transaction_key, $amount, $md5_setting); | |
define("AUTHORIZENET_API_LOGIN_ID", $api_login_id); | |
define("AUTHORIZENET_TRANSACTION_KEY", $transaction_key); | |
// Get Settled Batch List | |
$request = new AuthorizeNetTD; | |
$response = $request->getSettledBatchList(); | |
echo count($response->xml->batchList->batch) . " batches\n"; | |
foreach ($response->xml->batchList->batch as $batch) { | |
echo "Batch ID: " . $batch->batchId . "\n"; | |
} | |
// Get Transaction Details | |
$transactionId = "12345"; | |
$response = $request->getTransactionDetails($transactionId); | |
echo $response->xml->transaction->transactionStatus; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment