SFCC Cartridge
Testing
Alternative Payment Methods (Non-Credit Card) Tests
22 min
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 klarna below is an outline of recommended testing and mapping for each of payment method gift card orders gift card 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 validation api documentation the request should look something like function fortergiftcard(auth, gc) { // optional object for gift card purchases 	this merchantpaymentid = gc paymenttransaction transactionid; 	this value = {}; 	this value currency = auth currency code; 	this value amountusd = auth amount tostring(); 	this value amountlocalcurrency = auth amount tostring(); } gift card testing general test transaction place an order using a valid test gift card and any email address customer pays for entire order with gift card using the email address approve\@forter com customer pays for entire order with gift card using the email address decline\@forter com customer pays for entire order with gift card using the email address notreviewed\@forter com store credit 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 validation 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 } store credit testing general test transaction place an order using store credit and any email address customer pays for entire order with store credit using the email address approve\@forter com customer pays for entire order with store credit using the email address decline\@forter com customer pays for entire order with store credit using the email address notreviewed\@forter com loyalty points 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 validation api documentation the request should look something like function forterloyalty(auth, loyalty) { // optional object for purchases made with loyalty points 	this loyaltypointscount = sc paymenttransaction loyaltyvalue; // customized based on gateway 	this loyaltypointssource = account pointslocation; // optional 	this merchantpaymentid = auth loayltycode; // optional } loyalty points testing general test transaction place an order using loyalty points and any email address customer pays for entire order with store loyalty points using the email address approve\@forter com customer pays for entire order with store loyalty points using the email address decline\@forter com customer pays for entire order with store loyalty points using the email address notreviewed\@forter com applepay 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 withinpayment array in the validation api documentation the request should look something like function forterapplepay(auth, ap) { // 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 = ap creditcardholder; this cardbrand = ap creditcardtype; this token = ap token; this lastfourdigits = ap creditcardnumberlastdigits; //optional this expirationmonth = 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; } applepay testing general test transaction place an order using applepay and any email address customer pays for order using applepay and the email address approve\@forter com customer pays for order using applepay and the email address decline\@forter com customer pays for order using applepay and the email address notreviewed\@forter com digital wallets (e g amazonpay, metapay) digital wallet mapping 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 please send any of the above payment methods in the digitalwallet object and use one of the dedicated enums listed in our order v3 https //docs forter com/reference/order v3 documentation 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 } digital wallet testing general test transaction place an order using applicable digital wallet and any email address customer pays for order using amazonpay (or applicable digital wallet) and email address approve\@forter com customer pays for order using applicable digital wallet and email address decline\@forter com customer pays for order using applicable digital wallet and email notreviewed\@forter com afterpay afterpay mapping like amazonpay, afterpay orders use a installmentservice method object which is mostly freeform but should still be a dedicated object please send afterpay payment data in the generalpayment object as a payment instrument detail in the request function forteraffirm(auth) { // optional object for purchases made with affirm this name = "afterpay payment"; this payload= {}; // any additional raw response data } affirm testing general test transaction place an order using afterpay account and any email address customer pays for order using afterpay and email address approve\@forter com customer pays for order using afterpay and email address decline\@forter com customer pays for order using afterpay and email notreviewed\@forter com note that by default, afterpay payments will show as general payment method in the detailed transaction view and forter will not decision these transactions (i e return a not reviewed decision) afterpay typically provides its own coverage and fraud detection for payments with this method however, if you would like decisions on this payment method, please contact your onboarding analyst affirm affirm mapping affirm orders use a generalpayment method object which is mostly freeform but should still be a dedicated object please send affirm in the generalpayment object as a payment instrument detail in the request function forteraffirm(auth) { // optional object for purchases made with affirm this name = "affirm payment"; this payload= {}; // any additional raw response data } affirm testing general test transaction place an order using amazonpay account and any email address customer pays for order using amazonpay and email address approve\@forter com customer pays for order using amazonpay and email address decline\@forter com customer pays for order using amazonpay and email notreviewed\@forter com note that by default, affirm payments will show as general payment method in the detailed transaction view and 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 analyst shoprunner shoprunner mapping 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(); }