Tokenization with E-Payment Integrator

Which gateways supported by the E-Payment Integrator support tokenization?

Date Entered: 02/19/2014    Last Updated: 10/05/2017

As of the publishing of this article, the E-Payment Integrator currently supports tokenization with the following gateways: Please note that the sample code below does not represent a complete transaction, but the portion of the transaction required to use tokens in the transaction. You can read more about the Configuration settings used in the code below in the Help file.

Authorize.NET AIM XML API

Note: Authorize.Net can only process tokenized credit cards but can not generate a credit card token. Token must be issued by a certified token provider. For more information please contact the gateway directly. Icharge icharge = new Icharge(); icharge.Gateway = IchargeGateways.gwAuthorizeNetXML; icharge.GatewayURL = "https://apitest.authorize.net/xml/v1/request.api"; //This is your API Login ID icharge.MerchantLogin = "APILoginID"; //This is your Transaction Key icharge.MerchantPassword = "TransactionKey"; icharge.TransactionDesc = "Sale with Token Test"; icharge.TransactionAmount = "5.00"; icharge.InvoiceNumber = "12345"; icharge.TransactionId = "56789"; icharge.Config("AuthNetTokenizedCard=5424000000000015"); icharge.Config("AuthNetCryptogram=EjRWeJASNFZ4kBI0VniQEjRWeJA="); icharge.Card.ExpMonth = 12; icharge.Card.ExpYear = 2020; icharge.Sale();

Bank of America/FirstDataE4

//initial transaction using card data icharge.Sale(); //retrieve the token string transArmorToken = icharge.Config("FDMSTransArmorToken"); //send a transaction using token //(note that card type and expiry information are still required) icharge.Card.CardType = TCardTypes.ctVisa; icharge.Card.ExpMonth = 12; icharge.Card.ExpYear = 15; icharge.InvoiceNumber = "1234"; icharge.TransactionAmount = "1.00"; icharge.Config("FDMSTransArmorToken="+transArmorToken); icharge.Sale();

Heartland

//set the component to retrieve a constant token icharge.Config("HeartlandTokenMapping=2"); //initial transaction icharge.Sale(); //retrieve the token string heartlandToken = icharge.Config("HeartlandToken"); //send a transaction using the token icharge.Config("HeartlandTokenMapping=0"); icharge.Config("HeartlandToken="+heartlandToken); icharge.InvoiceNumber = DateTime.Now.ToString(timeFormat); icharge.TransactionAmount = "1.00"; icharge.Sale();

Global Payroll

Icharge icharge = new Icharge(); icharge.Gateway = IchargeGateways.gwGlobalPayroll; icharge.GatewayURL = "http://demo.gpgway.com/gateway/GPGCCProcess.aspx"; //This is your APIUsername icharge.MerchantLogin = "demo"; //This is your APIPassword icharge.MerchantPassword = "password"; //This is your Client ID icharge.AddSpecialField("ClientID", "1009"); icharge.Card.Number = "4111111111111111"; icharge.Config("GlobalPayrollCreateToken"); string token = icharge.Config("GlobalPayrollToken");

Orbital

//request the CustomerRefNum icharge.Config("OrbitalCustomerProfileFromOrderInd=A"); icharge.TransactionAmount = "100"; icharge.InvoiceNumber = "1234"; icharge.TransactionDesc = "Test Transaction"; icharge.Sale(); //retrieve the token string customerRefNum = icharge.Customer.Id; //send a transaction using the token icharge.Config("OrbitalCustomerProfileFormOrderInd=S"); icharge.Customer.Id = customerRefNum; icharge.TransactionAmount = "100"; icharge.InvoiceNumber = "1234"; icharge.TransactionDesc = "Test Token Transaction"; icharge.Sale();

PayWiser

Recurringbilling recurring = new Recurringbilling(); string CardToken; string TokenReferenceId; recurring.Gateway = RecurringbillingGateways.gwPayWiser; recurring.GatewayURL = "https://gateway.paywiser.eu/PaymentGatewayTest/PayWiserPG/"; //This is your API Key recurring.MerchantLogin = "YourAPIKey"; 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 = "1001"; try { recurring.CreateSubscription(); if (recurring.Response.Approved) { //Token was created successfully CardToken = recurring.Config("PayWiserCardToken"); TokenReferenceId = recurring.Config("PayWiserTokenReferenceId"); Console.WriteLine("Card Token: " + CardToken); Console.WriteLine("Token Reference Id: " + TokenReferenceId); } 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

