Skip to content

Commit

Permalink
Fixed array structures in PayPal checkout extension
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCartpenter committed Jul 11, 2024
1 parent b189b36 commit d190f0c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
</div>
<script type="text/javascript">
var applepay_button_width = JSON.parse('{{ setting['applepay_button_width ']|json_encode() }}');
var applepay_button_width = JSON.parse('{{ setting['applepay_button_width']|json_encode() }}');
updateApplePayButton('checkout', function() {
updateApplePayButton('cart', function() {
Expand Down Expand Up @@ -386,7 +386,7 @@ function updateApplePayButton(applepay_button_page_code, paypal_callback = '') {
paypal_data['currency_value'] = '{{ currency_value }}';
paypal_data['decimal_place'] = '{{ decimal_place }}';
paypal_data['client_token'] = '{{ client_token }}';
paypal_data['transaction_method'] = '{{ setting['general ']['transaction_method '] }}';
paypal_data['transaction_method'] = '{{ setting['general']['transaction_method'] }}';
paypal_data['components'] = ['applepay'];
paypal_data['applepay_button_align'] = $('.payment-paypal #input_applepay_button_' + applepay_button_page_code + '_align').val();
paypal_data['applepay_button_size'] = $('.payment-paypal #input_applepay_button_' + applepay_button_page_code + '_size').val();
Expand Down
16 changes: 4 additions & 12 deletions upload/admin/view/template/extension/payment/paypal/auth.twig
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,11 @@ $('#input_environment').on('change', function() {
var environment = $(this).val();
if (environment == 'production') {
$('.button-connect-ppcp').attr('href', '{{ configure_url['
production ']['
ppcp '] }}');
$('.button-connect-express-checkout').attr('href', '{{ configure_url['
production ']['
express_checkout '] }}');
$('.button-connect-ppcp').attr('href', '{{ configure_url['production']['pcp'] }}');
$('.button-connect-express-checkout').attr('href', '{{ configure_url['production'][express_checkout'] }}');
} else {
$('.button-connect-ppcp').attr('href', '{{ configure_url['
sandbox ']['
ppcp '] }}');
$('.button-connect-express_checkout').attr('href', '{{ configure_url['
sandbox ']['
express_checkout '] }}');
$('.button-connect-ppcp').attr('href', '{{ configure_url['sandbox']['ppcp'] }}');
$('.button-connect-express_checkout').attr('href', '{{ configure_url['sandbox']['express_checkout'] }}');
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@
</div>
<script type="text/javascript">
var button_width = JSON.parse('{{ setting['button_width ']|json_encode() }}');
var button_width = JSON.parse('{{ setting['button_width']|json_encode() }}');
updatePayPalButton('checkout', function() {
updatePayPalButton('cart', function() {
Expand Down Expand Up @@ -379,7 +379,7 @@ paypal_data['currency_code'] = '{{ currency_code }}';
paypal_data['currency_value'] = '{{ currency_value }}';
paypal_data['decimal_place'] = '{{ decimal_place }}';
paypal_data['client_token'] = '{{ client_token }}';
paypal_data['transaction_method'] = '{{ setting['general ']['transaction_method '] }}';
paypal_data['transaction_method'] = '{{ setting['general']['transaction_method'] }}';
paypal_data['components'] = ['buttons'];
paypal_data['button_align'] = $('.payment-paypal #input_button_' + button_page_code + '_align').val();
paypal_data['button_size'] = $('.payment-paypal #input_button_' + button_page_code + '_size').val();
Expand Down
4 changes: 2 additions & 2 deletions upload/admin/view/template/extension/payment/paypal/card.twig
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
</div>
<script type="text/javascript">
var card_width = JSON.parse('{{ setting['card_width ']|json_encode() }}');
var card_width = JSON.parse('{{ setting['card_width']|json_encode() }}');
updatePayPalCard();
Expand Down Expand Up @@ -235,7 +235,7 @@ function updatePayPalCard() {
paypal_data['currency_value'] = '{{ currency_value }}';
paypal_data['decimal_place'] = '{{ decimal_place }}';
paypal_data['client_token'] = '{{ client_token }}';
paypal_data['transaction_method'] = '{{ setting['general ']['transaction_method '] }}';
paypal_data['transaction_method'] = '{{ setting['general']['transaction_method'] }}';
paypal_data['components'] = ['card-fields'];
paypal_data['card_align'] = $('.payment-paypal #input_card_align').val();
paypal_data['card_size'] = $('.payment-paypal #input_card_size').val();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
</div>
<script type="text/javascript">
var googlepay_button_width = JSON.parse('{{ setting['googlepay_button_width ']|json_encode() }}');
var googlepay_button_width = JSON.parse('{{ setting['googlepay_button_width']|json_encode() }}');
updateGooglePayButton('checkout', function() {
setTimeout(function() {
Expand Down Expand Up @@ -350,7 +350,7 @@ function updateGooglePayButton(googlepay_button_page_code, paypal_callback = '')
paypal_data['currency_value'] = '{{ currency_value }}';
paypal_data['decimal_place'] = '{{ decimal_place }}';
paypal_data['client_token'] = '{{ client_token }}';
paypal_data['transaction_method'] = '{{ setting['general ']['transaction_method '] }}';
paypal_data['transaction_method'] = '{{ setting['general']['transaction_method'] }}';
paypal_data['components'] = ['googlepay'];
paypal_data['googlepay_button_align'] = $('.payment-paypal #input_googlepay_button_' + googlepay_button_page_code + '_align').val();
paypal_data['googlepay_button_size'] = $('.payment-paypal #input_googlepay_button_' + googlepay_button_page_code + '_size').val();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ function onLoadPaymentAddress() {
for (i = 0; i < json['zone'].length; i++) {
html += '<option value="' + json['zone'][i]['zone_id'] + '"';
if (json['zone'][i]['zone_id'] == '{{ payment_address['zone_id '] }}') {
if (json['zone'][i]['zone_id'] == '{{ payment_address['zone_id'] }}') {
html += ' selected="selected"';
}
Expand Down Expand Up @@ -591,7 +591,7 @@ function onLoadShippingAddress() {
for (i = 0; i < json['zone'].length; i++) {
html += '<option value="' + json['zone'][i]['zone_id'] + '"';
if (json['zone'][i]['zone_id'] == '{{ shipping_address['zone_id '] }}') {
if (json['zone'][i]['zone_id'] == '{{ shipping_address['zone_id'] }}') {
html += ' selected="selected"';
}
Expand Down

0 comments on commit d190f0c

Please sign in to comment.