RecurringBilling Code Examples

This KB entry includes simple sample code for different gateways.

Date Entered: 04/21/2014    Last Updated: 04/28/2017

Below are code examples for different gateways supported in the E-Payment Integrator. If you require additional sample code for a gateway please contact support@nsoftware.com

Gateways

Authorize.Net

Create an ARB (Automatic Recurring Billing) service on Authorize.net: Recurringbilling recurring = new Recurringbilling(); // Gateway deets recurring.Gateway = RecurringbillingGateways.gwAuthorizeNet; recurring.GatewayURL = "https://apitest.authorize.net/xml/v1/request.api"; recurring.MerchantLogin = "YourLogin"; recurring.MerchantPassword = "YourPassword"; // Customer deets EPCustomer cust = new EPCustomer(); cust.FirstName = "John"; cust.LastName = "Smith"; cust.FullName = "John M. Smith"; cust.Address = "123 Nowhere Ln."; cust.City = "Beverly Hills"; cust.State = "CA"; cust.Zip = "90210"; cust.Country = "USA"; cust.Phone = "555-555-5555"; cust.Email = "jsmith@fake.com"; cust.Id = "123456"; // Card deets CCCard card = new CCCard(); card.Number = "4788250000028291"; // This is just a test card from authorize.net card.ExpMonth = 12; card.ExpYear = 2020; card.EntryDataSource = EntryDataSources.edsManualEntryNoCardReader; // Subscription deets recurring.SubscriptionName = "YourSubscriptionName"; recurring.PaymentSchedule.StartDate = "04/15/2017"; recurring.PaymentSchedule.EndDate = "04/15/2018"; recurring.PaymentSchedule.Frequency = "1"; recurring.PaymentSchedule.FrequencyUnit = "M"; recurring.PaymentSchedule.RecurAmount = "00.01"; recurring.PaymentSchedule.TotalPayments = 12; recurring.Customer = cust; recurring.Card = card; // Create the subscription recurring.CreateSubscription();

Authorize.Net CIM

Create a CIM profile on Authorize.net: Recurringbilling recurring = new Recurringbilling(); recurring.Gateway = RecurringbillingGateways.gwAuthorizeNetCIM; recurring.GatewayURL = "https://apitest.authorize.net/xml/v1/request.api"; //This is your Authorize.Net UserId / Name recurring.MerchantLogin = "Name"; //This is your Authorize.Net Transaction Key recurring.MerchantPassword = "TransactionKey"; recurring.Card.Number = "5424000000000015"; recurring.Card.ExpMonth = 12; recurring.Card.ExpYear = 21; recurring.Card.CVVData = "999"; recurring.Customer.FirstName = "John"; recurring.Customer.LastName = "Smith"; recurring.Customer.Address = "1 Test Street"; recurring.Customer.City = "Test City"; recurring.Customer.State = "NC"; recurring.Customer.Zip = "27717"; recurring.Customer.Country = "USA"; recurring.ShippingInfo.Address = "1st St."; recurring.ShippingInfo.City = "1st City"; recurring.ShippingInfo.State = "NC"; recurring.ShippingInfo.Zip = "98765"; recurring.ShippingInfo.Country = "US"; recurring.TransactionId = "Sample"; recurring.Customer.Id = "123456789"; recurring.CreateSubscription(); Console.WriteLine("Profile Id : " + recurring.Response.SubscriptionId); Console.WriteLine("Profile Payment Id : " + recurring.Config("AuthNetCIMPaymentProfileId")); Console.WriteLine("Profile Shipping Id : " + recurring.Config("AuthNetCIMShippingAddressId"));

Back to Top

Beanstream

Create and update a subscription: //This is the "merchant_id" recurring.MerchantLogin = "218010000"; //This is the "username" recurring.Config("BeanstreamUsername=nsoftware"); //This is the "password" recurring.MerchantPassword = "password"; recurring.Customer.FirstName = "John"; recurring.Customer.LastName = "Smith"; recurring.Customer.Address = "1234 Main St"; recurring.Customer.Zip = "V8T5J1"; recurring.Customer.City = "Victoria"; recurring.Customer.State = "BC"; recurring.Customer.Country = "CA"; recurring.Customer.Email = "Test@test.com"; recurring.Customer.Phone = "9195555555"; recurring.Card.ExpMonth = 1; recurring.Card.ExpYear = 2015; recurring.Card.CVVData = "123"; recurring.Card.Number = "4030000010001234"; recurring.InvoiceNumber = "1234"; recurring.PaymentSchedule.FrequencyUnit = "M"; recurring.PaymentSchedule.Frequency = "1"; recurring.PaymentSchedule.RecurAmount = "10.00"; recurring.CreateSubscription(); string subId = recurring.Response.SubscriptionId; //When calling UpdateSubscription, CancelSubscription, or GetSubscriptionStatus //this is the Recurring Billing API "passcode" recurring.MerchantPassword = "201f5c38a85647E485BB8eaf17B7ED01"; recurring.Card = new CCCard(); recurring.Customer = new EPCustomer(); recurring.PaymentSchedule = new EPPaymentSchedule(); recurring.PaymentSchedule.RecurAmount = "20.00"; recurring.UpdateSubscription(subId);

Back to Top

Chase/YourPay/FirstData/Linkpoint

Create a subscription: recurring.Gateway = RecurringbillingGateways.gwLinkPoint; recurring.GatewayURL = "staging.linkpt.net:1129"; //Test URL //This is your store number recurring.MerchantLogin = "1909977744"; //The certificate is provided by the gateway recurring.SSLCert = new Certificate(CertStoreTypes.cstPEMKeyFile, "..\\..\\files\\linkpoint.pem", "", "*"); recurring.Card.ExpMonth = 1; recurring.Card.ExpYear = 16; recurring.Card.Number = "4111111111111111"; recurring.Customer.Address = "1234 Nowhere Ln"; recurring.Customer.City = "Beverly Hills"; recurring.Customer.Country = "US"; recurring.Customer.Email = "nobody@server.com"; recurring.Customer.FirstName = "John"; recurring.Customer.Id = "CUSTOMER1"; recurring.Customer.LastName = "Smith"; recurring.Customer.Phone = "555-555-5555"; recurring.Customer.State = "CA"; recurring.Customer.Zip = "90210"; recurring.TransactionId = DateTime.Now.Ticks.ToString(); recurring.InvoiceNumber = DateTime.Now.Ticks.ToString(); recurring.SubscriptionDesc = "Test Transaction"; recurring.PaymentSchedule.RecurAmount = "12." + DateTime.Now.Minute.ToString("00"); //Avoid duplicate transactions a bit recurring.PaymentSchedule.TotalPayments = 10; recurring.PaymentSchedule.StartDate = DateTime.Now.ToString("MM/dd/yyyy"); recurring.PaymentSchedule.FrequencyUnit = "M"; recurring.PaymentSchedule.Frequency = "1"; recurring.CreateSubscription(); string subId = recurring.Response.SubscriptionId; Note: Chase, YourPay, FirstData, and LinkPoint all use the same implementation.

