Show the Authorization decline message

While trying to pay an invoice through the portal using a credit card with an incorrect CVV code, the payment is completed without notifying the user about the incorrect payment. 

When checking the payment details in NetSuite, it shows the status as “Unapproved Payment.”.

We can notify the user when an incorrect payment occurs due to incorrect CVV by displaying an error message to the user so they are aware that something went wrong with the payment. 

When a payment is made, we retrieve the status of the payment from the PaymentWizard.Module.Confirmation view, which is accessed using the following model: get('confirmation').status.internalid.

If the status is equal to “Unapproved Payment,” we will display an authorization decline message. Otherwise, the default “Thank you” message will be shown.

_.extend(PaymentWizardModuleConfirmation.prototype, {

						template: jj_payment_wizard_confirmation_module_tpl,

						getContext: _.wrap(PaymentWizardModuleConfirmation.prototype.getContext, function getContext(fn) {

							var context = fn.apply(this, _.toArray(arguments).slice(1));

							console.log("context______", context);

							console.log("this________", this);

							var statusPay =  this.model.get('confirmation').status.internalid;

							if (statusPay === "Unapproved Payment"){

                                context.statusPay = true;

							}else{

								context.statusPay = false;

							}

							return context;

						})

					});

Leave a comment

Your email address will not be published. Required fields are marked *