使用银行帐户在Authorize.net中创建ARB订阅

时间:2017-04-06 07:10:03

标签: authorize.net

首先,我只想问是否可以使用银行帐户创建ARBsubscription。几乎所有示例都显示使用信用卡。但我想用银行账户来做。我正在使用“anet_php_sdk”。虽然示例代码中也有带信用卡的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();
?>

1 个答案:

答案 0 :(得分:0)

是的,您可以使用订阅的银行帐户。 Page 22 of their guide列出了所有可用字段。

在您的示例中,您同时拥有无效的信用卡和银行付款帐户。您需要删除信用卡代码行。