cancel
Showing results for 
Search instead for 
Did you mean: 

AuthorizeNet.SubscriptionGateway

AuthorizeNet.

ISubscriptionGateway gate = new AuthorizeNet.SubscriptionGateway(tbAuthNetLogin.Text, tbAuthNetTransKey.Text, AuthorizeNet.ServiceMode.Test);

 

AuthorizeNet.

ISubscriptionRequest request = AuthorizeNet.SubscriptionRequest.CreateMonthly(myemail@email.com, "subName", 0.01M, 3);

// add card info

 

// add billing info 

 

// add interval

 

request = gate.CreateSubscription(request);

 

Why does CreateSubscription from the gate return an ISubscriptionRequest rather than an ISubscriptionResponse?  This does not make any sence.  It appears that all other calls to the gate return a response or a bool.  Is the above code correct for submitting a subscription using the AuthorizeNet.Helpers dll with C#?

sszelei
Member
1 REPLY 1

A simple bool response for the create subscription request would not allow you to obtain the subscription ID number that is generated.  The code that you have provided does appear to be correct, you can confirm that the subscription was created successfully by checking the subscription ID number in the SubscriptionRequest object.

Trevor
Administrator Administrator
Administrator