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
10-25-2012 06:38 AM
The list of fields can be found in
anet_php_sdk\lib\shared\AuthorizeNetTypes.php in class AuthorizeNet_Subscription
10-25-2012 07:10 AM
Thanks out the location of the docs.
The short answer is:
$subscription->orderInvoiceNumber = $invoice;
10-25-2012 07:54 AM