/**
* NOTICE OF LICENSE
*
* This source file is subject to the Software License Agreement
* that is bundled with this package in the file LICENSE.txt.
*
* @author Peter Sliacky (Zelarg)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/* popup mode last tested on 15.4.2023 with stripe_official v3.0.2 */
checkoutPaymentParser.stripe_official_inline = {
all_hooks_content: function (content) {
},
container: function (element) {
//payment.setPopupPaymentType(element);
// Add logos to payment method
// Img path:
var stripe_base_url = '';
if ('undefined' !== typeof prestashop && 'undefined' !== prestashop.urls && 'undefined' !== prestashop.urls.base_url) {
stripe_base_url = prestashop.urls.base_url;
}
element.find('label').append('
');
},
form: function (element) {
// First, set the 'form' action to be our background confirmation button click
// On this background confirmation button, stripe action is hooked
let form = element.find('form');
let onSubmitAction = '$(\'#payment-confirmation button\').click();';
form.attr('action', 'javascript:void(0);');
form.attr('onsubmit', onSubmitAction);
// And now, let's put Stripe's form into static container, so that it's not being refreshed
var paymentOptionForm = element;
var staticContentContainer = $('#thecheckout-payment .static-content');
// Now create new block with original Id and place it inside of static-content block
if (!staticContentContainer.find('.stripe-payment-form').length) {
$('