View Single Post
  #3  
Old 06-30-2016, 12:26 AM
 
akinyeleolubodun akinyeleolubodun is offline
 

Newbie
  
Join Date: Jun 2016
Posts: 4
 

Default Re: Popup custom payment module is posting and redirecting

Thanks for your reply qualiteam. I have gone through the source codes and code not really make headway.

Here is the flow...

1. I add the payment plugin js to the checkout page (Working)
2. Build some data on the template (Working, find below sample code)
Code:
<div id="kpay-pay-component" style="display: none;"></div> <script src="{getScriptInstance()}"></script> <script> new KongaPay({ merchantId: "{getMerchantId()}", merchantName: "{getMerchantName()}", callBack: "{getCallbackUrl()}", amount: "{getItemsTotal()}", transactionReference: "{getTransactionReference()}", buttonSize: 300, description : "{getDescription()}" }); </script>

3. When the payment gateway loads the JS, it displays a button to be clicked in
Quote:
<div id="kpay-pay-component" style="display: none;"></div>

4. I hide the element so that when the user clicks the "Place Order" button on checkout, it clicks the button displayed by the payment gateway dynamically. (Worked well)

5. When the payment gateway popup comes up, it doesn't stay...other process happens and the page is being redirected.

Quote:
As far as I see you use a different JS code than Stripe module, so it may be the cause.

Yes it is not Stripe's code, I strip it down to the barest minimum because it contains code that are not conforming to my payment gateway flow.

I suppose the
Code:
state.state = false;
in the JS would stop the page from reloading but I was wrong. Maybe I am not initiating the right bind event.
__________________
5.2.8
Reply With Quote