0
首先,我只是想問,是否可以使用銀行賬戶創建ARBsubscription。幾乎所有示例都顯示使用信用卡。但我想用銀行賬戶來做。我正在使用「anet_php_sdk」。儘管示例代碼中還有帶有信用卡的ARB。但我改變了一下 -使用銀行賬戶在Authorize.net創建ARB訂閱
<?php
require_once 'anet_php_sdk/AuthorizeNet.php';
define("AUTHORIZENET_API_LOGIN_ID", "YOURLOGIN");
define("AUTHORIZENET_TRANSACTION_KEY", "YOURKEY");
$subscription = new AuthorizeNet_Subscription;
$subscription->name = "PHP Monthly Magazine";
$subscription->intervalLength = "1";
$subscription->intervalUnit = "months";
$subscription->startDate = "2017-05-12";
$subscription->totalOccurrences = "12";
$subscription->trialOccurrences = "1";
$subscription->amount = "45.00";
$subscription->bankAccountAccountType = "CHECKING";
$subscription->bankAccountRoutingNumber= "121042882";
$subscription->bankAccountAccountNumber= "123456789123";
$subscription->bankAccountNameOnAccount= "Test Test1";
$subscription->bankAccountEcheckType = "WEB";
$subscription->bankAccountBankName = "Bank of Earth";
/*$subscription->creditCardCardNumber = "4007000000027";
$subscription->creditCardExpirationDate= "2018-10";
$subscription->creditCardCardCode = "123";*/
$subscription->billToFirstName = "test";
$subscription->billToLastName = "test1";
// Create the subscription.
$request = new AuthorizeNetARB;
$response = $request->createSubscription($subscription);
echo "<pre>";
print_r($response);
die();
$subscription_id = $response->getSubscriptionId();
?>
感謝john的回覆。我記得你沒有注意到信用卡信息評論。此外,這是一切正確的。我遵循這個文檔來獲得參數。但是在調用API之後沒有響應。 –
查看SDK文檔時,其示例看起來不像您的代碼。你在使用最新的SDK嗎?你有沒有遵循它的例子? –
嗨,我正在使用「anet_php_sdk」。我已經使用「echeck」付款。但是,你可以給我的SDK的鏈接。 –