Back to Top

CyberSource

Create a subscription: recurring = new Recurringbilling(); recurring.Gateway = RecurringbillingGateways.gwCyberSource; recurring.GatewayURL = "https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor/"; //This is your username recurring.MerchantLogin = "nsoft_test1"; //This is your transaction key generated from your merchant account online. //Be sure to generate this for the SOAP API, not the Simple Order API. recurring.MerchantPassword = "ruTCCovVZ2UMbfwG6a...LrS2xuoaubJrwA=="; recurring.Customer.FirstName = "John"; recurring.Customer.LastName = "Doe"; recurring.Customer.Email = "nobody@cybersource.com"; recurring.Customer.Phone = "408-556-9100"; recurring.Customer.Address = "1295 Charleston Rd."; recurring.Customer.City = "Mountain View"; recurring.Customer.State = "CA"; recurring.Customer.Zip = "94043-1307"; recurring.Customer.Country = "US"; recurring.Card.Number = "4111111111111111"; recurring.Card.ExpMonth = 12; recurring.Card.ExpYear = 20; recurring.Card.CVVData = "123"; recurring.InvoiceNumber = "12"; recurring.PaymentSchedule.RecurAmount = "10.00"; recurring.PaymentSchedule.Frequency = "weekly"; recurring.PaymentSchedule.TotalPayments = 50; recurring.PaymentSchedule.StartDate = DateTime.Now.AddDays(2).ToString("MM/dd/yyyy"); recurring.CreateSubscription(); string subId = recurring.Response.SubscriptionId;

Back to Top

eProcessing

Create a subscription: //This is your eProcessingNetwork account number. recurring.MerchantLogin = "080880"; recurring.MerchantPassword = "080880pw"; //Set this value if you have one recurring.AddSpecialField("RestrictKey", "yGqqXJh0Pqnugfr"); recurring.Card.CVVData = "999"; recurring.Card.ExpMonth = 2; recurring.Card.ExpYear = 15; recurring.Card.Number = "4111111111111111"; recurring.Customer.Address = "1234 Nowhere Ln"; recurring.Customer.City = "Beverly Hills"; recurring.Customer.Country = "US"; recurring.Customer.Email = "nobody@server.com"; recurring.Customer.FirstName = "John"; recurring.Customer.Id = "CUSTOMER1"; recurring.Customer.LastName = "Smith"; recurring.Customer.Phone = "555-555-5555"; recurring.Customer.State = "CA"; recurring.Customer.Zip = "90210"; recurring.SubscriptionDesc = "Test Transaction"; recurring.SubscriptionName = "TestRecur"; recurring.PaymentSchedule.Frequency = "Monthly"; recurring.PaymentSchedule.TotalPayments = 12; recurring.PaymentSchedule.StartDate = DateTime.Now.AddDays(2).ToString("MM/dd/yyyy"); recurring.PaymentSchedule.RecurAmount = "10.00"; recurring.CreateSubscription(); string subID = recurring.Response.SubscriptionId;

Back to Top

eWay

The eWay gateway requires management of the customer profile and subscription profile separately. The "EwayTransactionType" configuration setting determines the type of request that is made. A customer must exist before creating a subscription profile.

Create a Customer: //Create and Update a customer recurring.Gateway = RecurringbillingGateways.gwEway; recurring.GatewayURL = "https://www.eway.com.au/gateway/rebill/test/manageRebill_test.asmx"; //This is your eWay username recurring.MerchantLogin = "support@nsoftware.com"; //This is your eWay password recurring.MerchantPassword = "password"; //This is your eWay customer Id recurring.Config("EwayCustomerId=91330478"); recurring.Card.Number = "4444333322221111"; recurring.Card.ExpMonth = 2; recurring.Card.ExpYear = 15; recurring.Config("EwayTransactionType=1"); //Customer recurring.Customer.Address = "1234 Nowhere Ln"; recurring.Customer.City = "Beverly Hills"; recurring.Customer.Country = "US"; recurring.Customer.Email = "nobody@server.com"; recurring.Customer.FirstName = "John"; recurring.Customer.Id = "CUSTOMER1"; recurring.Customer.LastName = "Smith"; recurring.Customer.Phone = "555-555-5555"; recurring.Customer.State = "CA"; recurring.Customer.Zip = "90210"; recurring.CreateSubscription(); string customerId = recurring.Response.TransactionId; recurring.Customer.LastName = "Smith_Update"; recurring.UpdateSubscription(customerId);

Create a Subscription //Create a Subscription recurring.Gateway = RecurringbillingGateways.gwEway; recurring.GatewayURL = "https://www.eway.com.au/gateway/rebill/test/manageRebill_test.asmx"; //This is your eWay username recurring.MerchantLogin = "support@nsoftware.com.sand"; //This is your eWay password recurring.MerchantPassword = "Nsoft1111"; //This is your eWay customer Id recurring.Config("EwayCustomerId=91330478"); recurring.Card.Number = "4444333322221111"; recurring.Card.ExpMonth = 2; recurring.Card.ExpYear = 15; recurring.Config("EwayTransactionType=0"); //Subscription (Rebill Event) recurring.PaymentSchedule.InitialAmount = "100"; recurring.Config("EwayInitialDate=" + DateTime.Now.AddDays(1).ToString("MM/dd/yyyy")); recurring.PaymentSchedule.RecurAmount = "500"; recurring.PaymentSchedule.StartDate = DateTime.Now.AddDays(2).ToString("MM/dd/yyyy"); recurring.PaymentSchedule.EndDate = DateTime.Now.AddYears(1).ToString("MM/dd/yyyy"); recurring.PaymentSchedule.FrequencyUnit = "Months"; recurring.PaymentSchedule.Frequency = "1"; recurring.TransactionId = customerId; //Previously created customer Id recurring.SubscriptionDesc = "Test"; recurring.CreateSubscription(); string subId = recurring.Response.SubscriptionId;