// Note: A Customer Profile must be first created in order to generate a token. Recurringbilling recurring = new Recurringbilling(); string profileId; string token; 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; } //Generate a Token //This will generate a Token recurring.Config("PhoeniXGateRequestType=5"); recurring.Config("PhoeniXGateCustomerKey=" + profileId); recurring.Customer.Address = "123 Test St"; recurring.Customer.Zip = "12345"; recurring.Customer.FirstName = "John"; recurring.Customer.LastName = "Smith"; recurring.Card.Number = "4788250000028291"; recurring.Card.ExpMonth = 12; recurring.Card.ExpYear = 18; recurring.Config("PhoeniXGateTokenMode=1"); // Card Format Token try { recurring.CreateSubscription(); if (recurring.Response.Approved) { //token was generated successfully token = recurring.Config("PhoeniXGateToken"); } else { //There was an issue. throw new Exception(recurring.Response.Text); } Console.WriteLine("Token: " + token); } catch (Exception ex) { Console.WriteLine("Request: " + recurring.Config("RawRequest")); Console.WriteLine("***************"); Console.WriteLine("Response: " + recurring.Response.Data); throw ex; } //Process a transaction using the generated Token and the ICharge component Icharge icharge = new Icharge(); icharge.Gateway = IchargeGateways.gwPhoeniXGate; //This is your Username icharge.MerchantLogin = "Username"; //This is your password icharge.MerchantPassword = "Password"; icharge.Config("PhoeniXGateProcessTokenCredit=True"); icharge.Config("PhoeniXGateTokenMode=1"); icharge.Config("PhoeniXGateToken=" + token); icharge.TransactionAmount = "1.00"; icharge.Sale(); if (icharge.Response.Approved) { //Response is approved, log approval code etc. Console.WriteLine("Approved: " + icharge.Response.ApprovalCode); } else { throw new Exception(icharge.Response.Text + ":" + icharge.Response.ErrorText); }

Repay

// Note. A Customer Profile must be first created in order to generate a token. Recurringbilling recurring = new Recurringbilling(); string profileId; string token; 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; } //Generate a Token //This will generate a Token recurring.Config("RepayRequestType=5"); recurring.Config("RepayCustomerKey=" + profileId); recurring.Customer.Address = "123 Test St"; recurring.Customer.Zip = "12345"; recurring.Customer.FirstName = "John"; recurring.Customer.LastName = "Smith"; recurring.Card.Number = "4788250000028291"; recurring.Card.ExpMonth = 12; recurring.Card.ExpYear = 18; recurring.Config("RepayTokenMode=1"); // Card Format Token try { recurring.CreateSubscription(); if (recurring.Response.Approved) { //token was generated successfully token = recurring.Config("RepayToken"); } else { //There was an issue. throw new Exception(recurring.Response.Text); } Console.WriteLine("Token: " + token); } catch (Exception ex) { Console.WriteLine("Request: " + recurring.Config("RawRequest")); Console.WriteLine("***************"); Console.WriteLine("Response: " + recurring.Response.Data); throw ex; } //Process a transaction using the generated Token and the ICharge component Icharge icharge = new Icharge(); icharge.Gateway = IchargeGateways.gwRepay; //This is your Username icharge.MerchantLogin = "Username"; //This is your password icharge.MerchantPassword = "Password"; icharge.Config("RepayProcessTokenCredit=True"); icharge.Config("RepayTokenMode=1"); icharge.Config("RepayToken=" + token); icharge.TransactionAmount = "1.00"; icharge.Sale(); if (icharge.Response.Approved) { //Response is approved, log approval code etc. Console.WriteLine("Approved: " + icharge.Response.ApprovalCode); } else { throw new Exception(icharge.Response.Text + ":" + icharge.Response.ErrorText); }

SagePay

//NOTE: If AVS/CV2 is ON for your account, you will need to send CV2 // data with the transaction. You can bypass this restriction // if you call AddSpecialField("ApplyAVSCV2", "2") on the // component before submitting the transaction. //request the token icharge.TransactionAmount = "1.00"; icharge.TransactionDesc = "Token"; icharge.Config("SagePayRequestToken=True"); icharge.Config("SagePayStoreToken=True"); icharge.Sale(); //retrieving the token string token = icharge.Config("SagePayToken"); //using the token icharge.Config("SagePayToken=" + token); icharge.Config("SagePayRequestToken=False"); icharge.Config("SagePayStoreToken=True"); icharge.Sale();

Stripe

//The ICharge component can only be used to charge a transaction with a token that //is already generated via "Stripe.js" client side javascript library. Icharge icharge = new Icharge(); icharge.Gateway = IchargeGateways.gwStripe; //This your API Key icharge.MerchantLogin = "YOUR API KEY"; //Test Visa Token from https://stripe.com/docs/testing icharge.Config("CardToken=tok_visa"); icharge.TransactionAmount = "100"; //100 means $1.00 icharge.Sale();


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