cancel
Showing results for 
Search instead for 
Did you mean: 

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

sailorjohn99
Member
2 REPLIES 2

The list of fields can be found in

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

RaynorC1emen7
Expert

Thanks out the location of the docs.

 

The short answer is:

 

$subscription->orderInvoiceNumber        = $invoice;

sailorjohn99
Member