Back to Top

GoToBilling

The GoToBilling gateway requires management of the customer, account, and recurring billing profile separately. The "GoToBillingTransactionType" configuration setting determines the type of request that is made. Both a customer and account must exist before creating a subscription profile.

Create a Customer: //Create and Update Customer recurring.Gateway = RecurringbillingGateways.gwGoToBilling; //This is your 6 digit MID recurring.MerchantLogin = "123456"; //This is your 6 digit PIN recurring.MerchantPassword = "123456"; recurring.Card.Number = "6011000000000012"; recurring.Card.ExpMonth = 4; recurring.Card.ExpYear = 2015; recurring.Card.CVVData = "999"; recurring.Customer.Id = "0000"; recurring.Customer.Address = "123 Nowhere Ln"; recurring.Customer.Zip = "90210"; recurring.Customer.Country = "840"; recurring.Customer.Email = "nobody@server.com"; recurring.Customer.Phone = "555-123-4567"; recurring.Customer.FirstName = "FirstName"; recurring.Customer.LastName = "LastName"; recurring.InvoiceNumber = "1234"; recurring.PaymentSchedule.RecurAmount = "10.00"; recurring.Config("GoToBillingTransactionType=1"); // Customer recurring.SubscriptionName = "CustomerTest"; recurring.CreateSubscription(); string customerId = recurring.Response.SubscriptionId; recurring.Customer.State = "NC"; recurring.Customer.Phone = ""; recurring.UpdateSubscription(customerId);

Create an Account //Create an Account recurring.Gateway = RecurringbillingGateways.gwGoToBilling; //This is your 6 digit MID recurring.MerchantLogin = "123456"; //This is your 6 digit PIN recurring.MerchantPassword = "123456"; recurring.Config("GoToBillingTransactionType=2"); // 2 = Account recurring.Customer.Id = customerId; //Previously created customer recurring.CreateSubscription(); string accountId = recurring.Response.SubscriptionId;

Create a Recurring Transaction //Create a Recurring Transaction recurring.Gateway = RecurringbillingGateways.gwGoToBilling; //This is your 6 digit MID recurring.MerchantLogin = "123456"; //This is your 6 digit PIN recurring.MerchantPassword = "123456"; recurring.Config("GoToBillingTransactionType=0"); // 0 = Transaction recurring.Customer.Id = customerId; //Previously created customer recurring.TransactionId = accountId; //Previously created account recurring.PaymentSchedule.RecurAmount = "10.00"; recurring.PaymentSchedule.Frequency = "Monthly"; recurring.PaymentSchedule.TotalPayments = 12; recurring.CreateSubscription();

Back to Top

iTransact/NexCommerce

Create a subscription: Recurringbilling recurring = new Recurringbilling(); recurring.Gateway = RecurringbillingGateways.gwITransact; //vendor ID recurring.MerchantLogin = "12345"; recurring.MerchantPassword = ""; //No password required recurring.Card.CVVData = ""; recurring.Card.ExpMonth = 2; recurring.Card.ExpYear = 15; recurring.Card.Number = "5454545454545454"; recurring.Customer.Address = "1234 Nowhere Ln"; recurring.Customer.City = "Beverly Hills"; recurring.Customer.Country = "US"; recurring.Customer.Email = "nobody@server.com"; recurring.Customer.FirstName = "John"; recurring.Customer.Id = "CUSTOMER1"; recurring.Customer.LastName = "Smith"; recurring.Customer.Phone = "555-555-5555"; recurring.Customer.State = "CA"; recurring.Customer.Zip = "90210"; recurring.PaymentSchedule.RecurAmount = "10.00"; recurring.PaymentSchedule.Frequency = "monthly"; recurring.PaymentSchedule.TotalPayments = 12; recurring.CreateSubscription(); string subId = recurring.Response.SubscriptionId; Note: iTransact and NexCommerce use the same implementation.

Back to Top

Litle

Create a subscription: Recurringbilling recurring = new Recurringbilling(); recurring.Gateway = RecurringbillingGateways.gwLitle; recurring.GatewayURL = "https://prelive.litle.com/vap/communicator/online"; //Your Username recurring.MerchantLogin = "TestUser"; //Your Password recurring.MerchantPassword = "password"; //Your Merchant ID recurring.Config("MerchantCode=123456"); recurring.Card.Number = "4012002000060016"; recurring.Card.ExpMonth = 12; recurring.Card.ExpYear = 2025; recurring.Card.CVVData = "123"; recurring.Customer.Address = "123 Nowhere Ln."; recurring.Customer.Zip = "90210"; recurring.PaymentSchedule.InitialAmount = "100"; recurring.InvoiceNumber = "IN123456789"; recurring.AddSpecialField("id", "NS987654321"); recurring.Customer.Id = "Cust31"; recurring.TransactionId = "ANNUAL_PLAN"; recurring.PaymentSchedule.RecurAmount = "4000"; recurring.PaymentSchedule.TotalPayments = 6; recurring.PaymentSchedule.StartDate = DateTime.Now.AddDays(1).ToString("MM/dd/yyyy"); recurring.CreateSubscription(); string subId = recurring.Response.SubscriptionId;

Back to Top

Merchant Partners

Create a subscription: Recurringbilling recurring = new Recurringbilling(); recurring.Gateway = RecurringbillingGateways.gwMerchantPartners; //Merchant ID recurring.MerchantLogin = "DEMO1"; //Merchant PIN recurring.MerchantPassword = "cL68s0srQbrhcPrTnxe9H8NT4rCvKG7x"; //Merchant Sub ID recurring.AddSpecialField("subid", "00002"); recurring.Card.Number = "4003000123456781"; recurring.Card.ExpMonth = 12; recurring.Card.ExpYear = 15; recurring.Card.CVVData = "123"; recurring.Customer.FullName = "John Doe"; recurring.Customer.Address = "123 Nowhere Ln"; recurring.Customer.Zip = "90210"; recurring.Customer.Country = "840"; recurring.PaymentSchedule.RecurAmount = "10.00"; recurring.PaymentSchedule.Frequency = "2"; recurring.PaymentSchedule.TotalPayments = 12; recurring.CreateSubscription(); string subId = recurring.Response.SubscriptionId;

