Reply
Member
Posts: 2
Registered: ‎08-26-2011

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?

Member
Posts: 2
Registered: ‎08-26-2011

Re: C# ARB SubscriptionRequest Example (SDK)

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);
Member
Posts: 1
Registered: ‎11-28-2011

Re: C# ARB SubscriptionRequest Example (SDK)

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

Posts: 1,609
Topics: 15
Kudos: 201
Solutions: 121
Registered: ‎06-23-2011

Re: C# ARB SubscriptionRequest Example (SDK)

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.

Member
Posts: 3
Registered: ‎12-12-2013

Re: C# ARB SubscriptionRequest Example (SDK)

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

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

Re: C# ARB SubscriptionRequest Example (SDK)

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

Member
Posts: 3
Registered: ‎12-12-2013

Re: C# ARB SubscriptionRequest Example (SDK)

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.

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

Re: C# ARB SubscriptionRequest Example (SDK)

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.