cancel
Showing results for 
Search instead for 
Did you mean: 

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);


ericremington
Member
3 REPLIES 3

forgot the trialAmountSpecified

RaynorC1emen7
Expert

Thanks for the catch, it works fine now.

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

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

 

Richard