Back to Top

Moneris/Moneris USA

Create a subscription: //isUSA is a boolean value that determine whether to use the USA environment or the Canadian environment bool isUSA = true; Recurringbilling recurring = new Recurringbilling(); if (isUSA) { recurring.Gateway = RecurringbillingGateways.gwMonerisUSA; //Test URL recurring.GatewayURL = "https://esplusqa.moneris.com/gateway_us/servlet/MpgRequest"; //Your store_id recurring.MerchantLogin = "monusqa005"; //your api_token recurring.MerchantPassword = "qatoken"; } else { recurring.Gateway = RecurringbillingGateways.gwMoneris; //Test URL recurring.GatewayURL = "https://esqa.moneris.com/gateway2/servlet/MpgRequest"; //Your store_id recurring.MerchantLogin = "store5"; //your api_token recurring.MerchantPassword = "yesguy"; } recurring.Card.ExpMonth = 2; recurring.Card.ExpYear = 15; recurring.Card.Number = "5454545454545454"; recurring.Card.CVVPresence = CCCVVPresences.cvpNotProvided; recurring.InvoiceNumber = DateTime.Now.Ticks.ToString(); recurring.Customer.Id = "987654321"; recurring.AddSpecialField("start_now", "true"); recurring.PaymentSchedule.InitialAmount = "5.00"; recurring.PaymentSchedule.RecurAmount = "10.00"; //Test environment will not approve anything over $11.00 recurring.PaymentSchedule.FrequencyUnit = "month"; recurring.PaymentSchedule.Frequency = "1"; recurring.PaymentSchedule.TotalPayments = 12; recurring.PaymentSchedule.StartDate = DateTime.Now.AddDays(5).ToString("MM/dd/yyyy"); recurring.CreateSubscription(); string subId = recurring.Response.SubscriptionId;

Back to Top

MyVirtualMerchant

Create a subscription: Recurringbilling recurring = new Recurringbilling(); recurring.Gateway = RecurringbillingGateways.gwMyVirtualMerchant; //Merchant ID recurring.MerchantLogin = "123456"; //PIN recurring.MerchantPassword = "654321"; //User ID recurring.Config("MyVirtualMerchantUserId=123456"); recurring.Customer.FirstName = "John"; recurring.Customer.LastName = "Smith"; recurring.Customer.Address = "123 Nowhere Ln"; recurring.Customer.Zip = "90210"; recurring.Customer.City = "Beverly Hills"; recurring.Customer.State = "CA"; recurring.Customer.Country = "USA"; recurring.Customer.Email = "x@y.com"; recurring.Card.Number = "4111111111111111"; recurring.Card.ExpMonth = 1; recurring.Card.ExpYear = 15; recurring.Card.CVVData = "999"; recurring.TransactionId = "1234"; recurring.InvoiceNumber = "123456"; recurring.PaymentSchedule.RecurAmount = "10.00"; recurring.PaymentSchedule.Frequency = "MONTHLY"; recurring.PaymentSchedule.StartDate = "03/07/2014"; recurring.CreateSubscription(); string subId = recurring.Response.SubscriptionId;

Back to Top

NetworkMerchants/Payscape/TransNational/Verifi

Create a subscription: recurring.Gateway = RecurringbillingGateways.gwNetworkMerchants; //This is your username recurring.MerchantLogin = "demo"; //This is your password recurring.MerchantPassword = "password"; recurring.MerchantLogin = "demo"; recurring.MerchantPassword = "password"; recurring.Card.Number = "4111111111111111"; recurring.Card.ExpMonth = 12; recurring.Card.ExpYear = 17; recurring.Card.CVVData = "123"; recurring.Customer.Address = "123 Nowhere Ln"; recurring.Customer.Zip = "90210"; recurring.Customer.Country = "840"; recurring.SubscriptionName = "monthly"; recurring.CreateSubscription(); string subId = recurring.Response.SubscriptionId; Note: NetworkMerchants, Payscape, TransNational, and Verifi all use the same implementation.

Back to Top

Orbital

Create a subscription: Recurringbilling recurring = new Recurringbilling(); recurring.Gateway = RecurringbillingGateways.gwOrbital; recurring.GatewayURL = "https://orbitalvar1.paymentech.net/authorize"; //Your Merchant ID recurring.MerchantLogin = "123456789012"; //Your BIN number recurring.MerchantPassword = "000002"; recurring.Card.Number = "4012888888881"; recurring.Card.ExpMonth = 2; recurring.Card.ExpYear = 14; recurring.Card.CVVData = "123"; recurring.Customer.Address = "1234 Nowhere Ln"; recurring.Customer.Address2 = "Suite 123"; recurring.Customer.City = "Beverly Hills"; recurring.Customer.Country = "US"; recurring.Customer.Email = "nobody@server.com"; recurring.Customer.FirstName = "John"; recurring.Customer.Id = "CUSTOMER1"; recurring.Customer.LastName = "Smith"; recurring.Customer.Phone = "555-555-5555"; recurring.Customer.State = "CA"; recurring.Customer.Zip = "90210"; recurring.SubscriptionDesc = "Test Transaction"; recurring.PaymentSchedule.RecurAmount = "100"; recurring.PaymentSchedule.StartDate = "04/12/2014"; recurring.PaymentSchedule.TotalPayments = 12; recurring.PaymentSchedule.Frequency = "1 * ?"; recurring.CreateSubscription(); string subId = recurring.Response.SubscriptionId;

Back to Top

PayFlow Pro

