cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

C# ARB SubscriptionRequest Example (SDK)

I am using the C# SDK to implement a Subscription. Unfortunately there is no documentation on how to use the SDK; Topic Here

 

I have figured out how to a single transaction:

 

Gateway gate = new Gateway("NAME""PASS");
        var request = new AuthorizationRequest(txtCCNum.Text, cboExpMonth.SelectedValue + cboExpYear.SelectedValue,
 txtCost.Text, "MY DESC");
 
        request.Queue(ApiFields.Method, "CC");
        var response = gate.Send(request);

 However I can't figure out how to create the SubscriptionRequest as ithas no constructor

SubscriptionGateway subGate = new SubscriptionGateway("NAME""PASS");
var subRequest =  new SubscriptionRequest();

 Any code samples of using the C# SDK with Subscriptions?

stevebor1
Member
7 REPLIES 7

Got it.

Well after loading the SDK project I dove into the code. It looks like the cycles are broken out into it's own methods:

 

var subRequest =  SubscriptionRequest.CreateMonthly("email", "desc", amount);
stevebor1
Member

Yes, but there does not appear to be a method for creating quarterly subscriptions!!

I don't know C#, but looking at the source code, I see this:

 

       public static SubscriptionRequest CreateAnnual(string email, string subscriptionName, decimal amount, short numberOfBillings) {
            var sub = new SubscriptionRequest();
            sub.CustomerEmail = email;
            sub.Amount = amount;
            
            sub.SubscriptionName = subscriptionName;
            sub.BillingCycles = numberOfBillings;           
            sub.BillingInterval = 12;

            return sub;
        }

Seems to me it would be easy to add another function to the code for quarterly billing, or add a function that lets you specify the BillingInterval as an argument. I don't know why the API has all these millions of methods rather than just one that can be set to whatever you want, anyway - seems rather inefficient.

How to apply AVS & CCV verification API for subscriptiongetway.Plz do reply as soon as possible

You would have to do a AIM auth_only transaction to get the AVS & CCV response. Then, create the ARB subscription.

Thank you for your reply,yes i have already read this AIM auth_only somewher at u r blogs...but i m unable to apply this functionality before ARB subscription.can u plz provide me the sample code for the same.

it not a function of ARB, it an AIM transaction. you can either use the sample code, the sdks, or your own code by reading the documentation.