cancel
Showing results for 
Search instead for 
Did you mean: 

PHP SDK - possible to add order description to a subscription?

I am using this php SDK (https://github.com/AuthorizeNet/sdk-php), and I don't see any documentation on how to add an order description for a subscription. It has been pretty frustrating, and I feel I am probably missing something obvious. I need this, as I use the description to pass along parameters needed by a third party app that are unique to each subscription (CRM Contact ID, CRM Order Id, CRM Product Id).

 

The only way I have found this possible is by using the old php API (https://github.com/AuthorizeNet/sdk-php/blob/master/doc/ARB.markdown), using the follow code:

 

define("AUTHORIZENET_API_LOGIN_ID", MERCHANT_LOGIN_ID);
define("AUTHORIZENET_TRANSACTION_KEY", MERCHANT_TRANSACTION_KEY);
$subscription = new AuthorizeNet_Subscription;
$subscription->orderDescription = $read_Description;
                
// Update Subscription
$request = new AuthorizeNetARB;
$response = $request->updateSubscription($response->getSubscriptionId(), $subscription);

 

This flow isn't ideal, because I am using two different APIs. I add the subscription with the new API, then update it (which is when I add the order description) with the old API.

 

I am hoping there is way I can use the new SDK and add the order description to the subscription with one call. Any help is greatly appreciated!

Believe and Achieve,

David Avellan
https://avellanenterprises.com
DavidFFA
Member
3 REPLIES 3

Hello @DavidFFA

 

The API supports what you need, but it's not included in the sample code.  I would recommend opening an issue on GitHub and ask it be added.  An issue on GitHub will notify the developer responsible for this section and you'll be notified as soon as it's available.

 

Richard

RichardH
Administrator Administrator
Administrator

Okay, I went ahead and made an issue. Thanks.

Believe and Achieve,

David Avellan
https://avellanenterprises.com

There is a a LOT missing from the sample code on the Accept Hosted API Help Guide! 

I am using the sim.php and able to pass these before creating the hash and for the life of me, I cannot find the same functionality in the accept hosted... 

$x_Description = $_REQUEST['x_Description'];
$x_Amount = $_REQUEST['x_Amount'];
$x_cust_id = $_REQUEST['x_cust_id'];
$x_company = $_REQUEST['x_company'];
$x_po_num = $_REQUEST['x_po_num'];
$x_event = $_REQUEST['x_event'];

 

Where exactly is it documented in the API documentation? I have crawled all over that... and this seems like it really should be some basic stuff.... 

 

I'm just trying to move a customer over and I don't need every imaginable jsfeature and every payment method... I just need to pass a fixed amount and a customer reference number.... 

 

thank you.....