Create a subscription: Recurringbilling recurring = new Recurringbilling(); recurring.Gateway = RecurringbillingGateways.gwPayFlowPro; recurring.GatewayURL = "https://pilot-payflowpro.paypal.com"; //test URL //Your Merchant ID recurring.MerchantLogin = "userid"; //Your Password recurring.MerchantPassword = "password"; //The ID of your PayPal Reseller recurring.AddSpecialField("PARTNER", "PayPal"); recurring.Card.ExpMonth = 2; recurring.Card.ExpYear = 15; recurring.Card.Number = "4222222222222"; recurring.SubscriptionName = "CustomerTest1"; recurring.PaymentSchedule.InitialAmount = "1.00"; recurring.PaymentSchedule.RecurAmount = "10.00"; recurring.PaymentSchedule.Frequency = "Monthly"; recurring.PaymentSchedule.TotalPayments = 12; recurring.PaymentSchedule.StartDate = DateTime.Now.AddDays(1).ToString("MM/dd/yyyy"); recurring.CreateSubscription(); string subId = recurring.Response.SubscriptionId;

Back to Top

Payments Gateway/ACH Payments

Create a subscription: Recurringbilling recurring = new Recurringbilling(); recurring.Gateway = RecurringbillingGateways.gwPaymentsGateway; recurring.GatewayURL = "https://www.paymentsgateway.net/cgi-bin/posttest.pl"; //Test URL //Your Merchant ID recurring.MerchantLogin = "123456"; //Your Password recurring.MerchantPassword = "abc123"; recurring.Card.Number = "4200000000000000"; recurring.Card.ExpMonth = 2; recurring.Card.ExpYear = 15; recurring.Customer.Address = "1234 Nowhere Ln"; recurring.Customer.City = "Beverly Hills"; recurring.Customer.Country = "US"; recurring.Customer.Email = "nobody@server.com"; recurring.Customer.FirstName = "John"; recurring.Customer.Id = "CUSTOMER1"; recurring.Customer.LastName = "Smith"; recurring.Customer.Phone = "555-555-5555"; recurring.Customer.State = "CA"; recurring.Customer.Zip = "90210"; recurring.InvoiceNumber = "123456789"; recurring.PaymentSchedule.InitialAmount = "1.00"; recurring.PaymentSchedule.Frequency = "Monthly"; recurring.PaymentSchedule.TotalPayments = 12; recurring.PaymentSchedule.RecurAmount = "10.00"; recurring.PaymentSchedule.StartDate = DateTime.Now.ToString("MM/dd/yyyy"); recurring.CreateSubscription(); string subId = recurring.Response.SubscriptionId;

Back to Top

PayTrace

Create a Customer Account: Recurringbilling recurring = new Recurringbilling(); recurring.Gateway = RecurringbillingGateways.gwPayTrace; recurring.GatewayURL = "https://paytrace.com/api/default.pay"; //Merchant ID recurring.MerchantLogin = "demo123"; //Password recurring.MerchantPassword = "demo123"; recurring.Card.Number = "4111111111111111"; recurring.Card.ExpMonth = 1; recurring.Card.ExpYear = 15; recurring.Card.CVVData = "999"; recurring.Timeout = 600; recurring.Customer.Address = "8320"; recurring.Customer.Zip = "85284"; recurring.Config("PayTraceTransactionType=0"); // 0 = Customer recurring.CreateSubscription(); string custId = recurring.Response.TransactionId;

Create a subscription: Recurringbilling recurring = new Recurringbilling(); recurring.Gateway = RecurringbillingGateways.gwPayTrace; recurring.GatewayURL = "https://paytrace.com/api/default.pay"; //Merchant ID recurring.MerchantLogin = "demo123"; //Password recurring.MerchantPassword = "demo123"; recurring.Card.Number = "4111111111111111"; recurring.Card.ExpMonth = 1; recurring.Card.ExpYear = 15; recurring.Card.CVVData = "999"; recurring.Timeout = 600; recurring.Customer.Address = "8320"; recurring.Customer.Zip = "85284"; recurring.Config("PayTraceTransactionType=1"); // 1 = Recurring Billing recurring.PaymentSchedule.RecurAmount = "10.00"; recurring.PaymentSchedule.Frequency = "1"; recurring.PaymentSchedule.StartDate = DateTime.Now.AddMonths(1).ToString("MM/dd/yyyy"); recurring.PaymentSchedule.TotalPayments = 12; recurring.TransactionId = custId; //Customer ID created above recurring.CreateSubscription(); string subId = recurring.Response.SubscriptionId;

Back to Top

PayWiser

Create a subscription: Recurringbilling recurring = new Recurringbilling(); string RecurringPlanId; string CardToken; recurring.Gateway = RecurringbillingGateways.gwPayWiser; recurring.GatewayURL = "https://gateway.paywiser.eu/PaymentGatewayTest/PayWiserPG/"; //This is your API Key recurring.MerchantLogin = "YourAPIKey"; // Create Recurring Plan recurring.Config("PayWiserRequestType=0"); //These are required fields recurring.SubscriptionDesc = "Test Monthly Recurring Plan"; recurring.AddSpecialField("StatementText", "Test"); recurring.AddSpecialField("StatementDescription", "Test Statement Description"); recurring.PaymentSchedule.Frequency = "Monthly"; recurring.PaymentSchedule.StartDate = DateTime.Now.AddDays(1).ToString("MM/dd/yyyy"); recurring.PaymentSchedule.TotalPayments = 10; recurring.AddSpecialField("IsRecurring", "false"); recurring.AddSpecialField("MaxRetryCount", "0"); recurring.Config("PayWiserPaymentHour=10"); recurring.AddSpecialField("RenewYearly", "false"); //This should be unique for each transaction recurring.TransactionId = "1111111"; try { recurring.CreateSubscription(); if (recurring.Response.Approved) { //Recurring Plan was created successfully RecurringPlanId = recurring.Response.SubscriptionId; Console.WriteLine("Recurring Plan Id: " + RecurringPlanId); } else { //There was an issue. throw new Exception(recurring.Response.ErrorText); } } catch (Exception ex) { Console.WriteLine("Request: " + recurring.Config("RawRequest")); Console.WriteLine("***************"); Console.WriteLine("Response: " + recurring.Response.Data); throw; } //Next Step is to Tokenize the Credit Card recurring.Config("PayWiserRequestType=1"); //This will generate a Token recurring.Customer.FirstName = "John"; recurring.Customer.LastName = "Smith"; recurring.Card.Number = "4788250000028291"; recurring.Card.ExpMonth = 12; recurring.Card.ExpYear = 18; recurring.Card.CVVData = "999"; //This should be unique for each transaction recurring.TransactionId = "1111112"; try { recurring.CreateSubscription(); if (recurring.Response.Approved) { //Token was created successfully CardToken = recurring.Config("PayWiserCardToken"); Console.WriteLine("Card Token: " + CardToken); } else { //There was an issue. throw new Exception(recurring.Response.ErrorText); } } catch (Exception ex) { Console.WriteLine("Request: " + recurring.Config("RawRequest")); Console.WriteLine("***************"); Console.WriteLine("Response: " + recurring.Response.Data); throw; } //Create Recurring Payment recurring.Config("PayWiserRequestType=2"); //This will start Recurring Payment recurring.Config("PayWiserCardToken=" + CardToken); recurring.Config("PayWiserRecurringPlanId=" + RecurringPlanId); recurring.PaymentSchedule.StartDate = recurring.PaymentSchedule.StartDate = DateTime.Now.AddDays(1).ToString("yyyy-MM-dd"); recurring.PaymentSchedule.TrialPayments = 1; recurring.PaymentSchedule.RecurAmount = "200"; recurring.AddSpecialField("AdjustPlanWithStartDate", "false"); //This should be unique for each transaction recurring.TransactionId = "1111113"; try { recurring.CreateSubscription(); if (recurring.Response.Approved) { //Recurring Payment was started successfully Console.WriteLine("Recurring Reference Id: " + recurring.TransactionId); } else { //There was an issue. throw new Exception(recurring.Response.ErrorText); } } catch (Exception ex) { Console.WriteLine("Request: " + recurring.Config("RawRequest")); Console.WriteLine("***************"); Console.WriteLine("Response: " + recurring.Response.Data); throw; }

