Paypal In-context popup does not load content, then proceeds to full-page payment
I'm trying to use the In-context option without success.
The popup opens, lightbox style, seems to be trying to load for a few seconds but then redirects to the usual full page for Express.
I have read that this symptom can occur when the shop is not in the accepted country list, this is Spain so should be valid.
The source code on the payment confirmation page seems correct:
Quote:
<form onsubmit="submitonce();" id="checkout_confirmation" method="post" action="https://www.mysite.es/subdir/ipn_main_handler.php?type=ec&markflow=1&clearSess=1&stage=final" name="checkout_confirmation"><input type="hidden" value="7249fe1578a4fdfaf92fd07bcb427f38" name="securityToken"> <script>
window.paypalCheckoutReady = function () {
paypal.checkout.setup('my merchant id', {
//locale: 'en_US',
container: 'checkout_confirmation',
button: 'btn_submit'
});
};
</script>
<script async="" src="//www.paypalobjects.com/api/checkout.js"></script><div class="buttonRow forward"><button id="btn_submit" name="btn_submit_x" value="Confirm Order" type="submit" onmouseout="this.className='cssButton submit_button button button_confirm_order'" onmouseover="this.className='cssButtonHover button_confirm_order button_confirm_orderHover'" class="cssButton submit_button button button_confirm_order">Confirm Order</button></div>
</form>
Setting the PPDEBUG cookie from the console yields this info
Quote:
{"status":"IC_SETUP","button-type":"JS","button-number":1,"merchantSite":"www.my_website.es","version":"3.0","token":null,"guid" :"f46da875-5c2d-7b58-260d-0715581980e3","oneTouchShowed":"false","jsBtnConfig":[]}
iframe
{"status":"IC_HERMES_PREFETCH_COMPLETE","elapsed":1203,"merchantSite":"
www.my_website.es ","version":"3.0","token":null,"guid":"f46da875-5c2d-7b58-260d-0715581980e3","oneTouchShowed":"false","jsBtnConfig":[]}
I note that after cancelling the paypal page to return to the shop and trying again, the in-context code is NOT generated...?
Quote:
<form onsubmit="submitonce();" id="checkout_confirmation" method="post" action="https://www.motorvista.es/tienda_155/ipn_main_handler.php?type=ec&markflow=1&clearSess=1&stage=final" name="checkout_confirmation"><input type="hidden" value="7249fe1578a4fdfaf92fd07bcb427f38" name="securityToken"><div class="buttonRow forward"><button id="btn_submit" name="btn_submit_x" value="Confirm Order" type="submit" onmouseout="this.className='cssButton submit_button button button_confirm_order'" onmouseover="this.className='cssButtonHover button_confirm_order button_confirm_orderHover'" class="cssButton submit_button button button_confirm_order">Confirm Order</button></div>
</form>
Often I come across stuff that fails when in Spanish, but this is generated with shop language as English.
I've tried this with my in-development 155 shop and a vanilla 155 on my hosting with the same result.
Since there are few/no queries about this, I assume it usually works.
All I have done to enable this is add my merchant id. From what I can see in the code, that is all that is necessary.
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
I am experiencing this also. Setup correctly as far as I know on UK store, with merchant ID after going to Paypal settings as instructed. I could see sometimes it starts to open a lightbox then goes to full page version. But right now it seems to go straight to normal paypal full page version.
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
Is there anything noted in the console-log?
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
No errors, only the info stuff due to the debug cookie being set.
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
Since this was added in 1.55, I would assume the lack of a comment from a dev implies it all worked first time when implemented/they have not seen this issue.
I note that the js code for in-context is added into the page only on the first attempt, after the failure/subsequently it is not, and so goes straight to the full-page screen.
If I try again "some time later" the code does get inserted on the first attempt again. This seems to be a consequence of the problem, not the problem itself. I assume this is a Paypal-controlled thing?
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
Quote:
Originally Posted by
torvista
Since this was added in 1.55, I would assume the lack of a comment from a dev implies it all worked first time when implemented/they have not seen this issue.
I note that the js code for in-context is added into the page only on the first attempt, after the failure/subsequently it is not, and so goes straight to the full-page screen.
If I try again "some time later" the code does get inserted on the first attempt again. This seems to be a consequence of the problem, not the problem itself. I assume this is a Paypal-controlled thing?
They were having difficulty with reloading the applicable page to then cause/allow the javascript to reload, but I have seen it implemented on previous ZC versions outside of the changes made to support ZC 1.5.5 where 1) it continues to function, 2) does reload after a cancel operation, 3) is not going directly to the standard PP screen like is being seen on ZC 1.5.5.
Can't recall if the reload operation to provide the javascript again on cancellation required ZC code modification or was corrected by PP. Do know that one difference in application elsewhere as compared to how it was implemented in ZC 1.5.5 is that the PP variable SOLUTIONTYPE set to "sole" elsewhere was not modified to Mark. Not able at the moment to test whether that is related to this issue or not.
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
I just tested a newly upgraded 1.5.5a version and the popup does not display on it either, it just goes over to the paypal screen.
The Paypal Merchant ID is entered because I know it is required for this function to work. All other credentials are correct as well.
:please:
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
Following @torvista's approach, I set the PPDEBUG cookie in the FireFox console and also clicked the "Persist" button so that any transitional issues would also be reported. What I was "rewarded with" was the following additional console-log that might shed some light on the issue:
Code:
{"status":"IC_DESTROY_NO_CANCEL_RETURN_URL","merchantSite":"mysite.com","version":"3.0","token":null,"guid":"a2aea560-b928-84ad-8604-fc98812b05d2","oneTouchShowed":"false","jsBtnConfig":[]}
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
I was just asking another Zen Cart expert about this and she said we needed PayPal's AJAX. I am not a coder, so have no stinking clue what that means... but here is what I found on PayPal site
Quote:
Manual or AJAX Integrations
In certain use cases, you may want to manually initiate the checkout experience, such as, if you are calling the APIs with AJAX from the browser or from a Flash application. This can be done using the click setting, and manually calling paypal.checkout.initXO, paypal.checkout.startFlow, and paypal.checkout.closeFlow. See the following example:
paypal.checkout.setup('Your-Merchant-ID', {
environment: 'sandbox',
container: 'myContainer',
click: function () {
paypal.checkout.initXO();
var action = $.post('/set-express-checkout');
action.done(function (data) {
paypal.checkout.startFlow(data.token);
});
action.fail(function () {
paypal.checkout.closeFlow();
});
}
});
Re: Paypal In-context popup does not load content, then proceeds to full-page payment
I'm also testing this as well and the popup does not display for me, it goes straight to paypal's full screen checkout.