Merge pull request #11110 from ptibogxiv/patch-163

Fix JS for payment intent
This commit is contained in:
Laurent Destailleur 2019-05-04 12:12:59 +02:00 committed by GitHub
commit 8bb6bc326c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,8 @@
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2009-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2018 Juanjo Menent <jmenent@2byte.e>
* Copyright (C) 2018 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2018-2019 Thibault FOUCART <support@ptibogxiv.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -2006,16 +2007,13 @@ if (preg_match('/^dopayment/', $action))
payment_method_data: {
billing_details: {
name: cardholderName.value
<?php if (GETPOST('email', 'alpha')) { ?>, email: '<?php echo GETPOST('email', 'alpha'); ?>',<?php } ?>
<?php if (is_object($object) && is_object($object->thirdparty)) { ?>, phone: <?php echo $object->thirdparty->phone; ?>',<?php } ?>
<?php if (is_object($object) && is_object($object->thirdparty)) {
print ', address: {'."\n";
print ' city: '.$object->thirdparty->town.',';
print ' country: '.$object->thirdparty->country_code.',';
print ' line1: '.$object->thirdparty->address.',';
print ' postal_code: '.$object->thirdparty->zip;
print '}'."\n";
} ?>
<?php if (GETPOST('email', 'alpha')) { ?>, email: '<?php echo GETPOST('email', 'alpha'); ?>'<?php } ?>
<?php if (is_object($object) && is_object($object->thirdparty)) { ?>, phone: '<?php echo $object->thirdparty->phone; ?>'<?php } ?>
<?php if (is_object($object) && is_object($object->thirdparty)) { ?>, address: {
city: '<?php echo $object->thirdparty->town; ?>',
country: '<?php echo $object->thirdparty->country_code; ?>',
line1: '<?php echo $object->thirdparty->address; ?>',
postal_code: '<?php echo $object->thirdparty->zip; ?>'}<?php } ?>
} /* TODO Add all other known data like emails, ... to be SCA compliant */
},
save_payment_method: false