PhoeniXGate

Create a subscription: Recurringbilling recurring = new Recurringbilling(); string profileId; string CCInfoID; string contractID; recurring.Gateway = RecurringbillingGateways.gwPhoeniXGate; //This is your UserName recurring.MerchantLogin = "UserName"; //This is your Password recurring.MerchantPassword = "Password"; //This is your Merchant ID recurring.Config("MerchantCode=YourMerchantID"); //This will create a Customer Profile. recurring.Config("PhoeniXGateRequestType=0"); recurring.Customer.FirstName = "John"; recurring.Customer.LastName = "Smith"; recurring.Customer.Id = "1001"; recurring.Customer.Address = "123 Main St"; recurring.Customer.City = "MyCity"; recurring.Customer.State = "NC"; recurring.Customer.Zip = "12345"; try { recurring.CreateSubscription(); if (recurring.Response.Approved) { //profile was created successfully profileId = recurring.Response.SubscriptionId; } else { //There was an issue. throw new Exception(recurring.Response.Text); } Console.WriteLine("Profile Id: " + profileId); } catch (Exception ex) { Console.WriteLine("Request: " + recurring.Config("RawRequest")); Console.WriteLine("***************"); Console.WriteLine("Response: " + recurring.Response.Data); throw ex; } //Add Credit Card information. recurring.Config("PhoeniXGateRequestType=1"); recurring.Config("PhoeniXGateCustomerKey=" + profileId); recurring.Card.Number = "4788250000028291"; recurring.Card.ExpMonth = 12; recurring.Card.ExpYear = 18; try { recurring.CreateSubscription(); if (recurring.Response.Approved) { // credit card profile was created successfully CCInfoID = recurring.Config("PhoenixGateCardInfoKey"); } else { //There was an issue. throw new Exception(recurring.Response.Text); } Console.WriteLine("Credit Card Profile : " + CCInfoID); } catch (Exception ex) { Console.WriteLine("Request: " + recurring.Config("RawRequest")); Console.WriteLine("***************"); Console.WriteLine("Response: " + recurring.Response.Data); throw ex; } //Create Payment Schedule //This will add a Payment Schedule information to an existing profile recurring.Config("PhoeniXGateRequestType=3"); recurring.Config("PhoeniXGateCustomerKey=" + profileId); //Default -- CC Payment Schedule recurring.Config("PhoeniXGatePaymentType=0"); //This is the CCInfoID here: recurring.Config("PhoeniXGateCardInfoKey=" + CCInfoID); //This is set by the merchant. recurring.Config("PhoeniXGateContractId=12345"); recurring.Customer.FirstName = "John";Pc recurring.Customer.LastName = "Smith"; recurring.Customer.Id = "1001"; recurring.Customer.Address = "123 Main St"; recurring.Customer.City = "MyCity"; recurring.Customer.State = "NC"; recurring.Customer.Zip = "12345"; recurring.PaymentSchedule.RecurAmount = "2.00"; recurring.PaymentSchedule.StartDate = DateTime.Now.AddDays(1).ToString("MM/dd/yyyy"); recurring.PaymentSchedule.EndDate = DateTime.Now.AddMonths(3).ToString("MM/dd/yyyy"); recurring.PaymentSchedule.FrequencyUnit = "Weekly"; recurring.Config("PhoeniXGateNextBillingDate=" + DateTime.Now.AddDays(2).ToString("MM/dd/yyyy")); try { recurring.CreateSubscription(); if (recurring.Response.Approved) { // payment schedule was created successfully contractID = recurring.Config("PhoenixGateContractKey"); } else { //There was an issue. throw new Exception(recurring.Response.Text); } Console.WriteLine("Contract ID : " + contractID); } catch (Exception ex) { Console.WriteLine("Request: " + recurring.Config("RawRequest")); Console.WriteLine("***************"); Console.WriteLine("Response: " + recurring.Response.Data); throw ex; }

Planet Payment

Create a subscription: Recurringbilling recurring = new Recurringbilling(); recurring.Gateway = RecurringbillingGateways.gwPlanetPayment; recurring.GatewayURL = "https://uap.txngw.com"; //Your Company Key recurring.MerchantLogin = "8990"; //your PIN recurring.MerchantPassword = "1234"; //Your terminal ID recurring.Config("TerminalId=6177"); recurring.Card.Number = "4000009999999991"; recurring.Card.ExpMonth = 2; recurring.Card.ExpYear = 17; recurring.Card.CVVData = "907"; recurring.Customer.FullName = "J.J.J. Smith"; recurring.Customer.FirstName = "John"; recurring.Customer.LastName = "Smith"; recurring.Customer.Address = "123 Nowhere Ln"; recurring.Customer.Zip = "90210"; recurring.Customer.City = "Beverly Hills"; recurring.Customer.State = "CA"; recurring.Customer.Country = "US"; recurring.Customer.Email = "x@y.com"; recurring.PaymentSchedule.RecurAmount = "10.00"; recurring.PaymentSchedule.FrequencyUnit = "MONTHLY"; recurring.PaymentSchedule.Frequency = "1"; recurring.PaymentSchedule.TotalPayments = 12; recurring.PaymentSchedule.StartDate = DateTime.Now.AddDays(2).ToString("MM/dd/yyyy"); recurring.Config("PlanetPaymentFrequencyDate=" + DateTime.Now.AddDays(2).Day.ToString()); recurring.CreateSubscription(); string subId = recurring.Response.SubscriptionId;

