Reply
Highlighted
Member
Posts: 2
Registered: ‎10-25-2012

adding invoice with anet_php_sdk/AuthorizeNet.php

I'm using PHP ARB as described in the accompanying markdown to create a subscription:

 

$subscription = new AuthorizeNet_Subscription;
$subscription->name = "Short subscription";
$subscription->intervalLength = "1";
$subscription->intervalUnit = "months";
$subscription->startDate = "2011-03-12";
$subscription->totalOccurrences = "14";
$subscription->amount = rand(1,100);
$subscription->creditCardCardNumber = "6011000000000012";
$subscription->creditCardExpirationDate = "2018-10";
$subscription->creditCardCardCode = "123";
$subscription->billToFirstName = "john";
$subscription->billToLastName = "doe";

 

It works the first time, but returns a "duplicate subscription" error.  I've read that I can get past the error with an invoice number.   How to I specify that?  I've tried:

 

$subscription->invoice

$subscription->invoiceNumber

 

These don't work.  How do I do it?

 

Thanks

 

John

Highlighted
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: adding invoice with anet_php_sdk/AuthorizeNet.php

The list of fields can be found in

anet_php_sdk\lib\shared\AuthorizeNetTypes.php  in class AuthorizeNet_Subscription

Highlighted
Member
Posts: 2
Registered: ‎10-25-2012

Re: adding invoice with anet_php_sdk/AuthorizeNet.php

Thanks out the location of the docs.

 

The short answer is:

 

$subscription->orderInvoiceNumber        = $invoice;