Integration and Testing

Authorize.Net API questions and help with your payment integration.

Reply
Member
Posts: 2
Registered: ‎08-06-2012

ARB - Free Trial - Both Trial Amount and Trial Occurrences are required?

I am using the AuthNetWS interface to ARB. I am attempting to use the Trial Period option for a subscription. It appears that if I set the TrialAmount = 0 then I recieve the "Both Trial Amount and Trial Occurrences are required." error. What am I doing wrong? Is having a 1 month free possible? My example shows 1 month free and 11 month @ $49.95 for 12 month total.


Here is the code I am using:

 

// create subscription and card objects from App_Code\ArbApiInterface.cs

                AuthNetWS.ARBSubscriptionType subscription = new AuthNetWS.ARBSubscriptionType();

 

                // subscription name

                subscription.name = "Sample Subscription";

 

                // payment info

                subscription.payment = new AuthNetWS.PaymentType();

                subscription.payment.Item = creditCard;

 

                // billing info

                subscription.billTo = billToAddress;

 

                // add subscription for 12 monthly installments

                subscription.paymentSchedule = new AuthNetWS.PaymentScheduleType();

                subscription.paymentSchedule.startDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);

                subscription.paymentSchedule.startDateSpecified = true;

                subscription.paymentSchedule.totalOccurrences = 12;

                subscription.paymentSchedule.totalOccurrencesSpecified = true;

                subscription.paymentSchedule.interval = new AuthNetWS.PaymentScheduleTypeInterval();

                subscription.paymentSchedule.interval.length = 1;

                subscription.paymentSchedule.interval.unit = AuthNetWS.ARBSubscriptionUnitEnum.months;

                subscription.paymentSchedule.trialOccurrences = 1;

                subscription.paymentSchedule.trialOccurrencesSpecified = true;

                subscription.trialAmount = 0;

                subscription.amount = 49.95;

                subscription.amountSpecified = true;

 

                // customer info

                subscription.customer = new AuthNetWS.CustomerType();

                subscription.customer.email = EmailTextBox.Text;

                subscription.customer.phoneNumber = phone;

 

                // add subscription to request

                subscriptionID = AuthNet.CreateSubscription(subscription);


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

Re: ARB - Free Trial - Both Trial Amount and Trial Occurrences are required?

forgot the trialAmountSpecified

Member
Posts: 2
Registered: ‎08-06-2012

Re: ARB - Free Trial - Both Trial Amount and Trial Occurrences are required?

Thanks for the catch, it works fine now.

Not only was I missing that info, but so is the documentation.

Posts: 2,765
Topics: 57
Kudos: 270
Blog Posts: 67
Registered: ‎12-05-2011

Re: ARB - Free Trial - Both Trial Amount and Trial Occurrences are required?

We'll pass your comments onto our documentation team, thanks for the information.

 

Richard