Back to Top

PlugNPay

Create a subscription: Recurringbilling recurring = new Recurringbilling(); recurring.Gateway = RecurringbillingGateways.gwPlugNPay; //Your Merchant ID recurring.MerchantLogin = "pnpdemo2"; //Your Password recurring.MerchantPassword = "55pnpdemo55"; recurring.Card.Number = "4111111111111111"; recurring.Card.ExpMonth = 2; recurring.Card.ExpYear = 15; recurring.Card.CVVData = ""; recurring.Customer.FirstName = "John"; recurring.Customer.LastName = "Smith"; recurring.Customer.Address = "1234 Nowhere Ln"; recurring.Customer.City = "Beverly Hills"; recurring.Customer.State = "CA"; recurring.Customer.Zip = "90210"; recurring.Customer.Phone = "555-555-5555"; recurring.Customer.Email = "nobody@server.com"; recurring.Customer.Id = "CUSTOMER1"; recurring.Customer.Country = "USA"; recurring.PaymentSchedule.RecurAmount = "10.00"; recurring.PaymentSchedule.TotalPayments = 12; recurring.PaymentSchedule.StartDate = "02/08/2014"; recurring.SubscriptionName = "testrecur1"; recurring.CreateSubscription(); string subId = recurring.Response.SubscriptionId;

Back to Top

QuickBooks Merchant Services (QBMS)

Create a wallet: Recurringbilling recurring = new Recurringbilling(); recurring.Gateway = RecurringbillingGateways.gwQBMS; recurring.GatewayURL = "https://merchantaccount.ptc.quickbooks.com/j/AppGateway"; //Your App Login recurring.MerchantLogin = "qbms_demo_april_2014.domain.com"; //Your Connection ID recurring.MerchantPassword = "connection_id"; recurring.Customer.Address = "123 Nowhere Ln."; recurring.Customer.Zip = "90210"; recurring.Customer.Id = "123456789"; recurring.Card.Number = "4111111111111111"; recurring.Card.ExpMonth = 12; recurring.Card.ExpYear = 2025; recurring.Card.CVVData = "123"; recurring.Config("QBMSTransactionType=0"); //Wallet recurring.CreateSubscription(); string walletId = recurring.Response.TransactionId;

Create a subscription: Recurringbilling recurring = new Recurringbilling(); recurring.Gateway = RecurringbillingGateways.gwQBMS; recurring.GatewayURL = "https://merchantaccount.ptc.quickbooks.com/j/AppGateway"; //Your App Login recurring.MerchantLogin = "qbms_demo_april_2014.domain.com"; //Your Connection ID recurring.MerchantPassword = "connection_id"; recurring.Customer.Address = "123 Nowhere Ln."; recurring.Customer.Zip = "90210"; recurring.Config("QBMSTransactionType=1"); //Scheduled Billing recurring.Customer.Id = "123456789"; recurring.TransactionId = walletId; //Wallet ID created above recurring.PaymentSchedule.RecurAmount = "10.00"; recurring.PaymentSchedule.StartDate = DateTime.Now.AddDays(2).ToString("MM/dd/yyyy"); recurring.PaymentSchedule.Frequency = "0 0 0 10 * ?"; recurring.CreateSubscription(); string subId = recurring.Response.SubscriptionId;

Back to Top

Repay

Create a subscription: Recurringbilling recurring = new Recurringbilling(); string profileId; string CCInfoID; string contractID; recurring.Gateway = RecurringbillingGateways.gwRepay; //This is your UserName recurring.MerchantLogin = "UserName"; //This is your Password recurring.MerchantPassword = "Password"; //This is your Merchant ID recurring.Config("MerchantCode=YourMerchantID"); //This will create a Customer Profile. recurring.Config("RepayRequestType=0"); recurring.Customer.FirstName = "John"; recurring.Customer.LastName = "Smith"; recurring.Customer.Id = "1001"; recurring.Customer.Address = "123 Main St"; recurring.Customer.City = "MyCity"; recurring.Customer.State = "NC"; recurring.Customer.Zip = "12345"; try { recurring.CreateSubscription(); if (recurring.Response.Approved) { //profile was created successfully profileId = recurring.Response.SubscriptionId; } else { //There was an issue. throw new Exception(recurring.Response.Text); } Console.WriteLine("Profile Id: " + profileId); } catch (Exception ex) { Console.WriteLine("Request: " + recurring.Config("RawRequest")); Console.WriteLine("***************"); Console.WriteLine("Response: " + recurring.Response.Data); throw ex; } //Add Credit Card information. recurring.Config("RepayRequestType=1"); recurring.Config("RepayCustomerKey=" + profileId); recurring.Card.Number = "4788250000028291"; recurring.Card.ExpMonth = 12; recurring.Card.ExpYear = 18; try { recurring.CreateSubscription(); if (recurring.Response.Approved) { // credit card profile was created successfully CCInfoID = recurring.Config("RepayCardInfoKey"); } else { //There was an issue. throw new Exception(recurring.Response.Text); } Console.WriteLine("Credit Card Profile : " + CCInfoID); } catch (Exception ex) { Console.WriteLine("Request: " + recurring.Config("RawRequest")); Console.WriteLine("***************"); Console.WriteLine("Response: " + recurring.Response.Data); throw ex; } //Create Payment Schedule //This will add a Payment Schedule information to an existing profile recurring.Config("RepayRequestType=3"); recurring.Config("RepayCustomerKey=" + profileId); //Default -- CC Payment Schedule recurring.Config("RepayPaymentType=0"); //This is the CCInfoID here: recurring.Config("RepayCardInfoKey=" + CCInfoID); //This is set by the merchant. recurring.Config("RepayContractId=12345"); recurring.Customer.FirstName = "John";Pc recurring.Customer.LastName = "Smith"; recurring.Customer.Id = "1001"; recurring.Customer.Address = "123 Main St"; recurring.Customer.City = "MyCity"; recurring.Customer.State = "NC"; recurring.Customer.Zip = "12345"; recurring.PaymentSchedule.RecurAmount = "2.00"; recurring.PaymentSchedule.StartDate = DateTime.Now.AddDays(1).ToString("MM/dd/yyyy"); recurring.PaymentSchedule.EndDate = DateTime.Now.AddMonths(3).ToString("MM/dd/yyyy"); recurring.PaymentSchedule.FrequencyUnit = "Weekly"; recurring.Config("RepayNextBillingDate=" + DateTime.Now.AddDays(2).ToString("MM/dd/yyyy")); try { recurring.CreateSubscription(); if (recurring.Response.Approved) { // payment schedule was created successfully contractID = recurring.Config("RepayContractKey"); } else { //There was an issue. throw new Exception(recurring.Response.Text); } Console.WriteLine("Contract ID : " + contractID); } catch (Exception ex) { Console.WriteLine("Request: " + recurring.Config("RawRequest")); Console.WriteLine("***************"); Console.WriteLine("Response: " + recurring.Response.Data); throw ex; }

