SFCC Cartridge
...
Checkout
Alternative Payments
14 min
alternative (non credit card) payment methods non credit card orders non credit card orders include any alternative payment methods that can be used to pay partially or fully for an order including gift card store credit loyalty points applepay amazonpay afterpay affirm shoprunner below is an outline of recommended mapping for each of payment method if you had these alternate payments it should be added as logic on payment level to identify each payment method after each payment method is identified, you can reference the relevant function to generate the data needed to map to the correct payment method object gift card orders mapping in order for our servers to correctly identify gift card orders, please send gift card as a payment instrument detail in the request there should be a dedicated giftcard object payment array in the order api https //docs forter com/reference/order v3 the request should look something like function fortergiftcard(auth, giftcard) { // optional object for gift card purchases 	this merchantpaymentid = giftcard paymenttransaction transactionid; 	this value = {}; 	this value currency = auth currency code; 	this value amountusd = auth amount tostring(); 	this value amountlocalcurrency = auth amount tostring(); } store credit mapping store credit orders use an object identical to the gift card object formatting, please send store credit as a payment instrument detail in the request there should be a dedicated giftcard object payment array in the order api documentation the request should look something like function forterstorecredit(auth, sc) { // optional object for purchases made with store credit 	this merchantpaymentid = sc paymenttransaction transactionid; // customized based on gateway 	this value = {}; 	this value currency = auth currency code; // customized based on gateway 	this value amountusd = auth amount tostring(); // customized based on gateway 	this value amountlocalcurrency = auth amount tostring(); // customized based on gateway } loyalty points mapping store credit orders use an object identical to the gift card object formatting, please send store credit as a payment instrument detail in the request there should be a dedicated giftcard object payment array in the order api documentation the request should look something like function forterloyalty(auth, loyalty) { // optional object for purchases made with loyalty points 	this loyaltypointscount = parseint(loyalty loyaltyvalue); // customized based on gateway 	this loyaltypointssource = loyalty pointslocation; // optional 	this merchantpaymentid = auth loyaltycode; // optional } applepay mapping applepay orders should map to a dedicated applepay object in the request that is built from the forterorder ds file the applepay object should be nested within the payment array and include the available authorization response data that you receive on the paymentinstrument see the below example for reference "applepay" { "nameoncard" "matthew botbyl", "cardbrand" "visa", "token" "46c5176abx", "lastfourdigits" "7125", "expirationmonth" "12", "expirationyear" "2025", "cardtype" "credit", "countryofissuance" "us", "cardbank" "chase bank", "fingerprint" "rvh8ryvbatrrti1w", "verificationresults" { "cvvresultcode" "pass", "avsstreetresult" "m", "authorizationcode" "38671pn7x", "processorresponsecode" "100", "processorresponsetext" "payment complete " }, "paymentgatewaydata" { "gatewayname" "stripe", "gatewaytransactionid" "ch gcue5iok5jbmtg" } } order ds applepay mapping applepay orders leverage a tokenized card object please send applepay orders as a payment instrument detail in the request there should be a dedicated applepay object within the payment array in the validation api documentation mapping the applepay information within the request may be structured similar to the following with customized logic based on the response data that you receive from your payment gateway example function forterapplepay(auth, apple) { // where var ap is the raw applepay response data from your payment gateway // format the expiration month from 1 to 01, etc if (apple expirationmonth tostring() length == 1) { var appleexpmonth = "0" + apple payment expirationmonth tostring(); } else { var appleexpmonth = apple payment expirationmonth tostring(); // to do adjust to data available } this nameoncard = apple creditcardholder; //name on card if available in auth this cardbrand = apple creditcardtype; // todo adjust to your payment gateway this token = apple token; this lastfourdigits = apple creditcardnumberlastdigits; //optional this expirationmonth = appleexpmonth; // todo adjust to your payment gateway this expirationyear = apple payment expirationyear tostring(); // todo adjust to your payment gateway this verificationresults = {}; this verificationresults avsfullresult = auth avs tostring(); // optional this verificationresults cvvresult = auth cvd code tostring(); // optional this verificationresults authorizationcode = auth authorization num tostring(); 	processorresponsecode = auth exact resp code tostring(); // todo adjust to your payment gateway 	processorresponsetext = auth exact message tostring(); // todo adjust to your payment gateway this verificationresults processorresponsecode = processorresponsecode; // todo adjust to your payment gateway this verificationresults processorresponsetext = processorresponsetext; // todo adjust to your payment gateway } digital wallets (e g amazonpay, metapay) digital wallets (amazonpay, metapay) the digital wallet object includes any of the following payment methods amazonpay alipay facebookpay metapay zelle wechat pay mercado pago unionpay payco ame digital kakaopay line pay naverpay mb way these orders use a digitalwallet method object please send any of the above payment methods in the digitalwallet object and use one of the dedicated enums listed in our orders api documentation https //docs forter com/reference/order v3 sample digital wallet mapping function forterdigitalwallet(auth) { this digitalwalletname = "amazonpay"; // select "amazonpay" enum this underlyingpaymentmethod underlyingpaymentmethodname = "creditcard"; // select from relevant enum unknown, creditcard, banktransfer, cash, bitcoin this paymentsuccessstatus = "completed"; // gateway auth response this digitalwalletpayeremail = "john s\@test com"; // email associated with digital wallet this fulldigitalwalletresponsepayload = {}; // full response payload from digital wallet gateway } afterpay afterpay mapping afterpay orders can use the `installmentservice` payment method object that includes fields for the customer's name, the affirm gateway transaction identifier, the raw response payload, and any authorization response data you may receive from your gateway "installmentservice" { "servicename" "afterpay payment", "firstname" "nerri", "lastname" "shelan", "serviceresponsecode" "200", "paymentid" "aftasasdvvg", "fullresponsepayload" {} }, sample function function forterafterpay(auth) { // optional object for purchases made with affirm this servicename = "afterpay payment"; // can be hardcoded this firstname = ""; //optional this lastname = ""; // optional this paymentid = auth transaction data code; // unique identifier from afterpay this serviceresponsecode = auth processorresponse tostring(); this fullresponsepayload = auth; // any additional raw response data as an object } note that by default, forter will not decision afterpay, affirm and any installmentservice payments (i e return a not reviewed decision) if you would like decisions on this payment method or any installmentservice payment types, please contact your onboarding team to enable decisioning for this payment method affirm affirm mapping affirm orders use the installmentservice payment method object that includes fields for the customer's name, the affirm gateway transaction identifier, the raw response payload, and any authorization response data you may receive from your gateway function forteraffirm(auth, order) { // optional object for purchases made with affirm this servicename = "affirm"; // can be hardcoded for all affirm payments this firstname = order customer profile firstname; this lastname = order customer profile lastname; this serviceresponsecode = auth responsemessage; this paymentid = auth gatewaytransactionid; this payload = {}; // any additional raw response data } sample affirm object (installmentservice) affirm payments should map to the `installmentservice` object within the `payment` array depending on the data you have available for each order paid with affirm, fields such as `firstname`, `lastname` and `serviceresponsecode` can be made optional "installmentservice" { "servicename" "affirm", "firstname" "guy", "lastname" "zucker", "serviceresponsecode" "200", "paymentid" "ytz8jamenawrrvvg", "fullresponsepayload" {} }, in the forter portal, affirm payments will show as installmentservice in the detailed transaction view and by default forter will not decision these transactions (i e return a not reviewed decision) if you would like decisions on this payment method, please contact your onboarding team to enable this payment method shoprunner shoprunner orders can leverage either the existing creditcard object or tokenizedcard object depending on the authorization data you have available, these should be mapped to either the tokenizedcard or creditcard payment instrument detail in the request the below example request uses the tokenizedcard mapping function shoprunner(auth, cc) { // where var ap is the raw applepay response data from your payment gateway var processorresponsecode = "", processorresponsetext = ""; // format the expiration month from 1 to 01, etc if (ap creditcardexpirationmonth tostring() length == 1) { var creditcardexpmonth = "0" + cc creditcardexpirationmonth tostring(); } else { var creditcardexpmonth = cc creditcardexpirationmonth tostring(); } this nameoncard = cc creditcardholder; this cardbrand = cc creditcardtype; this token = cc token; this lastfourdigits = cc creditcardnumberlastdigits; this expirationmonth = cc creditcardexpmonth; this expirationyear = cc creditcardexpirationyear tostring(); this verificationresults = {}; this verificationresults avsfullresult = auth avs tostring(); // optional this verificationresults cvvresult = auth cvd code tostring(); // optional this verificationresults authorizationcode = auth authorization num tostring(); 	processorresponsecode = auth exact resp code tostring(); processorresponsetext = auth exact message tostring(); this verificationresults processorresponsecode = processorresponsecode; this verificationresults processorresponsetext = processorresponsetext; this paymentgatewaydata = {}; this paymentgatewaydata gatewayname = "firstdata credit"; // adjust based on your processor this paymentgatewaydata gatewaytransactionid = auth retrieval ref no tostring(); }