cancel
Showing results for 
Search instead for 
Did you mean: 

ARB Update Subscription

I successfully update a subscription via this code using the anet_php_sdk:

        require_once 'anet_php_sdk/AuthorizeNet.php'; 
define("AUTHORIZENET_API_LOGIN_ID", $authLogin);
define("AUTHORIZENET_TRANSACTION_KEY", $authKey);
//Set to true for using test account, set to false for using real account.
define("AUTHORIZENET_SANDBOX",true);
// Update the subscription $update_request =newAuthorizeNetARB;
$updated_subscription_info =newAuthorizeNet_Subscription;
$updated_subscription_info->billToFirstName = $firstname;
$updated_subscription_info->billToLastName = $lastname;
$updated_subscription_info->creditCardCardNumber = $ccnumber;
$updated_subscription_info->creditCardExpirationDate = $ccexpire;
$updated_subscription_info->creditCardCardCode = $cccvv;
$update_response = $update_request->updateSubscription($auth_sub_id, $updated_subscription_info);
$this->assertTrue($update_response->isOk());
$this
->assertEquals($response->getResultCode(),"Ok");

Now I need to handle if the update went through okay or not, so something like this...

if($response->??????????){
//no error
}else{
//error
}

"Ok" doesn't seem to work, or maybe I'm checking the wrong response I have no idea.

Rhyinn
Member
2 REPLIES 2

the isOk() didn't work?

 require_once 'anet_php_sdk/AuthorizeNet.php'; 
define("AUTHORIZENET_API_LOGIN_ID", $authLogin);
define("AUTHORIZENET_TRANSACTION_KEY", $authKey);
//Set to true for using test account, set to false for using real account.
define("AUTHORIZENET_SANDBOX",true);
// Update the subscription $update_request =newAuthorizeNetARB;
$updated_subscription_info =newAuthorizeNet_Subscription;
$updated_subscription_info->billToFirstName = $firstname;
$updated_subscription_info->billToLastName = $lastname;
$updated_subscription_info->creditCardCardNumber = $ccnumber;
$updated_subscription_info->creditCardExpirationDate = $ccexpire;
$updated_subscription_info->creditCardCardCode = $cccvv;
$update_response = $update_request->updateSubscription($auth_sub_id, $updated_subscription_info);
$this->assertTrue($update_response->isOk());
$this
->assertEquals($response->getResultCode(),"Ok");
RaynorC1emen7
Expert

Yes, maybe I just didn't use it correctly? I'm not sure what the issue is. Any help with getting my IF statement would be greatly appreciated.