SkipJack

Create a subscription: recurring.Gateway = RecurringbillingGateways.gwSkipjack; //This is your HTML Serial Number recurring.MerchantLogin = "000000000000"; //This is your Developer Serial Number recurring.Config("TerminalId=987654321098"); recurring.Card.Number = "4242424242424242"; recurring.Card.ExpMonth = 2; recurring.Card.ExpYear = 15; recurring.Customer.Address = "1234 Nowhere Ln"; recurring.Customer.City = "Beverly Hills"; recurring.Customer.Country = "US"; recurring.Customer.Email = "nobody@server.com"; recurring.Customer.FirstName = "John"; recurring.Customer.Id = "CUSTOMER1"; recurring.Customer.LastName = "Smith"; recurring.Customer.Phone = "555-555-5555"; recurring.Customer.State = "CA"; recurring.Customer.Zip = "90210"; recurring.InvoiceNumber = "12345"; recurring.PaymentSchedule.RecurAmount = "10.00"; recurring.PaymentSchedule.StartDate = DateTime.Now.AddDays(5).ToString("MM/dd/yyyy"); recurring.PaymentSchedule.Frequency = "3"; // 3 = Monthly recurring.PaymentSchedule.TotalPayments = 12; recurring.SubscriptionName = "Item1"; recurring.SubscriptionDesc = "Item1"; recurring.CreateSubscription(); string subId = recurring.Response.SubscriptionId;

Back to Top

TransFirst Classic (formerly PRIGate)

Create a subscription: recurring.Gateway = RecurringbillingGateways.gwPRIGate; //This is your merchant number (assigned by TransFirst) recurring.MerchantLogin = "12345678"; //This is your TransFirst Security Key recurring.MerchantPassword = "ABCDE12345"; recurring.Card.Number = "371449635392376"; recurring.Card.ExpMonth = 01; recurring.Card.ExpYear = 2015; recurring.Customer.Address = "123 Main"; recurring.Customer.Zip = "97229"; recurring.PaymentSchedule.RecurAmount = "1.00"; recurring.InvoiceNumber = DateTime.Now.Ticks.ToString(); recurring.SubscriptionDesc = "Test transaction"; recurring.PaymentSchedule.Frequency = "Monthly"; recurring.PaymentSchedule.TotalPayments = 12; recurring.PaymentSchedule.StartDate = DateTime.Now.ToString("MM/dd/yy"); recurring.CreateSubscription(); string subId = recurring.Response.SubscriptionId;

Back to Top

TransFirst (Transaction Central/Merchant Anywhere)

Create a subscription: recurring.Gateway = RecurringbillingGateways.gwTransactionCentral; //This is your account number (assigned by TransFirst) recurring.MerchantLogin = "00000"; //This is your password recurring.MerchantPassword = "ABCDE12345FGHIJ"; // This is the only card data that is valid for testing. It fails but allows you to verify parsing the request. recurring.Card.Number = "4111111111111111"; recurring.Card.ExpMonth = 01; recurring.Card.ExpYear = 2015; recurring.Card.CVVData = "999"; recurring.Customer.Address = "123 Main"; recurring.Customer.Zip = "97229"; recurring.PaymentSchedule.RecurAmount = random.Next(1, 100).ToString() + ".00"; recurring.InvoiceNumber = DateTime.Now.Ticks.ToString(); recurring.SubscriptionDesc = "Test transaction"; recurring.PaymentSchedule.Frequency = "M"; recurring.PaymentSchedule.TotalPayments = 12; recurring.PaymentSchedule.StartDate = DateTime.Now.ToString("MM/dd/yyyy"); recurring.CreateSubscription(); string subId = recurring.Response.SubscriptionId;

Back to Top

USA ePay

Create a subscription: recurring.Gateway = RecurringbillingGateways.gwUSAePay; //This is your UMKey/source key recurring.MerchantLogin = "_Fc5a9...1OR7A"; //MerchatPassword is not used recurring.MerchantPassword = ""; recurring.Card.EntryDataSource = EntryDataSources.edsManualEntryTrack1Capable; recurring.Card.Number = "4005562233445564"; recurring.Card.ExpMonth = 2; recurring.Card.ExpYear = 15; recurring.Card.CVVData = ""; recurring.Customer.FirstName = "John"; recurring.Customer.LastName = "Smith"; recurring.PaymentSchedule.Frequency = "monthly"; recurring.PaymentSchedule.TotalPayments = 12; recurring.PaymentSchedule.StartDate = DateTime.Now.AddDays(2).ToString("MM/dd/yyyy"); recurring.PaymentSchedule.RecurAmount = "9.99"; recurring.PaymentSchedule.InitialAmount = "10.00"; recurring.CreateSubscription();

Back to Top


We appreciate your feedback.  If you have any questions, comments, or suggestions about this entry please contact our support team at kb@nsoftware.com.

 
 
Downloads