WooCommerce PayPal Express Checkout Payment Gateway - Version 1.6.21

Version Description

  • 2020-04-14 =
  • Fix - Ensure Puerto Rico and supported Locales are eligible for PayPal Credit. PR#693
  • Fix - Support purchasing subscriptions with $0 initial payment - free trials, synced etc. PR#698
  • Fix - Only make the billing fields optional during an active PayPal Checkout session. PR#697
  • Fix - Uncaught JS errors on product page when viewing and out-of-stock product. PR#704
  • Fix - Loading API certificates and improves managing certificate settings. PR#696
  • Fix - Displaying PayPal Smart Payment buttons on pages with single product shortcode. PR#665
  • Fix - Do not add discounts to total item amount and cause line item amount offset. PR#677
  • Fix - Redirect to Confirm your PayPal Order page for subscriptions initial purchases using PayPal Smart Buttons. PR#702
  • Fix - Display missing checkout notice when email format is incorrect. PR#708
  • Add - Filter product form validity via a new wc_ppec_validate_product_form event. PR#695
  • Add - Translation tables for states of more countries. PR#659
  • Update - WooCommerce 4.0 compatibility
Download this release

Release Info

Developer woothemes
Plugin Icon 128x128 WooCommerce PayPal Express Checkout Payment Gateway
Version 1.6.21
Comparing to
See all releases

Code changes from version 1.6.20 to 1.6.21

assets/js/wc-gateway-ppec-generate-cart.js CHANGED
@@ -43,7 +43,9 @@
43
  };
44
 
45
  var validate_form = function() {
46
- fields_valid = form.get( 0 ).checkValidity();
 
 
47
  update_button();
48
  };
49
 
@@ -67,7 +69,10 @@
67
  // Hack: IE11 uses the previous field value for the checkValidity() check if it's called in the onChange handler
68
  setTimeout( validate_form, 0 );
69
  } );
70
- validate_form();
 
 
 
71
 
72
  var generate_cart = function( callback ) {
73
  var data = {
43
  };
44
 
45
  var validate_form = function() {
46
+ // Check fields are valid and allow third parties to attach their own validation checks
47
+ fields_valid = form.get( 0 ).checkValidity() && $( document ).triggerHandler( 'wc_ppec_validate_product_form', [ fields_valid, form ] ) !== false;
48
+
49
  update_button();
50
  };
51
 
69
  // Hack: IE11 uses the previous field value for the checkValidity() check if it's called in the onChange handler
70
  setTimeout( validate_form, 0 );
71
  } );
72
+
73
+ $( document ).ready(function() {
74
+ validate_form();
75
+ } );
76
 
77
  var generate_cart = function( callback ) {
78
  var data = {
assets/js/wc-gateway-ppec-settings.js CHANGED
@@ -9,6 +9,23 @@
9
 
10
  $( 'button.image_remove' )
11
  .on( 'click', this.removeProductImage );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  },
13
 
14
  onClickUploadButton: function( event ) {
@@ -76,6 +93,54 @@
76
  $button.hide();
77
  $field.siblings( 'button.image_upload' ).show();
78
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  };
80
 
81
  function getAttachmentUrl( attachment ) {
9
 
10
  $( 'button.image_remove' )
11
  .on( 'click', this.removeProductImage );
12
+
13
+ $( '.wc_ppec_remove_certificate' )
14
+ .on( 'click', this.removeCertificate );
15
+
16
+ $( '#woocommerce_ppec_paypal_sandbox_api_signature, #woocommerce_ppec_paypal_api_signature' )
17
+ .on( 'change', this.handleCertificateDisplay );
18
+
19
+ $( '#woocommerce_ppec_paypal_sandbox_api_certificate, #woocommerce_ppec_paypal_api_certificate' )
20
+ .on( 'change', this.handleSignatureDisplay );
21
+
22
+ $( 'body' ).on( 'wc_ppec_cert_changed', this.handleSignatureDisplayFor );
23
+
24
+ // Trigger the signature and cert display handlers on init.
25
+ $( 'body' ).trigger( 'wc_ppec_cert_changed', [ 'sandbox' ] );
26
+ $( 'body' ).trigger( 'wc_ppec_cert_changed', [ 'live' ] );
27
+ $( '#woocommerce_ppec_paypal_sandbox_api_signature' ).trigger( 'change' );
28
+ $( '#woocommerce_ppec_paypal_api_signature' ).trigger( 'change' );
29
  },
30
 
31
  onClickUploadButton: function( event ) {
93
  $button.hide();
94
  $field.siblings( 'button.image_upload' ).show();
95
  },
96
+
97
+ removeCertificate: function( event ) {
98
+ event.preventDefault();
99
+ var environment = $( event.target ).data( 'environment' );
100
+
101
+ // Add a hidden element that will trigger the cert to be deleted on save.
102
+ $( event.target ).parent( '.description' ).append( '<input name="woocommerce_ppec_delete_' + environment + '_api_certificate" type="hidden" value="true">' );
103
+ $( event.target ).parent( '.description' ).fadeOut();
104
+ $( 'body' ).trigger( 'wc_ppec_cert_changed', [ environment ] );
105
+ },
106
+
107
+ handleCertificateDisplay: function( event ) {
108
+ var is_sandbox = $( event.target ).attr( 'id' ).search( 'sandbox' ) !== -1;
109
+ var signature = $( event.target ).val();
110
+ var cert_selector = is_sandbox ? '#woocommerce_ppec_paypal_sandbox_api_certificate' : '#woocommerce_ppec_paypal_api_certificate';
111
+
112
+ if ( signature ) {
113
+ $( cert_selector ).closest( 'tr' ).fadeOut();
114
+ } else {
115
+ $( cert_selector ).closest( 'tr' ).fadeIn();
116
+ }
117
+ },
118
+
119
+ handleSignatureDisplay: function( event ) {
120
+ var is_sandbox = $( event.target ).attr( 'id' ).search( 'sandbox' ) !== -1;
121
+ $( 'body' ).trigger( 'wc_ppec_cert_changed', [ is_sandbox ? 'sandbox' : 'live' ] );
122
+ },
123
+
124
+ handleSignatureDisplayFor: function( event, environment ) {
125
+ var certificate_upload_input = environment === 'sandbox' ? $( '#woocommerce_ppec_paypal_sandbox_api_certificate' )[0] : $( '#woocommerce_ppec_paypal_api_certificate' )[0];
126
+
127
+ if ( ! certificate_upload_input ) {
128
+ return;
129
+ }
130
+
131
+ var uploaded_new_cert = certificate_upload_input.files.length > 0;
132
+ var delete_cert_element_name = 'woocommerce_ppec_delete_' + environment + '_api_certificate';
133
+ var cert_removed = $( '.description > input[name="' + delete_cert_element_name + '"]' ).length > 0;
134
+ var has_existing_cert = $( certificate_upload_input ).clone().prop( {type:'text'} ).val() !== ''; // We need to clone the file input, turn it into a text field to retrieve the stored value.
135
+ var signature_selector = environment === 'sandbox' ? '#woocommerce_ppec_paypal_sandbox_api_signature' : '#woocommerce_ppec_paypal_api_signature';
136
+
137
+ // If we have an existing cert which hasn't been removed or the user has uploaded a new cert, hide the signature.
138
+ if ( ( has_existing_cert && ! cert_removed ) || uploaded_new_cert ) {
139
+ $( signature_selector ).closest( 'tr' ).fadeOut();
140
+ } else {
141
+ $( signature_selector ).closest( 'tr' ).fadeIn();
142
+ }
143
+ }
144
  };
145
 
146
  function getAttachmentUrl( attachment ) {
assets/js/wc-gateway-ppec-smart-payment-buttons.js CHANGED
@@ -62,8 +62,8 @@
62
  var selector = isMiniCart ? '#woo_pp_ec_button_mini_cart' : '#woo_pp_ec_button_' + wc_ppec_context.page;
63
  var fromCheckout = 'checkout' === wc_ppec_context.page && ! isMiniCart;
64
 
65
- // Don't render if already rendered in DOM.
66
- if ( $( selector ).children().length ) {
67
  return;
68
  }
69
 
@@ -122,11 +122,16 @@
122
  body: data,
123
  } ).then( function( response ) {
124
  if ( ! response.success ) {
125
- var messageItems = response.data.messages.map( function( message ) {
126
- return '<li>' + message + '</li>';
127
- } ).join( '' );
128
-
129
- showError( '<ul class="woocommerce-error" role="alert">' + messageItems + '</ul>', selector );
 
 
 
 
 
130
  return null;
131
  }
132
  return response.data.token;
@@ -167,5 +172,4 @@
167
  render( true );
168
  }
169
  } );
170
-
171
  } )( jQuery, window, document );
62
  var selector = isMiniCart ? '#woo_pp_ec_button_mini_cart' : '#woo_pp_ec_button_' + wc_ppec_context.page;
63
  var fromCheckout = 'checkout' === wc_ppec_context.page && ! isMiniCart;
64
 
65
+ // Don't render if selector doesn't exist or is already rendered in DOM.
66
+ if ( ! $( selector ).length || $( selector ).children().length ) {
67
  return;
68
  }
69
 
122
  body: data,
123
  } ).then( function( response ) {
124
  if ( ! response.success ) {
125
+ // Error messages may be preformatted in which case response structure will differ
126
+ var messages = response.data ? response.data.messages : response.messages;
127
+ if ( 'string' === typeof messages ) {
128
+ showError( messages );
129
+ } else {
130
+ var messageItems = messages.map( function( message ) {
131
+ return '<li>' + message + '</li>';
132
+ } ).join( '' );
133
+ showError( '<ul class="woocommerce-error" role="alert">' + messageItems + '</ul>', selector );
134
+ }
135
  return null;
136
  }
137
  return response.data.token;
172
  render( true );
173
  }
174
  } );
 
175
  } )( jQuery, window, document );
changelog.txt CHANGED
@@ -1,5 +1,19 @@
1
  *** Changelog ***
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  = 1.6.20 - 2020-02-18 =
4
  * Fix - Upgrade the plugin on plugins loaded rather than on plugin init. PR#682
5
 
1
  *** Changelog ***
2
 
3
+ = 1.6.21 - 2020-04-14 =
4
+ * Fix - Ensure Puerto Rico and supported Locales are eligible for PayPal Credit. PR#693
5
+ * Fix - Support purchasing subscriptions with $0 initial payment - free trials, synced etc. PR#698
6
+ * Fix - Only make the billing fields optional during an active PayPal Checkout session. PR#697
7
+ * Fix - Uncaught JS errors on product page when viewing and out-of-stock product. PR#704
8
+ * Fix - Loading API certificates and improves managing certificate settings. PR#696
9
+ * Fix - Displaying PayPal Smart Payment buttons on pages with single product shortcode. PR#665
10
+ * Fix - Do not add discounts to total item amount and cause line item amount offset. PR#677
11
+ * Fix - Redirect to Confirm your PayPal Order page for subscriptions initial purchases using PayPal Smart Buttons. PR#702
12
+ * Fix - Display missing checkout notice when email format is incorrect. PR#708
13
+ * Add - Filter product form validity via a new `wc_ppec_validate_product_form` event. PR#695
14
+ * Add - Translation tables for states of more countries. PR#659
15
+ * Update - WooCommerce 4.0 compatibility
16
+
17
  = 1.6.20 - 2020-02-18 =
18
  * Fix - Upgrade the plugin on plugins loaded rather than on plugin init. PR#682
19
 
includes/abstracts/abstract-wc-gateway-ppec.php CHANGED
@@ -95,7 +95,12 @@ abstract class WC_Gateway_PPEC extends WC_Payment_Gateway {
95
  // Image upload.
96
  wp_enqueue_media();
97
 
98
- wp_enqueue_script( 'wc-gateway-ppec-settings', wc_gateway_ppec()->plugin_url . 'assets/js/wc-gateway-ppec-settings.js', array( 'jquery' ), wc_gateway_ppec()->version, true );
 
 
 
 
 
99
  }
100
 
101
  /**
@@ -140,8 +145,12 @@ abstract class WC_Gateway_PPEC extends WC_Payment_Gateway {
140
  $checkout->create_billing_agreement( $order, $checkout_details );
141
  }
142
 
143
- // Complete the payment now.
144
- $checkout->do_payment( $order, $session->token, $session->payer_id );
 
 
 
 
145
 
146
  // Clear Cart
147
  WC()->cart->empty_cart();
@@ -190,32 +199,32 @@ abstract class WC_Gateway_PPEC extends WC_Payment_Gateway {
190
  return __( 'No API certificate on file.', 'woocommerce-gateway-paypal-express-checkout' );
191
  }
192
 
193
- $cert = @openssl_x509_read( $cert_string ); // @codingStandardsIgnoreLine
194
- $out = '';
 
195
 
196
- if ( false !== $cert ) {
197
- $certinfo = openssl_x509_parse( $cert );
198
- if ( false !== $certinfo ) {
199
- $valid_until = $certinfo['validTo_time_t'];
200
- if ( $valid_until < time() ) {
201
- // Display in red if the cert is already expired
202
- $expires = '<span style="color: red;">' . __( 'expired on %s', 'woocommerce-gateway-paypal-express-checkout' ) . '</span>';
203
- } elseif ( $valid_until < ( time() - 2592000 ) ) {
204
- // Also display in red if the cert is going to expire in the next 30 days
205
- $expires = '<span style="color: red;">' . __( 'expires on %s', 'woocommerce-gateway-paypal-express-checkout' ) . '</span>';
206
- } else {
207
- // Otherwise just display a normal message
208
- $expires = __( 'expires on %s', 'woocommerce-gateway-paypal-express-checkout' );
209
- }
210
 
211
- $expires = sprintf( $expires, date_i18n( get_option( 'date_format' ), $valid_until ) );
212
- $out = sprintf( __( 'Certificate belongs to API username %1$s; %2$s', 'woocommerce-gateway-paypal-express-checkout' ), $certinfo['subject']['CN'], $expires );
213
- } else {
214
- $out = __( 'The certificate on file is not valid.', 'woocommerce-gateway-paypal-express-checkout' );
 
 
215
  }
 
 
 
 
 
 
 
 
216
  }
217
 
218
- return $out;
219
  }
220
 
221
  /**
@@ -231,6 +240,9 @@ abstract class WC_Gateway_PPEC extends WC_Payment_Gateway {
231
  $_POST['woocommerce_ppec_paypal_api_certificate'] = base64_encode( file_get_contents( $_FILES['woocommerce_ppec_paypal_api_certificate']['tmp_name'] ) );
232
  unlink( $_FILES['woocommerce_ppec_paypal_api_certificate']['tmp_name'] );
233
  unset( $_FILES['woocommerce_ppec_paypal_api_certificate'] );
 
 
 
234
  } else {
235
  $_POST['woocommerce_ppec_paypal_api_certificate'] = $this->get_option( 'api_certificate' );
236
  }
@@ -243,6 +255,9 @@ abstract class WC_Gateway_PPEC extends WC_Payment_Gateway {
243
  $_POST['woocommerce_ppec_paypal_sandbox_api_certificate'] = base64_encode( file_get_contents( $_FILES['woocommerce_ppec_paypal_sandbox_api_certificate']['tmp_name'] ) );
244
  unlink( $_FILES['woocommerce_ppec_paypal_sandbox_api_certificate']['tmp_name'] );
245
  unset( $_FILES['woocommerce_ppec_paypal_sandbox_api_certificate'] );
 
 
 
246
  } else {
247
  $_POST['woocommerce_ppec_paypal_sandbox_api_certificate'] = $this->get_option( 'sandbox_api_certificate' );
248
  }
@@ -576,4 +591,32 @@ abstract class WC_Gateway_PPEC extends WC_Payment_Gateway {
576
 
577
  return ob_get_clean();
578
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
579
  }
95
  // Image upload.
96
  wp_enqueue_media();
97
 
98
+ $screen = get_current_screen();
99
+
100
+ // Only enqueue the setting scripts on the PayPal Checkout settings screen.
101
+ if ( $screen && 'woocommerce_page_wc-settings' === $screen->id && isset( $_GET['tab'], $_GET['section'] ) && 'checkout' === $_GET['tab'] && 'ppec_paypal' === $_GET['section'] ) {
102
+ wp_enqueue_script( 'wc-gateway-ppec-settings', wc_gateway_ppec()->plugin_url . 'assets/js/wc-gateway-ppec-settings.js', array( 'jquery' ), wc_gateway_ppec()->version, true );
103
+ }
104
  }
105
 
106
  /**
145
  $checkout->create_billing_agreement( $order, $checkout_details );
146
  }
147
 
148
+ // Complete the payment now if there's an amount to process.
149
+ if ( $order->get_total() > 0 ) {
150
+ $checkout->do_payment( $order, $session->token, $session->payer_id );
151
+ } else {
152
+ $order->payment_complete();
153
+ }
154
 
155
  // Clear Cart
156
  WC()->cart->empty_cart();
199
  return __( 'No API certificate on file.', 'woocommerce-gateway-paypal-express-checkout' );
200
  }
201
 
202
+ $cert = @openssl_x509_read( $cert_string ); // @codingStandardsIgnoreLine
203
+ $cert_info = $cert ? openssl_x509_parse( $cert ) : null;
204
+ $output = '';
205
 
206
+ if ( $cert_info ) {
207
+ $valid_until = $cert_info['validTo_time_t'];
208
+ $expires = __( 'expires on %s (%s)', 'woocommerce-gateway-paypal-express-checkout' );
 
 
 
 
 
 
 
 
 
 
 
209
 
210
+ if ( $valid_until < time() ) {
211
+ // Display in red if the cert is already expired
212
+ $expires = '<span style="color: red;">' . __( 'expired on %s (%s)', 'woocommerce-gateway-paypal-express-checkout' ) . '</span>';
213
+ } elseif ( $valid_until < ( time() - ( 30 * DAY_IN_SECONDS ) ) ) {
214
+ // Also display in red if the cert is going to expire in the next 30 days
215
+ $expires = '<span style="color: red;">' . $expires . '</span>';
216
  }
217
+
218
+ $expiry_date = new WC_DateTime( "@{$valid_until}", new DateTimeZone( 'UTC' ) );
219
+ $expiry_date->setTimezone( wp_timezone() );
220
+
221
+ $expires = sprintf( $expires, date_i18n( get_option( 'date_format' ), $expiry_date->getTimestamp() + $expiry_date->getOffset() ), $expiry_date->format( 'T' ) );
222
+ $output = sprintf( __( 'Certificate belongs to API username %1$s; %2$s.', 'woocommerce-gateway-paypal-express-checkout' ), $cert_info['subject']['CN'], $expires );
223
+ } else {
224
+ $output = __( 'The certificate on file is not valid.', 'woocommerce-gateway-paypal-express-checkout' );
225
  }
226
 
227
+ return $output;
228
  }
229
 
230
  /**
240
  $_POST['woocommerce_ppec_paypal_api_certificate'] = base64_encode( file_get_contents( $_FILES['woocommerce_ppec_paypal_api_certificate']['tmp_name'] ) );
241
  unlink( $_FILES['woocommerce_ppec_paypal_api_certificate']['tmp_name'] );
242
  unset( $_FILES['woocommerce_ppec_paypal_api_certificate'] );
243
+ } elseif ( isset( $_POST['woocommerce_ppec_delete_live_api_certificate'] ) ) {
244
+ $_POST['woocommerce_ppec_paypal_api_certificate'] = '';
245
+ unset( $_POST['woocommerce_ppec_delete_live_api_certificate'] );
246
  } else {
247
  $_POST['woocommerce_ppec_paypal_api_certificate'] = $this->get_option( 'api_certificate' );
248
  }
255
  $_POST['woocommerce_ppec_paypal_sandbox_api_certificate'] = base64_encode( file_get_contents( $_FILES['woocommerce_ppec_paypal_sandbox_api_certificate']['tmp_name'] ) );
256
  unlink( $_FILES['woocommerce_ppec_paypal_sandbox_api_certificate']['tmp_name'] );
257
  unset( $_FILES['woocommerce_ppec_paypal_sandbox_api_certificate'] );
258
+ } elseif ( isset( $_POST['woocommerce_ppec_delete_sandbox_api_certificate'] ) ) {
259
+ $_POST['woocommerce_ppec_paypal_sandbox_api_certificate'] = '';
260
+ unset( $_POST['woocommerce_ppec_delete_sandbox_api_certificate'] );
261
  } else {
262
  $_POST['woocommerce_ppec_paypal_sandbox_api_certificate'] = $this->get_option( 'sandbox_api_certificate' );
263
  }
591
 
592
  return ob_get_clean();
593
  }
594
+
595
+ /**
596
+ * Gets the description for an environment's certificate setting.
597
+ *
598
+ * Includes information about the certificate on file and remove link.
599
+ *
600
+ * @param string $environment The environment. Optional. Can be 'live' or 'sandbox'. Default is 'live'.
601
+ * @return string The HTML string for an environment's certificate including a remove link if one is on file.
602
+ */
603
+ private function get_certificate_setting_description( $environment = 'live' ) {
604
+ if ( 'live' === $environment ) {
605
+ $credentials = wc_gateway_ppec()->settings->get_live_api_credentials();
606
+ } else {
607
+ $credentials = wc_gateway_ppec()->settings->get_sandbox_api_credentials();
608
+ }
609
+
610
+ // If we don't have a certificate credential return the empty certificate info.
611
+ if ( ! is_callable( array( $credentials, 'get_certificate' ) ) ) {
612
+ return $this->get_certificate_info( '' );
613
+ }
614
+
615
+ return sprintf(
616
+ '%1$s <a href="#" class="wc_ppec_remove_certificate" data-environment="%2$s">%3$s</a>',
617
+ $this->get_certificate_info( $credentials->get_certificate() ),
618
+ esc_attr( $environment ),
619
+ __( 'Remove', 'woocommerce-gateway-paypal-express-checkout' )
620
+ );
621
+ }
622
  }
includes/class-wc-gateway-ppec-address.php CHANGED
@@ -357,84 +357,32 @@ class PayPal_Address {
357
 
358
  $translation_table = array();
359
 
360
- if ( 'US' == $this->_country ) {
361
  $translation_table = array(
362
- 'alabama' => 'AL',
363
- 'alaska' => 'AK',
364
- 'arizona' => 'AZ',
365
- 'arkansas' => 'AR',
366
- 'california' => 'CA',
367
- 'colorado' => 'CO',
368
- 'connecticut' => 'CT',
369
- 'deleware' => 'DE',
370
- 'district of columbia (washington, d.c.)' => 'DC',
371
- // The next several derivations don't show up in the list, but seem obvious
372
- 'district of columbia' => 'DC',
373
- 'washington, d.c.' => 'DC',
374
- 'washington d.c.' => 'DC',
375
- 'washington, dc' => 'DC',
376
- 'washington dc' => 'DC',
377
- 'washington, d. c.' => 'DC',
378
- 'washington d. c.' => 'DC',
379
- 'washington, d c' => 'DC',
380
- 'washington d c' => 'DC',
381
- 'florida' => 'FL',
382
- 'georgia' => 'GA',
383
- 'hawaii' => 'HI',
384
- 'idaho' => 'ID',
385
- 'illinois' => 'IL',
386
- 'indiana' => 'IN',
387
- 'iowa' => 'IA',
388
- 'kansas' => 'KS',
389
- 'kentucky' => 'KY',
390
- 'louisiana' => 'LA',
391
- 'maine' => 'ME',
392
- 'maryland' => 'MD',
393
- 'massachusetts' => 'MA',
394
- 'michigan' => 'MI',
395
- 'minnesota' => 'MN',
396
- 'mississippi' => 'MS',
397
- 'missouri' => 'MO',
398
- 'montana' => 'MT',
399
- 'nebraska' => 'NE',
400
- 'nevada' => 'NV',
401
- 'new hampshire' => 'NH',
402
- 'new jersey' => 'NJ',
403
- 'new mexico' => 'NM',
404
- 'new jersey' => 'NJ',
405
- 'new mexico' => 'NM',
406
- 'new york' => 'NY',
407
- 'north carolina' => 'NC',
408
- 'north dakota' => 'ND',
409
- 'ohio' => 'OH',
410
- 'oklahoma' => 'OK',
411
- 'oregon' => 'OR',
412
- 'pennsylvania' => 'PA',
413
- 'puerto rico' => 'PR',
414
- 'rhode island' => 'RI',
415
- 'south carolina' => 'SC',
416
- 'south dakota' => 'SD',
417
- 'tennessee' => 'TN',
418
- 'texas' => 'TX',
419
- 'utah' => 'UT',
420
- 'vermont' => 'VT',
421
- 'virginia' => 'VA',
422
- 'washington' => 'WA',
423
- 'west virginia' => 'WV',
424
- 'wisconsin' => 'WI',
425
- 'wyoming' => 'WY',
426
- 'armed forces americas' => 'AA',
427
- 'armed forces' => 'AE',
428
- 'armed forces pacific' => 'AP',
429
- 'american samoa' => 'AS',
430
- 'guam' => 'GU',
431
- 'northern mariana islands' => 'MP',
432
- 'virgin islands' => 'VI',
433
- // The next few derivations don't show up on the list, but seem obvious
434
- 'us virgin islands' => 'VI',
435
- 'u.s. virgin islands' => 'VI',
436
- 'u s virgin islands' => 'VI',
437
- 'u. s. virgin islands' => 'VI'
438
  );
439
  } elseif ( 'CA' == $this->_country ) {
440
  $translation_table = array(
@@ -454,6 +402,226 @@ class PayPal_Address {
454
  // This derivation doesn't show up on the list, but seems obvious
455
  'yukon territory' => 'YT'
456
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
457
  } elseif ( 'IT' == $this->_country ) {
458
  $translation_table = array(
459
  'agrigento' => 'AG',
@@ -566,6 +734,92 @@ class PayPal_Address {
566
  'vicenza' => 'VI',
567
  'viterbo' => 'VT'
568
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
569
  } elseif ( 'NL' == $this->_country ) {
570
  $translation_table = array(
571
  'drenthe' => 'DR',
@@ -581,58 +835,165 @@ class PayPal_Address {
581
  'zeeland' => 'ZE',
582
  'zuid-holland' => 'ZH'
583
  );
584
- } elseif ( 'IE' == $this->_country ) {
585
  $translation_table = array(
586
- 'co clare' => 'CE',
587
- 'co cork' => 'CK',
588
- 'co cavan' => 'CN',
589
- 'co carlow' => 'CW',
590
- 'co donegal' => 'DL',
591
- // All of these should be mapped to Dublin start
592
- 'co dublin' => 'DN',
593
- 'dublin 1' => 'DN',
594
- 'dublin 2' => 'DN',
595
- 'dublin 3' => 'DN',
596
- 'dublin 4' => 'DN',
597
- 'dublin 5' => 'DN',
598
- 'dublin 6' => 'DN',
599
- 'dublin 6w' => 'DN',
600
- 'dublin 7' => 'DN',
601
- 'dublin 8' => 'DN',
602
- 'dublin 9' => 'DN',
603
- 'dublin 10' => 'DN',
604
- 'dublin 11' => 'DN',
605
- 'dublin 12' => 'DN',
606
- 'dublin 13' => 'DN',
607
- 'dublin 14' => 'DN',
608
- 'dublin 15' => 'DN',
609
- 'dublin 16' => 'DN',
610
- 'dublin 17' => 'DN',
611
- 'dublin 18' => 'DN',
612
- 'dublin 20' => 'DN',
613
- 'dublin 22' => 'DN',
614
- 'dublin 24' => 'DN',
615
- // All of these should be mapped to Dublin end
616
- 'co galway' => 'GY',
617
- 'co kildare' => 'KE',
618
- 'co kilkenny' => 'KK',
619
- 'co kerry' => 'KY',
620
- 'co longford' => 'LD',
621
- 'co louth' => 'LH',
622
- 'co limerick' => 'LK',
623
- 'co leitrim' => 'LM',
624
- 'co laois' => 'LS',
625
- 'co meath' => 'MH',
626
- 'co monaghan' => 'MN',
627
- 'co mayo' => 'MO',
628
- 'co offaly' => 'OY',
629
- 'co roscommon' => 'RN',
630
- 'co sligo' => 'SO',
631
- 'co tipperary' => 'TY',
632
- 'co waterford' => 'WD',
633
- 'co westmeath' => 'WH',
634
- 'co wicklow' => 'WW',
635
- 'co wexford' => 'WX',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
636
  );
637
  }
638
 
357
 
358
  $translation_table = array();
359
 
360
+ if ( 'AR' == $this->_country ) {
361
  $translation_table = array(
362
+ 'ciudad autónoma de buenos aires' => 'C',
363
+ 'buenos aires' => 'B',
364
+ 'catamarca' => 'K',
365
+ 'chaco' => 'H',
366
+ 'chubut' => 'U',
367
+ 'corrientes' => 'W',
368
+ 'córdoba' => 'X',
369
+ 'entre ríos' => 'E',
370
+ 'formosa' => 'P',
371
+ 'jujuy' => 'Y',
372
+ 'la pampa' => 'L',
373
+ 'la rioja' => 'F',
374
+ 'mendoza' => 'M',
375
+ 'misiones' => 'N',
376
+ 'neuquén' => 'Q',
377
+ 'río negro' => 'R',
378
+ 'salta' => 'A',
379
+ 'san juan' => 'J',
380
+ 'san luis' => 'D',
381
+ 'santa cruz' => 'Z',
382
+ 'santa fe' => 'S',
383
+ 'santiago del estero' => 'G',
384
+ 'tierra del fuego' => 'V',
385
+ 'tucumán' => 'T',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
386
  );
387
  } elseif ( 'CA' == $this->_country ) {
388
  $translation_table = array(
402
  // This derivation doesn't show up on the list, but seems obvious
403
  'yukon territory' => 'YT'
404
  );
405
+ } elseif ( 'CN' == $this->_country ) {
406
+ $translation_table = array(
407
+ 'cn-yn' => 'CN1',
408
+ 'cn-bj' => 'CN2',
409
+ 'cn-tj' => 'CN3',
410
+ 'cn-he' => 'CN4',
411
+ 'cn-sx' => 'CN5',
412
+ 'cn-nm' => 'CN6',
413
+ 'cn-ln' => 'CN7',
414
+ 'cn-jl' => 'CN8',
415
+ 'cn-hl' => 'CN9',
416
+ 'cn-sh' => 'CN10',
417
+ 'cn-js' => 'CN11',
418
+ 'cn-zj' => 'CN12',
419
+ 'cn-ah' => 'CN13',
420
+ 'cn-fj' => 'CN14',
421
+ 'cn-jx' => 'CN15',
422
+ 'cn-sd' => 'CN16',
423
+ 'cn-ha' => 'CN17',
424
+ 'cn-hb' => 'CN18',
425
+ 'cn-hn' => 'CN19',
426
+ 'cn-gd' => 'CN20',
427
+ 'cn-gx' => 'CN21',
428
+ 'cn-hi' => 'CN22',
429
+ 'cn-cq' => 'CN23',
430
+ 'cn-sc' => 'CN24',
431
+ 'cn-gz' => 'CN25',
432
+ 'cn-sn' => 'CN26',
433
+ 'cn-gs' => 'CN27',
434
+ 'cn-qh' => 'CN28',
435
+ 'cn-nx' => 'CN29',
436
+ 'cn-mo' => 'CN30',
437
+ 'cn-xz' => 'CN31',
438
+ 'cn-xj' => 'CN32',
439
+ );
440
+ } elseif ( 'ES' == $this->_country ) {
441
+ $translation_table = array(
442
+ 'a coruÑa' =>'C',
443
+ 'araba/Álava' =>'VI',
444
+ 'albacete' =>'AB',
445
+ 'alicante' =>'A' ,
446
+ 'almerÍa' =>'AL',
447
+ 'asturias' =>'O' ,
448
+ 'Ávila' =>'AV',
449
+ 'badajoz' =>'BA',
450
+ 'baleares' =>'PM',
451
+ 'barcelona' =>'B' ,
452
+ 'burgos' =>'BU',
453
+ 'cÁceres' =>'CC',
454
+ 'cÁdiz' =>'CA',
455
+ 'cantabria' =>'S' ,
456
+ 'castellÓn' =>'CS',
457
+ 'ceuta' =>'CE',
458
+ 'ciudad real' =>'CR',
459
+ 'cÓrdoba' =>'CO',
460
+ 'cuenca' =>'CU',
461
+ 'girona' =>'GI',
462
+ 'granada' =>'GR',
463
+ 'guadalajara' =>'GU',
464
+ 'gipuzkoa' =>'SS',
465
+ 'huelva' =>'H' ,
466
+ 'huesca' =>'HU',
467
+ 'jaÉn' =>'J',
468
+ 'la rioja' =>'LO',
469
+ 'las palmas' =>'GC',
470
+ 'leÓn' =>'LE',
471
+ 'lleida' =>'L' ,
472
+ 'lugo' =>'LU',
473
+ 'madrid' =>'M' ,
474
+ 'mÁlaga' =>'MA',
475
+ 'melilla' =>'ML',
476
+ 'murcia' =>'MU',
477
+ 'navarra' =>'NA',
478
+ 'ourense' =>'OR',
479
+ 'palencia' =>'P' ,
480
+ 'pontevedra' =>'PO',
481
+ 'salamanca' =>'SA',
482
+ 'santa cruz de tenerife' =>'TF',
483
+ 'segovia' =>'SG',
484
+ 'sevilla' =>'SE',
485
+ 'soria' =>'SO',
486
+ 'tarragona' =>'T' ,
487
+ 'teruel' =>'TE',
488
+ 'toledo' =>'TO',
489
+ 'valencia' =>'V' ,
490
+ 'valladolid' =>'VA',
491
+ 'bizkaia' =>'BI',
492
+ 'zamora' =>'ZA',
493
+ 'zaragoza' =>'Z' ,
494
+ );
495
+ } elseif ( 'IE' == $this->_country ) {
496
+ $translation_table = array(
497
+ 'co clare' => 'CE',
498
+ 'co cork' => 'CK',
499
+ 'co cavan' => 'CN',
500
+ 'co carlow' => 'CW',
501
+ 'co donegal' => 'DL',
502
+ // All of these should be mapped to Dublin start
503
+ 'co dublin' => 'DN',
504
+ 'dublin 1' => 'DN',
505
+ 'dublin 2' => 'DN',
506
+ 'dublin 3' => 'DN',
507
+ 'dublin 4' => 'DN',
508
+ 'dublin 5' => 'DN',
509
+ 'dublin 6' => 'DN',
510
+ 'dublin 6w' => 'DN',
511
+ 'dublin 7' => 'DN',
512
+ 'dublin 8' => 'DN',
513
+ 'dublin 9' => 'DN',
514
+ 'dublin 10' => 'DN',
515
+ 'dublin 11' => 'DN',
516
+ 'dublin 12' => 'DN',
517
+ 'dublin 13' => 'DN',
518
+ 'dublin 14' => 'DN',
519
+ 'dublin 15' => 'DN',
520
+ 'dublin 16' => 'DN',
521
+ 'dublin 17' => 'DN',
522
+ 'dublin 18' => 'DN',
523
+ 'dublin 20' => 'DN',
524
+ 'dublin 22' => 'DN',
525
+ 'dublin 24' => 'DN',
526
+ // All of these should be mapped to Dublin end
527
+ 'co galway' => 'GY',
528
+ 'co kildare' => 'KE',
529
+ 'co kilkenny' => 'KK',
530
+ 'co kerry' => 'KY',
531
+ 'co longford' => 'LD',
532
+ 'co louth' => 'LH',
533
+ 'co limerick' => 'LK',
534
+ 'co leitrim' => 'LM',
535
+ 'co laois' => 'LS',
536
+ 'co meath' => 'MH',
537
+ 'co monaghan' => 'MN',
538
+ 'co mayo' => 'MO',
539
+ 'co offaly' => 'OY',
540
+ 'co roscommon' => 'RN',
541
+ 'co sligo' => 'SO',
542
+ 'co tipperary' => 'TY',
543
+ 'co waterford' => 'WD',
544
+ 'co westmeath' => 'WH',
545
+ 'co wicklow' => 'WW',
546
+ 'co wexford' => 'WX',
547
+ );
548
+ } elseif ( 'ID' == $this->_country ) {
549
+ $translation_table = array(
550
+ 'id-ac' => 'AC',
551
+ 'id-ba' => 'BA',
552
+ 'id-bb' => 'BB',
553
+ 'id-be' => 'BE',
554
+ 'id-bt' => 'BT',
555
+ 'id-go' => 'GO',
556
+ 'id-ja' => 'JA',
557
+ 'id-jb' => 'JB',
558
+ 'id-ji' => 'JI',
559
+ 'id-jk' => 'JK',
560
+ 'id-jt' => 'JT',
561
+ 'id-kb' => 'KB',
562
+ 'id-ki' => 'KI',
563
+ 'id-kr' => 'KR',
564
+ 'id-ks' => 'KS',
565
+ 'id-kt' => 'KT',
566
+ 'id-ku' => 'KU',
567
+ 'id-la' => 'LA',
568
+ 'id-ma' => 'MA',
569
+ 'id-mu' => 'MU',
570
+ 'id-nb' => 'NB',
571
+ 'id-nt' => 'NT',
572
+ 'id-pa' => 'PA',
573
+ 'id-pb' => 'PB',
574
+ 'id-ri' => 'RI',
575
+ 'id-sa' => 'SA',
576
+ 'id-sb' => 'SB',
577
+ 'id-sg' => 'SG',
578
+ 'id-sn' => 'SN',
579
+ 'id-sr' => 'SR',
580
+ 'id-ss' => 'SS',
581
+ 'id-st' => 'ST',
582
+ 'id-su' => 'SU',
583
+ 'id-yo' => 'YO',
584
+ );
585
+ } elseif ( 'IN' == $this->_country ) {
586
+ $translation_table = array(
587
+ 'andaman and nicobar islands' => 'AN',
588
+ 'andhra pradesh' => 'AP',
589
+ //'apo' => '',
590
+ 'arunachal pradesh' => 'AR',
591
+ 'assam' => 'AS',
592
+ 'bihar' => 'BR',
593
+ 'chandigarh' => 'CH',
594
+ 'chhattisgarh' => 'CT',
595
+ 'dadra and nagar haveli' => 'DN',
596
+ 'daman and diu' => 'DD',
597
+ 'delhi (nct)' => 'DL',
598
+ 'goa' => 'GA',
599
+ 'gujarat' => 'GJ',
600
+ 'haryana' => 'HR',
601
+ 'himachal pradesh' => 'HP',
602
+ 'jammu and kashmir' => 'JK',
603
+ 'jharkhand' => 'JH',
604
+ 'karnataka' => 'KA',
605
+ 'kerala' => 'KL',
606
+ 'lakshadweep' => 'LD',
607
+ 'madhya pradesh' => 'MP',
608
+ 'maharashtra' => 'MH',
609
+ 'manipur' => 'MN',
610
+ 'meghalaya' => 'ML',
611
+ 'mizoram' => 'MZ',
612
+ 'nagaland' => 'NL',
613
+ 'odisha' => 'OR',
614
+ 'puducherry' => 'PY',
615
+ 'punjab' => 'PB',
616
+ 'rajasthan' => 'RJ',
617
+ 'sikkim' => 'SK',
618
+ 'tamil nadu' => 'TN',
619
+ 'telangana' => 'TS',
620
+ 'tripura' => 'TR',
621
+ 'uttar pradesh' => 'UP',
622
+ 'uttarakhand' => 'UK',
623
+ 'west bengal' => 'WB',
624
+ );
625
  } elseif ( 'IT' == $this->_country ) {
626
  $translation_table = array(
627
  'agrigento' => 'AG',
734
  'vicenza' => 'VI',
735
  'viterbo' => 'VT'
736
  );
737
+ } elseif ( 'JP' == $this->_country ) {
738
+ $translation_table = array(
739
+ 'hokkaido' => 'JP01',
740
+ 'aomori-ken' => 'JP02',
741
+ 'iwate-ken' => 'JP03',
742
+ 'miyagi-ken' => 'JP04',
743
+ 'akita-ken' => 'JP05',
744
+ 'yamagata-ken' => 'JP06',
745
+ 'fukushima-ken' => 'JP07',
746
+ 'ibaraki-ken' => 'JP08',
747
+ 'tochigi-ken' => 'JP09',
748
+ 'gunma-ken' => 'JP10',
749
+ 'saitama-ken' => 'JP11',
750
+ 'chiba-ken' => 'JP12',
751
+ 'tokyo-to' => 'JP13',
752
+ 'kanagawa-ken' => 'JP14',
753
+ 'niigata-ken' => 'JP15',
754
+ 'toyama-ken' => 'JP16',
755
+ 'ishikawa-ken' => 'JP17',
756
+ 'fukui-ken' => 'JP18',
757
+ 'yamanashi-ken' => 'JP19',
758
+ 'nagano-ken' => 'JP20',
759
+ 'gifu-ken' => 'JP21',
760
+ 'shizuoka-ken' => 'JP22',
761
+ 'aichi-ken' => 'JP23',
762
+ 'mie-ken' => 'JP24',
763
+ 'shiga-ken' => 'JP25',
764
+ 'kyoto-fu' => 'JP26',
765
+ 'osaka-fu' => 'JP27',
766
+ 'hyogo-ken' => 'JP28',
767
+ 'nara-ken' => 'JP29',
768
+ 'wakayama-ken' => 'JP30',
769
+ 'tottori-ken' => 'JP31',
770
+ 'shimane-ken' => 'JP32',
771
+ 'okayama-ken' => 'JP33',
772
+ 'hiroshima-ken' => 'JP34',
773
+ 'yamaguchi-ken' => 'JP35',
774
+ 'tokushima-ken' => 'JP36',
775
+ 'kagawa-ken' => 'JP37',
776
+ 'ehime-ken' => 'JP38',
777
+ 'kochi-ken' => 'JP39',
778
+ 'fukuoka-ken' => 'JP40',
779
+ 'saga-ken' => 'JP41',
780
+ 'nagasaki-ken' => 'JP42',
781
+ 'kumamoto-ken' => 'JP43',
782
+ 'oita-ken' => 'JP44',
783
+ 'miyazaki-ken' => 'JP45',
784
+ 'kagoshima-ken' => 'JP46',
785
+ 'okinawa-ken' => 'JP47',
786
+ );
787
+ } elseif ( 'MX' == $this->_country ) {
788
+ $translation_table = array(
789
+ 'ags' => 'AG',
790
+ 'bc' => 'BC',
791
+ 'bcs' => 'BS',
792
+ 'camp' => 'CM',
793
+ 'chis' => 'CS',
794
+ 'chih' => 'CH',
795
+ 'cdmx' => 'DF', // Both cdmx and df are mapped to DF
796
+ 'coah' => 'CO',
797
+ 'col' => 'CL',
798
+ 'df' => 'DF', // Both cdmx and df are mapped to DF
799
+ 'dgo' => 'DG',
800
+ 'mex' => 'MX',
801
+ 'gto' => 'GT',
802
+ 'gro' => 'GR',
803
+ 'hgo' => 'HG',
804
+ 'jal' => 'JA',
805
+ 'mich' => 'MI',
806
+ 'mor' => 'MO',
807
+ 'nay' => 'NA',
808
+ 'nl' => 'NL',
809
+ 'oax' => 'OA',
810
+ 'pue' => 'PU',
811
+ 'qro' => 'QT',
812
+ 'q roo' => 'QR',
813
+ 'slp' => 'SL',
814
+ 'sin' => 'SI',
815
+ 'son' => 'SO',
816
+ 'tab' => 'TB',
817
+ 'tamps' => 'TM',
818
+ 'tlax' => 'TL',
819
+ 'ver' => 'VE',
820
+ 'yuc' => 'YU',
821
+ 'zac' => 'ZA',
822
+ );
823
  } elseif ( 'NL' == $this->_country ) {
824
  $translation_table = array(
825
  'drenthe' => 'DR',
835
  'zeeland' => 'ZE',
836
  'zuid-holland' => 'ZH'
837
  );
838
+ } elseif ( 'TH' == $this->_country ) {
839
  $translation_table = array(
840
+ 'amnat charoen' => 'TH-37',
841
+ 'ang thong' => 'TH-15',
842
+ 'phra nakhon si ayutthaya' => 'TH-14',
843
+ 'bangkok' => 'TH-10',
844
+ 'bueng kan' => 'TH-38',
845
+ 'buri ram' => 'TH-31',
846
+ 'chachoengsao' => 'TH-24',
847
+ 'chai nat' => 'TH-18',
848
+ 'chaiyaphum' => 'TH-36',
849
+ 'chanthaburi' => 'TH-22',
850
+ 'chiang mai' => 'TH-50',
851
+ 'chiang rai' => 'TH-57',
852
+ 'chon buri' => 'TH-20',
853
+ 'chumphon' => 'TH-86',
854
+ 'kalasin' => 'TH-46',
855
+ 'kamphaeng phet' => 'TH-62',
856
+ 'kanchanaburi' => 'TH-71',
857
+ 'khon kaen' => 'TH-40',
858
+ 'krabi' => 'TH-81',
859
+ 'lampang' => 'TH-52',
860
+ 'lamphun' => 'TH-51',
861
+ 'loei' => 'TH-42',
862
+ 'lop buri' => 'TH-16',
863
+ 'mae hong son' => 'TH-58',
864
+ 'maha sarakham' => 'TH-44',
865
+ 'mukdahan' => 'TH-49',
866
+ 'nakhon nayok' => 'TH-26',
867
+ 'nakhon pathom' => 'TH-73',
868
+ 'nakhon phanom' => 'TH-48',
869
+ 'nakhon ratchasima' => 'TH-30',
870
+ 'nakhon sawan' => 'TH-60',
871
+ 'nakhon si thammarat' => 'TH-80',
872
+ 'nan' => 'TH-55',
873
+ 'narathiwat' => 'TH-96',
874
+ 'nong bua lamphu' => 'TH-39',
875
+ 'nong khai' => 'TH-43',
876
+ 'nonthaburi' => 'TH-12',
877
+ 'pathum thani' => 'TH-13',
878
+ 'pattani' => 'TH-94',
879
+ 'phang nga' => 'TH-82',
880
+ 'phatthalung' => 'TH-93',
881
+ 'phayao' => 'TH-56',
882
+ 'phetchabun' => 'TH-67',
883
+ 'phetchaburi' => 'TH-76',
884
+ 'phichit' => 'TH-66',
885
+ 'phitsanulok' => 'TH-65',
886
+ 'phrae' => 'TH-54',
887
+ 'phuket' => 'TH-83',
888
+ 'prachin buri' => 'TH-25',
889
+ 'prachuap khiri khan' => 'TH-77',
890
+ 'ranong' => 'TH-85',
891
+ 'ratchaburi' => 'TH-70',
892
+ 'rayong' => 'TH-21',
893
+ 'roi et' => 'TH-45',
894
+ 'sa kaeo' => 'TH-27',
895
+ 'sakon nakhon' => 'TH-47',
896
+ 'samut prakan' => 'TH-11',
897
+ 'samut sakhon' => 'TH-74',
898
+ 'samut songkhram' => 'TH-75',
899
+ 'saraburi' => 'TH-19',
900
+ 'satun' => 'TH-91',
901
+ 'sing buri' => 'TH-17',
902
+ 'si sa ket' => 'TH-33',
903
+ 'songkhla' => 'TH-90',
904
+ 'sukhothai' => 'TH-64',
905
+ 'suphan buri' => 'TH-72',
906
+ 'surat thani' => 'TH-84',
907
+ 'surin' => 'TH-32',
908
+ 'tak' => 'TH-63',
909
+ 'trang' => 'TH-92',
910
+ 'trat' => 'TH-23',
911
+ 'ubon ratchathani' => 'TH-34',
912
+ 'udon thani' => 'TH-41',
913
+ 'uthai thani' => 'TH-61',
914
+ 'uttaradit' => 'TH-53',
915
+ 'yala' => 'TH-95',
916
+ 'yasothon' => 'TH-35',
917
+ //'phatthaya' => '',
918
+ );
919
+ } elseif ( 'US' == $this->_country ) {
920
+ $translation_table = array(
921
+ 'alabama' => 'AL',
922
+ 'alaska' => 'AK',
923
+ 'arizona' => 'AZ',
924
+ 'arkansas' => 'AR',
925
+ 'california' => 'CA',
926
+ 'colorado' => 'CO',
927
+ 'connecticut' => 'CT',
928
+ 'deleware' => 'DE',
929
+ 'district of columbia (washington, d.c.)' => 'DC',
930
+ // The next several derivations don't show up in the list, but seem obvious
931
+ 'district of columbia' => 'DC',
932
+ 'washington, d.c.' => 'DC',
933
+ 'washington d.c.' => 'DC',
934
+ 'washington, dc' => 'DC',
935
+ 'washington dc' => 'DC',
936
+ 'washington, d. c.' => 'DC',
937
+ 'washington d. c.' => 'DC',
938
+ 'washington, d c' => 'DC',
939
+ 'washington d c' => 'DC',
940
+ 'florida' => 'FL',
941
+ 'georgia' => 'GA',
942
+ 'hawaii' => 'HI',
943
+ 'idaho' => 'ID',
944
+ 'illinois' => 'IL',
945
+ 'indiana' => 'IN',
946
+ 'iowa' => 'IA',
947
+ 'kansas' => 'KS',
948
+ 'kentucky' => 'KY',
949
+ 'louisiana' => 'LA',
950
+ 'maine' => 'ME',
951
+ 'maryland' => 'MD',
952
+ 'massachusetts' => 'MA',
953
+ 'michigan' => 'MI',
954
+ 'minnesota' => 'MN',
955
+ 'mississippi' => 'MS',
956
+ 'missouri' => 'MO',
957
+ 'montana' => 'MT',
958
+ 'nebraska' => 'NE',
959
+ 'nevada' => 'NV',
960
+ 'new hampshire' => 'NH',
961
+ 'new jersey' => 'NJ',
962
+ 'new mexico' => 'NM',
963
+ 'new jersey' => 'NJ',
964
+ 'new mexico' => 'NM',
965
+ 'new york' => 'NY',
966
+ 'north carolina' => 'NC',
967
+ 'north dakota' => 'ND',
968
+ 'ohio' => 'OH',
969
+ 'oklahoma' => 'OK',
970
+ 'oregon' => 'OR',
971
+ 'pennsylvania' => 'PA',
972
+ 'puerto rico' => 'PR',
973
+ 'rhode island' => 'RI',
974
+ 'south carolina' => 'SC',
975
+ 'south dakota' => 'SD',
976
+ 'tennessee' => 'TN',
977
+ 'texas' => 'TX',
978
+ 'utah' => 'UT',
979
+ 'vermont' => 'VT',
980
+ 'virginia' => 'VA',
981
+ 'washington' => 'WA',
982
+ 'west virginia' => 'WV',
983
+ 'wisconsin' => 'WI',
984
+ 'wyoming' => 'WY',
985
+ 'armed forces americas' => 'AA',
986
+ 'armed forces' => 'AE',
987
+ 'armed forces pacific' => 'AP',
988
+ 'american samoa' => 'AS',
989
+ 'guam' => 'GU',
990
+ 'northern mariana islands' => 'MP',
991
+ 'virgin islands' => 'VI',
992
+ // The next few derivations don't show up on the list, but seem obvious
993
+ 'us virgin islands' => 'VI',
994
+ 'u.s. virgin islands' => 'VI',
995
+ 'u s virgin islands' => 'VI',
996
+ 'u. s. virgin islands' => 'VI'
997
  );
998
  }
999
 
includes/class-wc-gateway-ppec-admin-handler.php CHANGED
@@ -153,22 +153,27 @@ class WC_Gateway_PPEC_Admin_Handler {
153
  * @param int $order_id
154
  */
155
  public function capture_payment( $order_id ) {
156
- $order = wc_get_order( $order_id );
157
- $old_wc = version_compare( WC_VERSION, '3.0', '<' );
 
 
 
158
 
 
159
  $payment_method = $old_wc ? $order->payment_method : $order->get_payment_method();
160
- if ( 'ppec_paypal' === $payment_method ) {
161
 
162
- $trans_id = get_post_meta( $order_id, '_transaction_id', true );
163
- $trans_details = wc_gateway_ppec()->client->get_transaction_details( array( 'TRANSACTIONID' => $trans_id ) );
164
 
165
- if ( $trans_id && $this->is_authorized_only( $trans_details ) ) {
 
 
166
  $order_total = $old_wc ? $order->order_total : $order->get_total();
167
 
168
- $params['AUTHORIZATIONID'] = $trans_id;
169
- $params['AMT'] = floatval( $order_total );
170
- $params['CURRENCYCODE'] = $old_wc ? $order->order_currency : $order->get_currency();
171
- $params['COMPLETETYPE'] = 'Complete';
172
 
173
  $result = wc_gateway_ppec()->client->do_express_checkout_capture( $params );
174
 
@@ -181,7 +186,7 @@ class WC_Gateway_PPEC_Admin_Handler {
181
  update_post_meta( $order_id, '_transaction_id', $result['TRANSACTIONID'] );
182
  }
183
 
184
- $order->add_order_note( sprintf( __( 'PayPal Checkout charge complete (Charge ID: %s)', 'woocommerce-gateway-paypal-express-checkout' ), $trans_id ) );
185
  }
186
  }
187
  }
153
  * @param int $order_id
154
  */
155
  public function capture_payment( $order_id ) {
156
+ $order = wc_get_order( $order_id );
157
+
158
+ if ( ! $order ) {
159
+ return;
160
+ }
161
 
162
+ $old_wc = version_compare( WC_VERSION, '3.0', '<' );
163
  $payment_method = $old_wc ? $order->payment_method : $order->get_payment_method();
164
+ $transaction_id = get_post_meta( $order_id, '_transaction_id', true );
165
 
166
+ if ( 'ppec_paypal' === $payment_method && $transaction_id ) {
 
167
 
168
+ $trans_details = wc_gateway_ppec()->client->get_transaction_details( array( 'TRANSACTIONID' => $transaction_id ) );
169
+
170
+ if ( $this->is_authorized_only( $trans_details ) ) {
171
  $order_total = $old_wc ? $order->order_total : $order->get_total();
172
 
173
+ $params['AUTHORIZATIONID'] = $transaction_id;
174
+ $params['AMT'] = floatval( $order_total );
175
+ $params['CURRENCYCODE'] = $old_wc ? $order->order_currency : $order->get_currency();
176
+ $params['COMPLETETYPE'] = 'Complete';
177
 
178
  $result = wc_gateway_ppec()->client->do_express_checkout_capture( $params );
179
 
186
  update_post_meta( $order_id, '_transaction_id', $result['TRANSACTIONID'] );
187
  }
188
 
189
+ $order->add_order_note( sprintf( __( 'PayPal Checkout charge complete (Charge ID: %s)', 'woocommerce-gateway-paypal-express-checkout' ), $transaction_id ) );
190
  }
191
  }
192
  }
includes/class-wc-gateway-ppec-cart-handler.php CHANGED
@@ -316,6 +316,14 @@ class WC_Gateway_PPEC_Cart_Handler {
316
  <?php endif; ?>
317
  </div>
318
  <?php
 
 
 
 
 
 
 
 
319
  }
320
 
321
  /**
@@ -458,7 +466,7 @@ class WC_Gateway_PPEC_Cart_Handler {
458
  wp_enqueue_style( 'wc-gateway-ppec-frontend', wc_gateway_ppec()->plugin_url . 'assets/css/wc-gateway-ppec-frontend.css' );
459
 
460
  $is_cart = is_cart() && ! WC()->cart->is_empty() && 'yes' === $settings->cart_checkout_enabled;
461
- $is_product = is_product() && 'yes' === $settings->checkout_on_single_product_enabled;
462
  $is_checkout = is_checkout() && 'yes' === $settings->mark_enabled && ! wc_gateway_ppec()->checkout->has_active_session();
463
  $page = $is_cart ? 'cart' : ( $is_product ? 'product' : ( $is_checkout ? 'checkout' : null ) );
464
 
@@ -513,16 +521,6 @@ class WC_Gateway_PPEC_Cart_Handler {
513
 
514
  wp_localize_script( 'wc-gateway-ppec-smart-payment-buttons', 'wc_ppec_context', $data );
515
  }
516
-
517
- if ( $is_product ) {
518
- wp_enqueue_script( 'wc-gateway-ppec-generate-cart', wc_gateway_ppec()->plugin_url . 'assets/js/wc-gateway-ppec-generate-cart.js', array( 'jquery' ), wc_gateway_ppec()->version, true );
519
- wp_localize_script( 'wc-gateway-ppec-generate-cart', 'wc_ppec_generate_cart_context',
520
- array(
521
- 'generate_cart_nonce' => wp_create_nonce( '_wc_ppec_generate_cart_nonce' ),
522
- 'ajaxurl' => WC_AJAX::get_endpoint( 'wc_ppec_generate_cart' ),
523
- )
524
- );
525
- }
526
  }
527
 
528
  /**
316
  <?php endif; ?>
317
  </div>
318
  <?php
319
+
320
+ wp_enqueue_script( 'wc-gateway-ppec-generate-cart', wc_gateway_ppec()->plugin_url . 'assets/js/wc-gateway-ppec-generate-cart.js', array( 'jquery' ), wc_gateway_ppec()->version, true );
321
+ wp_localize_script( 'wc-gateway-ppec-generate-cart', 'wc_ppec_generate_cart_context',
322
+ array(
323
+ 'generate_cart_nonce' => wp_create_nonce( '_wc_ppec_generate_cart_nonce' ),
324
+ 'ajaxurl' => WC_AJAX::get_endpoint( 'wc_ppec_generate_cart' ),
325
+ )
326
+ );
327
  }
328
 
329
  /**
466
  wp_enqueue_style( 'wc-gateway-ppec-frontend', wc_gateway_ppec()->plugin_url . 'assets/css/wc-gateway-ppec-frontend.css' );
467
 
468
  $is_cart = is_cart() && ! WC()->cart->is_empty() && 'yes' === $settings->cart_checkout_enabled;
469
+ $is_product = ( is_product() || wc_post_content_has_shortcode( 'product_page' ) ) && 'yes' === $settings->checkout_on_single_product_enabled;
470
  $is_checkout = is_checkout() && 'yes' === $settings->mark_enabled && ! wc_gateway_ppec()->checkout->has_active_session();
471
  $page = $is_cart ? 'cart' : ( $is_product ? 'product' : ( $is_checkout ? 'checkout' : null ) );
472
 
521
 
522
  wp_localize_script( 'wc-gateway-ppec-smart-payment-buttons', 'wc_ppec_context', $data );
523
  }
 
 
 
 
 
 
 
 
 
 
524
  }
525
 
526
  /**
includes/class-wc-gateway-ppec-checkout-handler.php CHANGED
@@ -37,8 +37,6 @@ class WC_Gateway_PPEC_Checkout_Handler {
37
  add_action( 'init', array( $this, 'init' ) );
38
  add_filter( 'the_title', array( $this, 'endpoint_page_titles' ) );
39
  add_action( 'woocommerce_checkout_init', array( $this, 'checkout_init' ) );
40
- add_filter( 'woocommerce_default_address_fields', array( $this, 'filter_default_address_fields' ) );
41
- add_filter( 'woocommerce_billing_fields', array( $this, 'filter_billing_fields' ) );
42
  add_action( 'woocommerce_checkout_process', array( $this, 'copy_checkout_details_to_post' ) );
43
 
44
  add_action( 'wp', array( $this, 'maybe_return_from_paypal' ) );
@@ -101,11 +99,15 @@ class WC_Gateway_PPEC_Checkout_Handler {
101
  remove_action( 'woocommerce_checkout_billing', array( $checkout, 'checkout_form_billing' ) );
102
  remove_action( 'woocommerce_checkout_shipping', array( $checkout, 'checkout_form_shipping' ) );
103
 
104
- // Lastly, let's add back in 1) displaying customer details from PayPal, 2) allow for
105
  // account registration and 3) shipping details from PayPal
106
  add_action( 'woocommerce_checkout_billing', array( $this, 'paypal_billing_details' ) );
107
  add_action( 'woocommerce_checkout_billing', array( $this, 'account_registration' ) );
108
  add_action( 'woocommerce_checkout_shipping', array( $this, 'paypal_shipping_details' ) );
 
 
 
 
109
  }
110
 
111
  /**
@@ -430,12 +432,11 @@ class WC_Gateway_PPEC_Checkout_Handler {
430
  return;
431
  }
432
 
433
- if ( empty( $_GET['woo-paypal-return'] ) || empty( $_GET['token'] ) || empty( $_GET['PayerID'] ) ) {
434
  return;
435
  }
436
 
437
  $token = $_GET['token'];
438
- $payer_id = $_GET['PayerID'];
439
  $create_billing_agreement = ! empty( $_GET['create-billing-agreement'] );
440
  $session = WC()->session->get( 'paypal' );
441
 
@@ -446,9 +447,16 @@ class WC_Gateway_PPEC_Checkout_Handler {
446
 
447
  // Store values in session.
448
  $session->checkout_completed = true;
449
- $session->payer_id = $payer_id;
450
  $session->token = $token;
451
 
 
 
 
 
 
 
 
 
452
  // Update customer addresses here from PayPal selection so they can be used to calculate local taxes.
453
  $this->update_customer_addresses_from_paypal( $token );
454
 
@@ -468,7 +476,11 @@ class WC_Gateway_PPEC_Checkout_Handler {
468
  }
469
 
470
  // Complete the payment now.
471
- $this->do_payment( $order, $session->token, $session->payer_id );
 
 
 
 
472
 
473
  // Clear Cart
474
  WC()->cart->empty_cart();
@@ -563,7 +575,7 @@ class WC_Gateway_PPEC_Checkout_Handler {
563
  // If the cart total is zero (e.g. because of a coupon), don't allow this gateway.
564
  // We do this only if we're on the checkout page (is_checkout), but not on the order-pay page (is_checkout_pay_page)
565
  if ( is_cart() || ( is_checkout() && ! is_checkout_pay_page() ) ) {
566
- if ( isset( $gateways['ppec_paypal'] ) && ( 0 >= WC()->cart->total ) ) {
567
  unset( $gateways['ppec_paypal'] );
568
  }
569
  }
@@ -655,7 +667,7 @@ class WC_Gateway_PPEC_Checkout_Handler {
655
  }
656
 
657
  $session = WC()->session->paypal;
658
- return ( is_a( $session, 'WC_Gateway_PPEC_Session_Data' ) && $session->payer_id && $session->expiry_time > time() );
659
  }
660
 
661
  /**
37
  add_action( 'init', array( $this, 'init' ) );
38
  add_filter( 'the_title', array( $this, 'endpoint_page_titles' ) );
39
  add_action( 'woocommerce_checkout_init', array( $this, 'checkout_init' ) );
 
 
40
  add_action( 'woocommerce_checkout_process', array( $this, 'copy_checkout_details_to_post' ) );
41
 
42
  add_action( 'wp', array( $this, 'maybe_return_from_paypal' ) );
99
  remove_action( 'woocommerce_checkout_billing', array( $checkout, 'checkout_form_billing' ) );
100
  remove_action( 'woocommerce_checkout_shipping', array( $checkout, 'checkout_form_shipping' ) );
101
 
102
+ // Secondly, let's add back in 1) displaying customer details from PayPal, 2) allow for
103
  // account registration and 3) shipping details from PayPal
104
  add_action( 'woocommerce_checkout_billing', array( $this, 'paypal_billing_details' ) );
105
  add_action( 'woocommerce_checkout_billing', array( $this, 'account_registration' ) );
106
  add_action( 'woocommerce_checkout_shipping', array( $this, 'paypal_shipping_details' ) );
107
+
108
+ // Lastly make address fields optional depending on PayPal settings.
109
+ add_filter( 'woocommerce_default_address_fields', array( $this, 'filter_default_address_fields' ) );
110
+ add_filter( 'woocommerce_billing_fields', array( $this, 'filter_billing_fields' ) );
111
  }
112
 
113
  /**
432
  return;
433
  }
434
 
435
+ if ( empty( $_GET['woo-paypal-return'] ) || empty( $_GET['token'] ) ) {
436
  return;
437
  }
438
 
439
  $token = $_GET['token'];
 
440
  $create_billing_agreement = ! empty( $_GET['create-billing-agreement'] );
441
  $session = WC()->session->get( 'paypal' );
442
 
447
 
448
  // Store values in session.
449
  $session->checkout_completed = true;
 
450
  $session->token = $token;
451
 
452
+ if ( ! empty( $_GET['PayerID'] ) ) {
453
+ $session->payer_id = $_GET['PayerID'];
454
+ } elseif ( $create_billing_agreement ) {
455
+ $session->create_billing_agreement = true;
456
+ } else {
457
+ return;
458
+ }
459
+
460
  // Update customer addresses here from PayPal selection so they can be used to calculate local taxes.
461
  $this->update_customer_addresses_from_paypal( $token );
462
 
476
  }
477
 
478
  // Complete the payment now.
479
+ if ( ! empty( $session->payer_id ) ) {
480
+ $this->do_payment( $order, $session->token, $session->payer_id );
481
+ } elseif ( $order->get_total() <= 0 ) {
482
+ $order->payment_complete();
483
+ }
484
 
485
  // Clear Cart
486
  WC()->cart->empty_cart();
575
  // If the cart total is zero (e.g. because of a coupon), don't allow this gateway.
576
  // We do this only if we're on the checkout page (is_checkout), but not on the order-pay page (is_checkout_pay_page)
577
  if ( is_cart() || ( is_checkout() && ! is_checkout_pay_page() ) ) {
578
+ if ( isset( $gateways['ppec_paypal'] ) && ! WC()->cart->needs_payment() ) {
579
  unset( $gateways['ppec_paypal'] );
580
  }
581
  }
667
  }
668
 
669
  $session = WC()->session->paypal;
670
+ return ( is_a( $session, 'WC_Gateway_PPEC_Session_Data' ) && ( $session->payer_id || ! empty( $session->create_billing_agreement ) ) && $session->expiry_time > time() );
671
  }
672
 
673
  /**
includes/class-wc-gateway-ppec-client.php CHANGED
@@ -466,7 +466,7 @@ class WC_Gateway_PPEC_Client {
466
  $discounts = WC()->cart->get_cart_discount_total();
467
 
468
  $details = array(
469
- 'total_item_amount' => round( WC()->cart->cart_contents_total + $discounts + WC()->cart->fee_total, $decimals ),
470
  'order_tax' => round( WC()->cart->tax_total + WC()->cart->shipping_tax_total, $decimals ),
471
  'shipping' => round( WC()->cart->shipping_total, $decimals ),
472
  'items' => $this->_get_paypal_line_items_from_cart(),
@@ -575,11 +575,11 @@ class WC_Gateway_PPEC_Client {
575
  // the difference.
576
  $diff = 0;
577
 
578
- if ( $details['total_item_amount'] != $rounded_total ) {
579
  if ( 'add' === $settings->get_subtotal_mismatch_behavior() ) {
580
  // Add line item to make up different between WooCommerce
581
  // calculations and PayPal calculations.
582
- $diff = round( $details['total_item_amount'] - $rounded_total, $decimals );
583
  if ( abs( $diff ) > 0.000001 && 0.0 !== (float) $diff ) {
584
  $extra_line_item = $this->_get_extra_offset_line_item( $diff );
585
 
@@ -595,10 +595,10 @@ class WC_Gateway_PPEC_Client {
595
 
596
  // Enter discount shenanigans. Item total cannot be 0 so make modifications
597
  // accordingly.
598
- if ( $details['total_item_amount'] == $discounts ) {
599
  // Omit line items altogether.
600
  unset( $details['items'] );
601
- } else if ( $discounts > 0 && $discounts < $details['total_item_amount'] && ! empty( $details['items'] ) ) {
602
  // Else if there is discount, add them to the line-items
603
  $details['items'][] = $this->_get_extra_discount_line_item($discounts);
604
  }
@@ -606,10 +606,10 @@ class WC_Gateway_PPEC_Client {
606
  $details['ship_discount_amount'] = 0;
607
 
608
  // AMT
609
- $details['order_total'] = round( $details['order_total'] - $discounts, $decimals );
610
 
611
  // ITEMAMT
612
- $details['total_item_amount'] = round( $details['total_item_amount'] - $discounts, $decimals );
613
 
614
  // If the totals don't line up, adjust the tax to make it work (it's
615
  // probably a tax mismatch).
@@ -690,7 +690,7 @@ class WC_Gateway_PPEC_Client {
690
  $fees = round( $this->_get_total_order_fees( $order ), $decimals );
691
 
692
  $details = array(
693
- 'total_item_amount' => round( $order->get_subtotal() + $discounts + $fees, $decimals ),
694
  'order_tax' => round( $order->get_total_tax(), $decimals ),
695
  'shipping' => round( ( version_compare( WC_VERSION, '3.0', '<' ) ? $order->get_total_shipping() : $order->get_shipping_total() ), $decimals ),
696
  'items' => $this->_get_paypal_line_items_from_order( $order ),
@@ -852,7 +852,12 @@ class WC_Gateway_PPEC_Client {
852
  $order = wc_get_order( $order );
853
 
854
  $rounded_total = 0;
855
- foreach ( $order->get_items( array( 'line_item', 'fee' ) ) as $cart_item_key => $values ) {
 
 
 
 
 
856
  if( 'fee' === $values['type']) {
857
  $amount = round( $values['line_total'], $decimals);
858
  } else {
466
  $discounts = WC()->cart->get_cart_discount_total();
467
 
468
  $details = array(
469
+ 'total_item_amount' => round( WC()->cart->cart_contents_total + WC()->cart->fee_total, $decimals ),
470
  'order_tax' => round( WC()->cart->tax_total + WC()->cart->shipping_tax_total, $decimals ),
471
  'shipping' => round( WC()->cart->shipping_total, $decimals ),
472
  'items' => $this->_get_paypal_line_items_from_cart(),
575
  // the difference.
576
  $diff = 0;
577
 
578
+ if ( $details['total_item_amount'] + $discounts != $rounded_total ) {
579
  if ( 'add' === $settings->get_subtotal_mismatch_behavior() ) {
580
  // Add line item to make up different between WooCommerce
581
  // calculations and PayPal calculations.
582
+ $diff = round( $details['total_item_amount'] + $discounts - $rounded_total, $decimals );
583
  if ( abs( $diff ) > 0.000001 && 0.0 !== (float) $diff ) {
584
  $extra_line_item = $this->_get_extra_offset_line_item( $diff );
585
 
595
 
596
  // Enter discount shenanigans. Item total cannot be 0 so make modifications
597
  // accordingly.
598
+ if ( $details['total_item_amount'] == 0 ) {
599
  // Omit line items altogether.
600
  unset( $details['items'] );
601
+ } else if ( $discounts > 0 && 0 < $details['total_item_amount'] && ! empty( $details['items'] ) ) {
602
  // Else if there is discount, add them to the line-items
603
  $details['items'][] = $this->_get_extra_discount_line_item($discounts);
604
  }
606
  $details['ship_discount_amount'] = 0;
607
 
608
  // AMT
609
+ $details['order_total'] = round( $details['order_total'], $decimals );
610
 
611
  // ITEMAMT
612
+ $details['total_item_amount'] = round( $details['total_item_amount'], $decimals );
613
 
614
  // If the totals don't line up, adjust the tax to make it work (it's
615
  // probably a tax mismatch).
690
  $fees = round( $this->_get_total_order_fees( $order ), $decimals );
691
 
692
  $details = array(
693
+ 'total_item_amount' => round( $order->get_subtotal() - $discounts + $fees, $decimals ),
694
  'order_tax' => round( $order->get_total_tax(), $decimals ),
695
  'shipping' => round( ( version_compare( WC_VERSION, '3.0', '<' ) ? $order->get_total_shipping() : $order->get_shipping_total() ), $decimals ),
696
  'items' => $this->_get_paypal_line_items_from_order( $order ),
852
  $order = wc_get_order( $order );
853
 
854
  $rounded_total = 0;
855
+ foreach ( $order->get_items( array( 'line_item', 'fee', 'coupon' ) ) as $cart_item_key => $values ) {
856
+ if( 'coupon' === $values['type']) {
857
+ $amount = round($values['line_total'], $decimals);
858
+ $rounded_total -= $amount;
859
+ continue;
860
+ }
861
  if( 'fee' === $values['type']) {
862
  $amount = round( $values['line_total'], $decimals);
863
  } else {
includes/class-wc-gateway-ppec-settings.php CHANGED
@@ -120,7 +120,7 @@ class WC_Gateway_PPEC_Settings {
120
  */
121
  public function get_live_api_credentials() {
122
  if ( $this->api_certificate ) {
123
- return new WC_Gateway_PPEC_Client_Credential_Certificate( $this->api_username, $this->api_password, $this->api_certificate, $this->api_subject );
124
  }
125
 
126
  return new WC_Gateway_PPEC_Client_Credential_Signature( $this->api_username, $this->api_password, $this->api_signature, $this->api_subject );
@@ -133,7 +133,7 @@ class WC_Gateway_PPEC_Settings {
133
  */
134
  public function get_sandbox_api_credentials() {
135
  if ( $this->sandbox_api_certificate ) {
136
- return new WC_Gateway_PPEC_Client_Credential_Certificate( $this->sandbox_api_username, $this->sandbox_api_password, $this->sandbox_api_certificate, $this->sandbox_api_subject );
137
  }
138
 
139
  return new WC_Gateway_PPEC_Client_Credential_Signature( $this->sandbox_api_username, $this->sandbox_api_password, $this->sandbox_api_signature, $this->sandbox_api_subject );
@@ -303,9 +303,21 @@ class WC_Gateway_PPEC_Settings {
303
  */
304
  public function get_paypal_locale() {
305
  $locale = get_locale();
306
- if ( ! in_array( $locale, $this->_supported_locales ) ) {
 
 
 
 
 
 
 
 
 
 
 
307
  $locale = 'en_US';
308
  }
 
309
  return apply_filters( 'woocommerce_paypal_express_checkout_paypal_locale', $locale );
310
  }
311
 
120
  */
121
  public function get_live_api_credentials() {
122
  if ( $this->api_certificate ) {
123
+ return new WC_Gateway_PPEC_Client_Credential_Certificate( $this->api_username, $this->api_password, base64_decode( $this->api_certificate ), $this->api_subject );
124
  }
125
 
126
  return new WC_Gateway_PPEC_Client_Credential_Signature( $this->api_username, $this->api_password, $this->api_signature, $this->api_subject );
133
  */
134
  public function get_sandbox_api_credentials() {
135
  if ( $this->sandbox_api_certificate ) {
136
+ return new WC_Gateway_PPEC_Client_Credential_Certificate( $this->sandbox_api_username, $this->sandbox_api_password, base64_decode( $this->sandbox_api_certificate ), $this->sandbox_api_subject );
137
  }
138
 
139
  return new WC_Gateway_PPEC_Client_Credential_Signature( $this->sandbox_api_username, $this->sandbox_api_password, $this->sandbox_api_signature, $this->sandbox_api_subject );
303
  */
304
  public function get_paypal_locale() {
305
  $locale = get_locale();
306
+
307
+ // For stores based in the US, we need to do some special mapping so PayPal Credit is allowed.
308
+ if ( wc_gateway_ppec_is_US_based_store() ) {
309
+ // PayPal has support for French, Spanish and Chinese languages based in the US. See https://developer.paypal.com/docs/archive/checkout/reference/supported-locales/
310
+ preg_match('/^(fr|es|zh)_/', $locale, $language_code );
311
+
312
+ if ( ! empty( $language_code ) ) {
313
+ $locale = $language_code[0] . 'US';
314
+ } else {
315
+ $locale = 'en_US';
316
+ }
317
+ } else if ( ! in_array( $locale, $this->_supported_locales ) ) {
318
  $locale = 'en_US';
319
  }
320
+
321
  return apply_filters( 'woocommerce_paypal_express_checkout_paypal_locale', $locale );
322
  }
323
 
includes/functions.php CHANGED
@@ -76,8 +76,7 @@ function wc_gateway_ppec_log( $message ) {
76
  * @return bool Returns true if PayPal credit is supported
77
  */
78
  function wc_gateway_ppec_is_credit_supported() {
79
- $base = wc_get_base_location();
80
- return 'US' === $base['country'] && 'USD' === get_woocommerce_currency();
81
  }
82
 
83
  /**
@@ -154,3 +153,15 @@ function wc_gateway_ppec_get_transaction_fee( $order ) {
154
 
155
  return $fee;
156
  }
 
 
 
 
 
 
 
 
 
 
 
 
76
  * @return bool Returns true if PayPal credit is supported
77
  */
78
  function wc_gateway_ppec_is_credit_supported() {
79
+ return wc_gateway_ppec_is_US_based_store() && 'USD' === get_woocommerce_currency();
 
80
  }
81
 
82
  /**
153
 
154
  return $fee;
155
  }
156
+
157
+ /**
158
+ * Checks whether the store is based in the US.
159
+ *
160
+ * Stores with a base location in the US, Puerto Rico, Guam, US Virgin Islands, American Samoa, or Northern Mariana Islands are considered US based stores.
161
+ *
162
+ * @return bool True if the store is located in the US or US Territory, otherwise false.
163
+ */
164
+ function wc_gateway_ppec_is_US_based_store() {
165
+ $base_location = wc_get_base_location();
166
+ return in_array( $base_location['country'], array( 'US', 'PR', 'GU', 'VI', 'AS', 'MP' ), true );
167
+ }
includes/settings/settings-ppec.php CHANGED
@@ -24,7 +24,13 @@ if ( $enable_ips && $needs_creds ) {
24
  wc_gateway_ppec()->get_admin_setting_link()
25
  );
26
 
27
- $api_creds_text = sprintf( __( 'To reset current credentials and use other account <a href="%1$s" title="%2$s">click here</a>.', 'woocommerce-gateway-paypal-express-checkout' ), $reset_link, __( 'Reset current credentials', 'woocommerce-gateway-paypal-express-checkout' ) );
 
 
 
 
 
 
28
  }
29
 
30
  if ( $enable_ips && $needs_sandbox_creds ) {
@@ -40,7 +46,13 @@ if ( $enable_ips && $needs_sandbox_creds ) {
40
  wc_gateway_ppec()->get_admin_setting_link()
41
  );
42
 
43
- $sandbox_api_creds_text = sprintf( __( 'Your account setting is set to sandbox, no real charging takes place. To accept live payments, switch your environment to live and connect your PayPal account. To reset current credentials and use other sandbox account <a href="%1$s" title="%2$s">click here</a>.', 'woocommerce-gateway-paypal-express-checkout' ), $reset_link, __( 'Reset current sandbox credentials', 'woocommerce-gateway-paypal-express-checkout' ) );
 
 
 
 
 
 
44
  }
45
 
46
  $credit_enabled_label = __( 'Enable PayPal Credit', 'woocommerce-gateway-paypal-express-checkout' );
@@ -60,21 +72,21 @@ wc_enqueue_js( "
60
  var enable_sandbox_toggle = $( 'a.ppec-toggle-sandbox-settings' ).length > 0;
61
 
62
  $( '#woocommerce_ppec_paypal_environment' ).change(function(){
63
- $( ppec_sandbox_fields + ',' + ppec_live_fields ).closest( 'tr' ).hide();
64
 
65
  if ( 'live' === $( this ).val() ) {
66
  $( '#woocommerce_ppec_paypal_api_credentials, #woocommerce_ppec_paypal_api_credentials + p' ).show();
67
  $( '#woocommerce_ppec_paypal_sandbox_api_credentials, #woocommerce_ppec_paypal_sandbox_api_credentials + p' ).hide();
68
 
69
  if ( ! enable_toggle ) {
70
- $( ppec_live_fields ).closest( 'tr' ).show();
71
  }
72
  } else {
73
  $( '#woocommerce_ppec_paypal_api_credentials, #woocommerce_ppec_paypal_api_credentials + p' ).hide();
74
  $( '#woocommerce_ppec_paypal_sandbox_api_credentials, #woocommerce_ppec_paypal_sandbox_api_credentials + p' ).show();
75
 
76
  if ( ! enable_sandbox_toggle ) {
77
- $( ppec_sandbox_fields ).closest( 'tr' ).show();
78
  }
79
  }
80
  }).change();
@@ -98,14 +110,14 @@ wc_enqueue_js( "
98
  if ( enable_toggle ) {
99
  $( document ).off( 'click', '.ppec-toggle-settings' );
100
  $( document ).on( 'click', '.ppec-toggle-settings', function( e ) {
101
- $( ppec_live_fields ).closest( 'tr' ).toggle( 'fast' );
102
  e.preventDefault();
103
  } );
104
  }
105
  if ( enable_sandbox_toggle ) {
106
  $( document ).off( 'click', '.ppec-toggle-sandbox-settings' );
107
  $( document ).on( 'click', '.ppec-toggle-sandbox-settings', function( e ) {
108
- $( ppec_sandbox_fields ).closest( 'tr' ).toggle( 'fast' );
109
  e.preventDefault();
110
  } );
111
  }
@@ -323,7 +335,7 @@ $settings = array(
323
  'api_certificate' => array(
324
  'title' => __( 'Live API Certificate', 'woocommerce-gateway-paypal-express-checkout' ),
325
  'type' => 'file',
326
- 'description' => $this->get_certificate_info( $this->get_option( 'api_certificate' ) ),
327
  'default' => '',
328
  ),
329
  'api_subject' => array(
@@ -360,13 +372,13 @@ $settings = array(
360
  'description' => __( 'Get your API credentials from PayPal.', 'woocommerce-gateway-paypal-express-checkout' ),
361
  'default' => '',
362
  'desc_tip' => true,
 
363
  ),
364
  'sandbox_api_certificate' => array(
365
  'title' => __( 'Sandbox API Certificate', 'woocommerce-gateway-paypal-express-checkout' ),
366
  'type' => 'file',
367
- 'description' => __( 'Get your API credentials from PayPal.', 'woocommerce-gateway-paypal-express-checkout' ),
368
  'default' => '',
369
- 'desc_tip' => true,
370
  ),
371
  'sandbox_api_subject' => array(
372
  'title' => __( 'Sandbox API Subject', 'woocommerce-gateway-paypal-express-checkout' ),
24
  wc_gateway_ppec()->get_admin_setting_link()
25
  );
26
 
27
+ $api_creds_text = sprintf(
28
+ // Translators: Placeholders are opening an closing link HTML tags.
29
+ __( 'To reset current credentials and use another account %1$sclick here%2$s. %3$sLearn more about your API Credentials%2$s.', 'woocommerce-gateway-paypal-express-checkout' ),
30
+ '<a href="' . $reset_link . '" title="' . __( 'Reset current credentials', 'woocommerce-gateway-paypal-express-checkout' ) . '">',
31
+ '</a>',
32
+ '<a href="https://docs.woocommerce.com/document/paypal-express-checkout/#section-4" title="' . __( 'Learn more', 'woocommerce-gateway-paypal-express-checkout' ) . '">'
33
+ );
34
  }
35
 
36
  if ( $enable_ips && $needs_sandbox_creds ) {
46
  wc_gateway_ppec()->get_admin_setting_link()
47
  );
48
 
49
+ $sandbox_api_creds_text = sprintf(
50
+ // Translators: Placeholders are opening and closing link HTML tags.
51
+ __( 'Your account setting is set to sandbox, no real charging takes place. To accept live payments, switch your environment to live and connect your PayPal account. To reset current credentials and use other sandbox account %1$sclick here%2$s. %3$sLearn more about your API Credentials%2$s.', 'woocommerce-gateway-paypal-express-checkout' ),
52
+ '<a href="' . $reset_link . '" title="' . __( 'Reset current credentials', 'woocommerce-gateway-paypal-express-checkout' ) . '">',
53
+ '</a>',
54
+ '<a href="https://docs.woocommerce.com/document/paypal-express-checkout/#section-4" title="' . __( 'Learn more', 'woocommerce-gateway-paypal-express-checkout' ) . '">'
55
+ );
56
  }
57
 
58
  $credit_enabled_label = __( 'Enable PayPal Credit', 'woocommerce-gateway-paypal-express-checkout' );
72
  var enable_sandbox_toggle = $( 'a.ppec-toggle-sandbox-settings' ).length > 0;
73
 
74
  $( '#woocommerce_ppec_paypal_environment' ).change(function(){
75
+ $( '#woocommerce_ppec_paypal_api_credentials + p + table, #woocommerce_ppec_paypal_sandbox_api_credentials + p + table' ).hide();
76
 
77
  if ( 'live' === $( this ).val() ) {
78
  $( '#woocommerce_ppec_paypal_api_credentials, #woocommerce_ppec_paypal_api_credentials + p' ).show();
79
  $( '#woocommerce_ppec_paypal_sandbox_api_credentials, #woocommerce_ppec_paypal_sandbox_api_credentials + p' ).hide();
80
 
81
  if ( ! enable_toggle ) {
82
+ $( '#woocommerce_ppec_paypal_api_credentials + p + table' ).show();
83
  }
84
  } else {
85
  $( '#woocommerce_ppec_paypal_api_credentials, #woocommerce_ppec_paypal_api_credentials + p' ).hide();
86
  $( '#woocommerce_ppec_paypal_sandbox_api_credentials, #woocommerce_ppec_paypal_sandbox_api_credentials + p' ).show();
87
 
88
  if ( ! enable_sandbox_toggle ) {
89
+ $( '#woocommerce_ppec_paypal_sandbox_api_credentials + p + table' ).show();
90
  }
91
  }
92
  }).change();
110
  if ( enable_toggle ) {
111
  $( document ).off( 'click', '.ppec-toggle-settings' );
112
  $( document ).on( 'click', '.ppec-toggle-settings', function( e ) {
113
+ $( '#woocommerce_ppec_paypal_api_credentials + p + table' ).toggle( 'fast' );
114
  e.preventDefault();
115
  } );
116
  }
117
  if ( enable_sandbox_toggle ) {
118
  $( document ).off( 'click', '.ppec-toggle-sandbox-settings' );
119
  $( document ).on( 'click', '.ppec-toggle-sandbox-settings', function( e ) {
120
+ $( '#woocommerce_ppec_paypal_sandbox_api_credentials + p + table' ).toggle( 'fast' );
121
  e.preventDefault();
122
  } );
123
  }
335
  'api_certificate' => array(
336
  'title' => __( 'Live API Certificate', 'woocommerce-gateway-paypal-express-checkout' ),
337
  'type' => 'file',
338
+ 'description' => $this->get_certificate_setting_description(),
339
  'default' => '',
340
  ),
341
  'api_subject' => array(
372
  'description' => __( 'Get your API credentials from PayPal.', 'woocommerce-gateway-paypal-express-checkout' ),
373
  'default' => '',
374
  'desc_tip' => true,
375
+ 'placeholder' => __( 'Optional if you provide a certificate below', 'woocommerce-gateway-paypal-express-checkout' ),
376
  ),
377
  'sandbox_api_certificate' => array(
378
  'title' => __( 'Sandbox API Certificate', 'woocommerce-gateway-paypal-express-checkout' ),
379
  'type' => 'file',
380
+ 'description' => $this->get_certificate_setting_description( 'sandbox' ),
381
  'default' => '',
 
382
  ),
383
  'sandbox_api_subject' => array(
384
  'title' => __( 'Sandbox API Subject', 'woocommerce-gateway-paypal-express-checkout' ),
languages/woocommerce-gateway-paypal-express-checkout.pot CHANGED
@@ -1,16 +1,38 @@
1
- # Copyright (C) 2019 WooCommerce
2
  # This file is distributed under the same license as the WooCommerce PayPal Checkout Gateway plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce PayPal Checkout Gateway 1.6.20\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-gateway-paypal-express-checkout\n"
7
- "POT-Creation-Date: 2020-02-06 01:32:37+00:00\n"
 
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2020-MO-DA HO:MI+ZONE\n"
12
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
- "Language-Team: LANGUAGE <LL@li.org>\n"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
  #: includes/abstracts/abstract-wc-gateway-ppec.php:18
16
  #: includes/class-wc-gateway-ppec-privacy.php:12
@@ -25,104 +47,107 @@ msgstr ""
25
  msgid "Continue to payment"
26
  msgstr ""
27
 
28
- #: includes/abstracts/abstract-wc-gateway-ppec.php:157
29
  msgid "Sorry, an error occurred while trying to process your payment. Please try again."
30
  msgstr ""
31
 
32
- #: includes/abstracts/abstract-wc-gateway-ppec.php:190
33
  msgid "No API certificate on file."
34
  msgstr ""
35
 
36
- #: includes/abstracts/abstract-wc-gateway-ppec.php:202
37
- msgid "expired on %s"
38
- msgstr ""
39
-
40
- #: includes/abstracts/abstract-wc-gateway-ppec.php:205
41
  #: includes/abstracts/abstract-wc-gateway-ppec.php:208
42
- msgid "expires on %s"
43
  msgstr ""
44
 
45
  #: includes/abstracts/abstract-wc-gateway-ppec.php:212
46
- msgid "Certificate belongs to API username %1$s; %2$s"
 
 
 
 
47
  msgstr ""
48
 
49
- #: includes/abstracts/abstract-wc-gateway-ppec.php:214
50
  msgid "The certificate on file is not valid."
51
  msgstr ""
52
 
53
- #: includes/abstracts/abstract-wc-gateway-ppec.php:269
54
  msgid "Error: You must enter API password."
55
  msgstr ""
56
 
57
- #: includes/abstracts/abstract-wc-gateway-ppec.php:280
58
- #: includes/abstracts/abstract-wc-gateway-ppec.php:314
59
  msgid "Error: The API credentials you provided are not valid. Please double-check that you entered them correctly and try again."
60
  msgstr ""
61
 
62
- #: includes/abstracts/abstract-wc-gateway-ppec.php:285
63
- #: includes/abstracts/abstract-wc-gateway-ppec.php:318
64
  msgid "An error occurred while trying to validate your API credentials. Unable to verify that your API credentials are correct."
65
  msgstr ""
66
 
67
- #: includes/abstracts/abstract-wc-gateway-ppec.php:292
68
  msgid "Error: The API certificate is not valid."
69
  msgstr ""
70
 
71
- #: includes/abstracts/abstract-wc-gateway-ppec.php:300
72
  msgid "Error: The API certificate has expired."
73
  msgstr ""
74
 
75
- #: includes/abstracts/abstract-wc-gateway-ppec.php:305
76
  msgid "Error: The API username does not match the name in the API certificate. Make sure that you have the correct API certificate."
77
  msgstr ""
78
 
79
- #: includes/abstracts/abstract-wc-gateway-ppec.php:323
80
  msgid "Error: You must provide API signature or certificate."
81
  msgstr ""
82
 
83
- #: includes/abstracts/abstract-wc-gateway-ppec.php:341
84
  msgid "The \"require billing address\" option is not enabled by your account and has been disabled."
85
  msgstr ""
86
 
87
- #: includes/abstracts/abstract-wc-gateway-ppec.php:360
88
  msgid "Refund Error: You need to specify a refund amount."
89
  msgstr ""
90
 
91
- #: includes/abstracts/abstract-wc-gateway-ppec.php:380
92
- #: includes/abstracts/abstract-wc-gateway-ppec.php:403
93
- #: includes/abstracts/abstract-wc-gateway-ppec.php:453
94
  msgid "PayPal refund completed; transaction ID = %s"
95
  msgstr ""
96
 
97
- #: includes/abstracts/abstract-wc-gateway-ppec.php:427
98
  msgid "Refund Error: All transactions have been fully refunded. There is no amount left to refund"
99
  msgstr ""
100
 
101
- #: includes/abstracts/abstract-wc-gateway-ppec.php:429
102
  msgid "Refund Error: The requested refund amount is too large. The refund amount must be less than or equal to %s."
103
  msgstr ""
104
 
105
- #: includes/abstracts/abstract-wc-gateway-ppec.php:544
106
  msgid "Already using URL as image: %s"
107
  msgstr ""
108
 
109
- #: includes/abstracts/abstract-wc-gateway-ppec.php:552
110
  msgid "Select a image to upload"
111
  msgstr ""
112
 
113
- #: includes/abstracts/abstract-wc-gateway-ppec.php:553
114
  msgid "Use this image"
115
  msgstr ""
116
 
117
- #: includes/abstracts/abstract-wc-gateway-ppec.php:554
118
- #: includes/abstracts/abstract-wc-gateway-ppec.php:557
119
  msgid "Add image"
120
  msgstr ""
121
 
122
- #: includes/abstracts/abstract-wc-gateway-ppec.php:565
123
  msgid "Remove image"
124
  msgstr ""
125
 
 
 
 
 
126
  #: includes/class-wc-gateway-ppec-admin-handler.php:62
127
  msgid "Capture Charge"
128
  msgstr ""
@@ -131,39 +156,39 @@ msgstr ""
131
  msgid "NOTE: PayPal does not accept decimal places for the currency in which you are transacting. The \"Number of Decimals\" option in WooCommerce has automatically been set to 0 for you."
132
  msgstr ""
133
 
134
- #: includes/class-wc-gateway-ppec-admin-handler.php:176
135
  msgid "Unable to capture charge!"
136
  msgstr ""
137
 
138
- #: includes/class-wc-gateway-ppec-admin-handler.php:184
139
  msgid "PayPal Checkout charge complete (Charge ID: %s)"
140
  msgstr ""
141
 
142
- #: includes/class-wc-gateway-ppec-admin-handler.php:226
143
  msgid "Unable to void charge!"
144
  msgstr ""
145
 
146
- #: includes/class-wc-gateway-ppec-admin-handler.php:228
147
  msgid "PayPal Checkout charge voided (Charge ID: %s)"
148
  msgstr ""
149
 
150
- #: includes/class-wc-gateway-ppec-admin-handler.php:335
151
  msgid "This represents the fee PayPal collects for the transaction."
152
  msgstr ""
153
 
154
- #: includes/class-wc-gateway-ppec-admin-handler.php:336
155
  msgid "PayPal Fee:"
156
  msgstr ""
157
 
158
- #: includes/class-wc-gateway-ppec-admin-handler.php:345
159
  msgid "This represents the net total that will be credited to your PayPal account. This may be in a different currency than is set in your PayPal account."
160
  msgstr ""
161
 
162
- #: includes/class-wc-gateway-ppec-admin-handler.php:346
163
  msgid "PayPal Payout:"
164
  msgstr ""
165
 
166
- #: includes/class-wc-gateway-ppec-admin-handler.php:381
167
  msgid "%1$sWarning!%2$s PayPal Checkout will drop support for WooCommerce %3$s in a soon to be released update. To continue using PayPal Checkout please %4$supdate to %1$sWooCommerce 3.0%2$s or greater%5$s."
168
  msgstr ""
169
 
@@ -267,96 +292,96 @@ msgid "Cheatin&#8217; huh?"
267
  msgstr ""
268
 
269
  #: includes/class-wc-gateway-ppec-cart-handler.php:314
270
- #: includes/class-wc-gateway-ppec-cart-handler.php:351
271
- #: includes/class-wc-gateway-ppec-cart-handler.php:386
272
  msgid "Check out with PayPal"
273
  msgstr ""
274
 
275
- #: includes/class-wc-gateway-ppec-cart-handler.php:341
276
  msgid "&mdash; or &mdash;"
277
  msgstr ""
278
 
279
- #: includes/class-wc-gateway-ppec-cart-handler.php:356
280
  msgid "Pay with PayPal Credit"
281
  msgstr ""
282
 
283
- #: includes/class-wc-gateway-ppec-checkout-handler.php:79
284
  msgid "Confirm your PayPal order"
285
  msgstr ""
286
 
287
- #: includes/class-wc-gateway-ppec-checkout-handler.php:256
288
  msgid "Billing details"
289
  msgstr ""
290
 
291
- #: includes/class-wc-gateway-ppec-checkout-handler.php:259
292
  msgid "Address:"
293
  msgstr ""
294
 
295
- #: includes/class-wc-gateway-ppec-checkout-handler.php:261
296
  msgid "Name:"
297
  msgstr ""
298
 
299
- #: includes/class-wc-gateway-ppec-checkout-handler.php:265
300
  msgid "Email:"
301
  msgstr ""
302
 
303
- #: includes/class-wc-gateway-ppec-checkout-handler.php:271
304
  msgid "Phone:"
305
  msgstr ""
306
 
307
- #: includes/class-wc-gateway-ppec-checkout-handler.php:295
308
  msgid "Create an account?"
309
  msgstr ""
310
 
311
- #: includes/class-wc-gateway-ppec-checkout-handler.php:304
312
  msgid "Create an account by entering the information below. If you are a returning customer please login at the top of the page."
313
  msgstr ""
314
 
315
- #: includes/class-wc-gateway-ppec-checkout-handler.php:344
316
  msgid "Shipping details"
317
  msgstr ""
318
 
319
- #: includes/class-wc-gateway-ppec-checkout-handler.php:443
320
- #: includes/class-wc-gateway-ppec-checkout-handler.php:486
321
- #: includes/class-wc-gateway-ppec-checkout-handler.php:1144
322
  msgid "Your PayPal checkout session has expired. Please check out again."
323
  msgstr ""
324
 
325
- #: includes/class-wc-gateway-ppec-checkout-handler.php:481
326
  msgid "Sorry, an error occurred while trying to retrieve your information from PayPal. Please try again."
327
  msgstr ""
328
 
329
- #: includes/class-wc-gateway-ppec-checkout-handler.php:589
330
  msgid "Cancel"
331
  msgstr ""
332
 
333
- #: includes/class-wc-gateway-ppec-checkout-handler.php:612
334
  msgid "You have cancelled Checkout with PayPal. Please try to process your order again."
335
  msgstr ""
336
 
337
- #: includes/class-wc-gateway-ppec-checkout-handler.php:971
338
  #: includes/class-wc-gateway-ppec-ipn-handler.php:190
339
  msgid "Payment authorized. Change payment status to processing or complete to capture funds."
340
  msgstr ""
341
 
342
- #: includes/class-wc-gateway-ppec-checkout-handler.php:973
343
  #: includes/class-wc-gateway-ppec-ipn-handler.php:192
344
  msgid "Payment pending (%s)."
345
  msgstr ""
346
 
347
- #: includes/class-wc-gateway-ppec-checkout-handler.php:1155
348
  msgid "The payment method was updated for this subscription."
349
  msgstr ""
350
 
351
- #: includes/class-wc-gateway-ppec-checkout-handler.php:1160
352
  msgid "The payment method was updated for all your current subscriptions."
353
  msgstr ""
354
 
355
- #: includes/class-wc-gateway-ppec-checkout-handler.php:1169
356
  msgid "There was a problem updating your payment method. Please try again later or use a different payment method."
357
  msgstr ""
358
 
359
- #: includes/class-wc-gateway-ppec-checkout-handler.php:1192
360
  msgid "You have cancelled Checkout with PayPal. The payment method was not updated."
361
  msgstr ""
362
 
@@ -401,13 +426,6 @@ msgstr ""
401
  msgid "Malformed response received from PayPal"
402
  msgstr ""
403
 
404
- #. translators: placeholder is blogname
405
-
406
- #: includes/class-wc-gateway-ppec-client.php:398
407
- msgctxt "data sent to PayPal"
408
- msgid "Orders with %s"
409
- msgstr ""
410
-
411
  #: includes/class-wc-gateway-ppec-ipn-handler.php:29
412
  msgid "Empty POST data."
413
  msgstr ""
@@ -483,7 +501,7 @@ msgstr ""
483
  msgid "Success! Your PayPal account has been set up successfully."
484
  msgstr ""
485
 
486
- #: includes/class-wc-gateway-ppec-plugin.php:162
487
  msgid "%s in WooCommerce Gateway PayPal Checkout plugin can only be called once"
488
  msgstr ""
489
 
@@ -511,11 +529,11 @@ msgstr ""
511
  msgid "PayPal Checkout is almost ready. To get started, <a href=\"%s\">connect your PayPal account</a>."
512
  msgstr ""
513
 
514
- #: includes/class-wc-gateway-ppec-plugin.php:441
515
  msgid "Settings"
516
  msgstr ""
517
 
518
- #: includes/class-wc-gateway-ppec-plugin.php:444
519
  msgid "Docs"
520
  msgstr ""
521
 
@@ -553,10 +571,6 @@ msgstr ""
553
  msgid "Subscriptions"
554
  msgstr ""
555
 
556
- #: includes/class-wc-gateway-ppec-privacy.php:230
557
- msgid "Order ID %d contains an active Subscription"
558
- msgstr ""
559
-
560
  #: includes/class-wc-gateway-ppec-privacy.php:245
561
  msgid "PayPal Checkout Subscriptions Data Erased."
562
  msgstr ""
@@ -570,7 +584,6 @@ msgid "PayPal API error"
570
  msgstr ""
571
 
572
  #. translators: placeholder is pending reason from PayPal API.
573
-
574
  #: includes/class-wc-gateway-ppec-with-paypal-addons.php:204
575
  msgid "PayPal transaction held: %s"
576
  msgstr ""
@@ -584,7 +597,7 @@ msgid "PayPal payment declined"
584
  msgstr ""
585
 
586
  #: includes/class-wc-gateway-ppec-with-paypal-credit.php:15
587
- #: includes/settings/settings-ppec.php:574
588
  msgid "PayPal Credit"
589
  msgstr ""
590
 
@@ -594,7 +607,6 @@ msgid "An error occurred while calling the PayPal API."
594
  msgstr ""
595
 
596
  #. translators: placeholders are error code and message from PayPal
597
-
598
  #: includes/exceptions/class-wc-gateway-ppec-api-exception.php:64
599
  msgid "PayPal error (%1$s): %2$s"
600
  msgstr ""
@@ -611,517 +623,504 @@ msgstr ""
611
  msgid "%s or <a href=\"#\" class=\"ppec-toggle-settings\">click here to toggle manual API credential input</a>."
612
  msgstr ""
613
 
614
- #: includes/settings/settings-ppec.php:27
615
- msgid "To reset current credentials and use other account <a href=\"%1$s\" title=\"%2$s\">click here</a>."
 
616
  msgstr ""
617
 
618
- #: includes/settings/settings-ppec.php:27
 
 
 
619
  msgid "Reset current credentials"
620
  msgstr ""
621
 
622
- #: includes/settings/settings-ppec.php:31
623
- msgid "Setup or link an existing PayPal Sandbox account"
 
624
  msgstr ""
625
 
626
- #: includes/settings/settings-ppec.php:32
627
- msgid "%s or <a href=\"#\" class=\"ppec-toggle-sandbox-settings\">click here to toggle manual API credential input</a>."
628
  msgstr ""
629
 
630
- #: includes/settings/settings-ppec.php:43
631
- msgid "Your account setting is set to sandbox, no real charging takes place. To accept live payments, switch your environment to live and connect your PayPal account. To reset current credentials and use other sandbox account <a href=\"%1$s\" title=\"%2$s\">click here</a>."
632
  msgstr ""
633
 
634
- #: includes/settings/settings-ppec.php:43
635
- msgid "Reset current sandbox credentials"
 
636
  msgstr ""
637
 
638
- #: includes/settings/settings-ppec.php:46
639
- #: includes/settings/settings-ppec.php:580
640
  msgid "Enable PayPal Credit"
641
  msgstr ""
642
 
643
- #: includes/settings/settings-ppec.php:48
644
  msgid "This option is disabled. Currently PayPal Credit only available for U.S. merchants using USD currency."
645
  msgstr ""
646
 
647
- #: includes/settings/settings-ppec.php:51
648
  msgid "This enables PayPal Credit, which displays a PayPal Credit button next to the primary PayPal Checkout button. PayPal Checkout lets you give customers access to financing through PayPal Credit® - at no additional cost to you. You get paid up front, even though customers have more time to pay. A pre-integrated payment button shows up next to the PayPal Button, and lets customers pay quickly with PayPal Credit®. (Should be unchecked for stores involved in Real Money Gaming.)"
649
  msgstr ""
650
 
651
- #: includes/settings/settings-ppec.php:255
652
  msgid "Enable/Disable"
653
  msgstr ""
654
 
655
- #: includes/settings/settings-ppec.php:257
656
  msgid "Enable PayPal Checkout"
657
  msgstr ""
658
 
659
- #: includes/settings/settings-ppec.php:258
660
  msgid "This enables PayPal Checkout which allows customers to checkout directly via PayPal from your cart page."
661
  msgstr ""
662
 
663
- #: includes/settings/settings-ppec.php:264
664
  msgid "Title"
665
  msgstr ""
666
 
667
- #: includes/settings/settings-ppec.php:266
668
  msgid "This controls the title which the user sees during checkout."
669
  msgstr ""
670
 
671
- #: includes/settings/settings-ppec.php:267
672
  msgid "PayPal"
673
  msgstr ""
674
 
675
- #: includes/settings/settings-ppec.php:271
676
  msgid "Description"
677
  msgstr ""
678
 
679
- #: includes/settings/settings-ppec.php:274
680
  msgid "This controls the description which the user sees during checkout."
681
  msgstr ""
682
 
683
- #: includes/settings/settings-ppec.php:275
684
  msgid "Pay via PayPal; you can pay with your credit card if you don't have a PayPal account."
685
  msgstr ""
686
 
687
- #: includes/settings/settings-ppec.php:279
688
  msgid "Account Settings"
689
  msgstr ""
690
 
691
- #: includes/settings/settings-ppec.php:284
692
  msgid "Environment"
693
  msgstr ""
694
 
695
- #: includes/settings/settings-ppec.php:287
696
  msgid "This setting specifies whether you will process live transactions, or whether you will process simulated transactions using the PayPal Sandbox."
697
  msgstr ""
698
 
699
- #: includes/settings/settings-ppec.php:291
700
  msgid "Live"
701
  msgstr ""
702
 
703
- #: includes/settings/settings-ppec.php:292
704
  msgid "Sandbox"
705
  msgstr ""
706
 
707
- #: includes/settings/settings-ppec.php:297
708
  msgid "API Credentials"
709
  msgstr ""
710
 
711
- #: includes/settings/settings-ppec.php:302
712
  msgid "Live API Username"
713
  msgstr ""
714
 
715
- #: includes/settings/settings-ppec.php:304
716
- #: includes/settings/settings-ppec.php:311
717
- #: includes/settings/settings-ppec.php:318
718
- #: includes/settings/settings-ppec.php:346
719
- #: includes/settings/settings-ppec.php:353
720
- #: includes/settings/settings-ppec.php:360
721
- #: includes/settings/settings-ppec.php:367
722
  msgid "Get your API credentials from PayPal."
723
  msgstr ""
724
 
725
- #: includes/settings/settings-ppec.php:309
726
  msgid "Live API Password"
727
  msgstr ""
728
 
729
- #: includes/settings/settings-ppec.php:316
730
  msgid "Live API Signature"
731
  msgstr ""
732
 
733
- #: includes/settings/settings-ppec.php:321
 
734
  msgid "Optional if you provide a certificate below"
735
  msgstr ""
736
 
737
- #: includes/settings/settings-ppec.php:324
738
  msgid "Live API Certificate"
739
  msgstr ""
740
 
741
- #: includes/settings/settings-ppec.php:330
742
  msgid "Live API Subject"
743
  msgstr ""
744
 
745
- #: includes/settings/settings-ppec.php:332
746
- #: includes/settings/settings-ppec.php:374
747
  msgid "If you're processing transactions on behalf of someone else's PayPal account, enter their email address or Secure Merchant Account ID (also known as a Payer ID) here. Generally, you must have API permissions in place with the other account in order to process anything other than \"sale\" transactions for them."
748
  msgstr ""
749
 
750
- #: includes/settings/settings-ppec.php:335
751
- #: includes/settings/settings-ppec.php:377
752
- #: includes/settings/settings-ppec.php:398
753
- #: includes/settings/settings-ppec.php:406
754
- #: includes/settings/settings-ppec.php:414
755
  msgid "Optional"
756
  msgstr ""
757
 
758
- #: includes/settings/settings-ppec.php:339
759
  msgid "Sandbox API Credentials"
760
  msgstr ""
761
 
762
- #: includes/settings/settings-ppec.php:344
763
  msgid "Sandbox API Username"
764
  msgstr ""
765
 
766
- #: includes/settings/settings-ppec.php:351
767
  msgid "Sandbox API Password"
768
  msgstr ""
769
 
770
- #: includes/settings/settings-ppec.php:358
771
  msgid "Sandbox API Signature"
772
  msgstr ""
773
 
774
- #: includes/settings/settings-ppec.php:365
775
  msgid "Sandbox API Certificate"
776
  msgstr ""
777
 
778
- #: includes/settings/settings-ppec.php:372
779
  msgid "Sandbox API Subject"
780
  msgstr ""
781
 
782
- #: includes/settings/settings-ppec.php:381
783
  msgid "PayPal-hosted Checkout Settings"
784
  msgstr ""
785
 
786
- #: includes/settings/settings-ppec.php:383
787
  msgid "Customize the appearance of PayPal Checkout on the PayPal side."
788
  msgstr ""
789
 
790
- #: includes/settings/settings-ppec.php:386
791
  msgid "Brand Name"
792
  msgstr ""
793
 
794
- #: includes/settings/settings-ppec.php:388
795
  msgid "A label that overrides the business name in the PayPal account on the PayPal hosted checkout pages."
796
  msgstr ""
797
 
798
- #: includes/settings/settings-ppec.php:393
799
  msgid "Logo Image (190×60)"
800
  msgstr ""
801
 
802
- #: includes/settings/settings-ppec.php:395
803
  msgid "If you want PayPal to co-brand the checkout page with your logo, enter the URL of your logo image here.<br/>The image must be no larger than 190x60, GIF, PNG, or JPG format, and should be served over HTTPS."
804
  msgstr ""
805
 
806
- #: includes/settings/settings-ppec.php:401
807
  msgid "Header Image (750×90)"
808
  msgstr ""
809
 
810
- #: includes/settings/settings-ppec.php:403
811
  msgid "If you want PayPal to co-brand the checkout page with your header, enter the URL of your header image here.<br/>The image must be no larger than 750x90, GIF, PNG, or JPG format, and should be served over HTTPS."
812
  msgstr ""
813
 
814
- #: includes/settings/settings-ppec.php:409
815
  msgid "Page Style"
816
  msgstr ""
817
 
818
- #: includes/settings/settings-ppec.php:411
819
  msgid "Optionally enter the name of the page style you wish to use. These are defined within your PayPal account."
820
  msgstr ""
821
 
822
- #: includes/settings/settings-ppec.php:417
823
  msgid "Landing Page"
824
  msgstr ""
825
 
826
- #: includes/settings/settings-ppec.php:420
827
  msgid "Type of PayPal page to display."
828
  msgstr ""
829
 
830
- #: includes/settings/settings-ppec.php:424
831
  msgctxt "Type of PayPal page"
832
  msgid "Billing (Non-PayPal account)"
833
  msgstr ""
834
 
835
- #: includes/settings/settings-ppec.php:425
836
  msgctxt "Type of PayPal page"
837
  msgid "Login (PayPal account login)"
838
  msgstr ""
839
 
840
- #: includes/settings/settings-ppec.php:430
841
  msgid "Advanced Settings"
842
  msgstr ""
843
 
844
- #: includes/settings/settings-ppec.php:435
845
  msgid "Debug Log"
846
  msgstr ""
847
 
848
- #: includes/settings/settings-ppec.php:437
849
  msgid "Enable Logging"
850
  msgstr ""
851
 
852
- #: includes/settings/settings-ppec.php:440
853
  msgid "Log PayPal events, such as IPN requests."
854
  msgstr ""
855
 
856
- #: includes/settings/settings-ppec.php:443
857
  msgid "Invoice Prefix"
858
  msgstr ""
859
 
860
- #: includes/settings/settings-ppec.php:445
861
  msgid "Please enter a prefix for your invoice numbers. If you use your PayPal account for multiple stores ensure this prefix is unique as PayPal will not allow orders with the same invoice number."
862
  msgstr ""
863
 
864
- #: includes/settings/settings-ppec.php:450
865
  msgid "Billing Addresses"
866
  msgstr ""
867
 
868
- #: includes/settings/settings-ppec.php:452
869
  msgid "Require Billing Address"
870
  msgstr ""
871
 
872
- #: includes/settings/settings-ppec.php:454
873
  msgid "PayPal only returns a shipping address back to the website. To make sure billing address is returned as well, please enable this functionality on your PayPal account by calling %1$sPayPal Technical Support%2$s."
874
  msgstr ""
875
 
876
- #: includes/settings/settings-ppec.php:457
877
- #: includes/settings/settings-ppec.php:459
878
  msgid "Require Phone Number"
879
  msgstr ""
880
 
881
- #: includes/settings/settings-ppec.php:461
882
  msgid "Require buyer to enter their telephone number during checkout if none is provided by PayPal"
883
  msgstr ""
884
 
885
- #: includes/settings/settings-ppec.php:464
886
  msgid "Payment Action"
887
  msgstr ""
888
 
889
- #: includes/settings/settings-ppec.php:467
890
  msgid "Choose whether you wish to capture funds immediately or authorize payment only."
891
  msgstr ""
892
 
893
- #: includes/settings/settings-ppec.php:471
894
  msgid "Sale"
895
  msgstr ""
896
 
897
- #: includes/settings/settings-ppec.php:472
898
  msgid "Authorize"
899
  msgstr ""
900
 
901
- #: includes/settings/settings-ppec.php:476
902
  msgid "Instant Payments"
903
  msgstr ""
904
 
905
- #: includes/settings/settings-ppec.php:478
906
  msgid "Require Instant Payment"
907
  msgstr ""
908
 
909
- #: includes/settings/settings-ppec.php:481
910
  msgid "If you enable this setting, PayPal will be instructed not to allow the buyer to use funding sources that take additional time to complete (for example, eChecks). Instead, the buyer will be required to use an instant funding source, such as an instant transfer, a credit/debit card, or PayPal Credit."
911
  msgstr ""
912
 
913
- #: includes/settings/settings-ppec.php:484
914
  msgid "Subtotal Mismatch Behavior"
915
  msgstr ""
916
 
917
- #: includes/settings/settings-ppec.php:487
918
  msgid "Internally, WC calculates line item prices and taxes out to four decimal places; however, PayPal can only handle amounts out to two decimal places (or, depending on the currency, no decimal places at all). Occasionally, this can cause discrepancies between the way WooCommerce calculates prices versus the way PayPal calculates them. If a mismatch occurs, this option controls how the order is dealt with so payment can still be taken."
919
  msgstr ""
920
 
921
- #: includes/settings/settings-ppec.php:491
922
  msgid "Add another line item"
923
  msgstr ""
924
 
925
- #: includes/settings/settings-ppec.php:492
926
  msgid "Do not send line items to PayPal"
927
  msgstr ""
928
 
929
- #: includes/settings/settings-ppec.php:497
930
  msgid "Button Settings"
931
  msgstr ""
932
 
933
- #: includes/settings/settings-ppec.php:499
934
  msgid "Customize the appearance of PayPal Checkout on your site."
935
  msgstr ""
936
 
937
- #: includes/settings/settings-ppec.php:502
938
  msgid "Smart Payment Buttons"
939
  msgstr ""
940
 
941
- #: includes/settings/settings-ppec.php:505
942
  msgid "Use Smart Payment Buttons"
943
  msgstr ""
944
 
945
- #: includes/settings/settings-ppec.php:506
946
  msgid "PayPal Checkout's Smart Payment Buttons provide a variety of button customization options, such as color, language, shape, and multiple button layout. <a href=\"%s\">Learn more about Smart Payment Buttons</a>."
947
  msgstr ""
948
 
949
- #: includes/settings/settings-ppec.php:509
950
  msgid "Button Color"
951
  msgstr ""
952
 
953
- #: includes/settings/settings-ppec.php:514
954
  msgid "Controls the background color of the primary button. Use \"Gold\" to leverage PayPal's recognition and preference, or change it to match your site design or aesthetic."
955
  msgstr ""
956
 
957
- #: includes/settings/settings-ppec.php:516
958
  msgid "Gold (Recommended)"
959
  msgstr ""
960
 
961
- #: includes/settings/settings-ppec.php:517
962
  msgid "Blue"
963
  msgstr ""
964
 
965
- #: includes/settings/settings-ppec.php:518
966
  msgid "Silver"
967
  msgstr ""
968
 
969
- #: includes/settings/settings-ppec.php:519
970
  msgid "Black"
971
  msgstr ""
972
 
973
- #: includes/settings/settings-ppec.php:523
974
  msgid "Button Shape"
975
  msgstr ""
976
 
977
- #: includes/settings/settings-ppec.php:528
978
  msgid "The pill-shaped button's unique and powerful shape signifies PayPal in people's minds. Use the rectangular button as an alternative when pill-shaped buttons might pose design challenges."
979
  msgstr ""
980
 
981
- #: includes/settings/settings-ppec.php:530
982
  msgid "Pill"
983
  msgstr ""
984
 
985
- #: includes/settings/settings-ppec.php:531
986
  msgid "Rectangle"
987
  msgstr ""
988
 
989
- #: includes/settings/settings-ppec.php:541
990
  msgid "Button Layout"
991
  msgstr ""
992
 
993
- #: includes/settings/settings-ppec.php:546
994
  msgid "If additional funding sources are available to the buyer through PayPal, such as Venmo, then multiple buttons are displayed in the space provided. Choose \"vertical\" for a dynamic list of alternative and local payment options, or \"horizontal\" when space is limited."
995
  msgstr ""
996
 
997
- #: includes/settings/settings-ppec.php:548
998
  msgid "Vertical"
999
  msgstr ""
1000
 
1001
- #: includes/settings/settings-ppec.php:549
1002
  msgid "Horizontal"
1003
  msgstr ""
1004
 
1005
- #: includes/settings/settings-ppec.php:553
1006
  msgid "Button Size"
1007
  msgstr ""
1008
 
1009
- #: includes/settings/settings-ppec.php:558
1010
  msgid "PayPal offers different sizes of the \"PayPal Checkout\" buttons, allowing you to select a size that best fits your site's theme. This setting will allow you to choose which size button(s) appear on your cart page. (The \"Responsive\" option adjusts to container size, and is available and recommended for Smart Payment Buttons.)"
1011
  msgstr ""
1012
 
1013
- #: includes/settings/settings-ppec.php:560
1014
  msgid "Responsive"
1015
  msgstr ""
1016
 
1017
- #: includes/settings/settings-ppec.php:561
1018
  msgid "Small"
1019
  msgstr ""
1020
 
1021
- #: includes/settings/settings-ppec.php:562
1022
  msgid "Medium"
1023
  msgstr ""
1024
 
1025
- #: includes/settings/settings-ppec.php:563
1026
  msgid "Large"
1027
  msgstr ""
1028
 
1029
- #: includes/settings/settings-ppec.php:572
1030
  msgid "Hides the specified funding methods."
1031
  msgstr ""
1032
 
1033
- #: includes/settings/settings-ppec.php:575
1034
  msgid "ELV"
1035
  msgstr ""
1036
 
1037
- #: includes/settings/settings-ppec.php:576
1038
  msgid "Credit Card"
1039
  msgstr ""
1040
 
1041
- #: includes/settings/settings-ppec.php:599
1042
  msgid "Checkout on cart page"
1043
  msgstr ""
1044
 
1045
- #: includes/settings/settings-ppec.php:602
1046
  msgid "Enable PayPal Checkout on the cart page"
1047
  msgstr ""
1048
 
1049
- #: includes/settings/settings-ppec.php:603
1050
  msgid "This shows or hides the PayPal Checkout button on the cart page."
1051
  msgstr ""
1052
 
1053
- #: includes/settings/settings-ppec.php:612
1054
  msgid "Mini-cart Button Settings"
1055
  msgstr ""
1056
 
1057
- #: includes/settings/settings-ppec.php:617
1058
- #: includes/settings/settings-ppec.php:648
1059
- #: includes/settings/settings-ppec.php:680
1060
  msgid "Configure Settings"
1061
  msgstr ""
1062
 
1063
- #: includes/settings/settings-ppec.php:618
1064
  msgid "Configure settings specific to mini-cart"
1065
  msgstr ""
1066
 
1067
- #: includes/settings/settings-ppec.php:623
1068
- #: includes/settings/settings-ppec.php:654
1069
- #: includes/settings/settings-ppec.php:686
1070
  msgid "Optionally override global button settings above and configure buttons for this context."
1071
  msgstr ""
1072
 
1073
- #: includes/settings/settings-ppec.php:634
1074
  msgid "Single Product Button Settings"
1075
  msgstr ""
1076
 
1077
- #: includes/settings/settings-ppec.php:639
1078
- #: includes/settings/settings-ppec.php:642
1079
  msgid "Checkout on Single Product"
1080
  msgstr ""
1081
 
1082
- #: includes/settings/settings-ppec.php:645
1083
  msgid "Enable PayPal Checkout on Single Product view."
1084
  msgstr ""
1085
 
1086
- #: includes/settings/settings-ppec.php:649
1087
  msgid "Configure settings specific to Single Product view"
1088
  msgstr ""
1089
 
1090
- #: includes/settings/settings-ppec.php:666
1091
  msgid "Regular Checkout Button Settings"
1092
  msgstr ""
1093
 
1094
- #: includes/settings/settings-ppec.php:671
1095
  msgid "PayPal Mark"
1096
  msgstr ""
1097
 
1098
- #: includes/settings/settings-ppec.php:674
1099
  msgid "Enable the PayPal Mark on regular checkout"
1100
  msgstr ""
1101
 
1102
- #: includes/settings/settings-ppec.php:675
1103
  msgid "This enables the PayPal mark, which can be shown on regular WooCommerce checkout to use PayPal Checkout like a regular WooCommerce gateway."
1104
  msgstr ""
1105
 
1106
- #: includes/settings/settings-ppec.php:681
1107
  msgid "Configure settings specific to regular checkout"
1108
  msgstr ""
1109
- #. Plugin Name of the plugin/theme
1110
- msgid "WooCommerce PayPal Checkout Gateway"
1111
- msgstr ""
1112
-
1113
- #. Plugin URI of the plugin/theme
1114
- msgid "https://woocommerce.com/products/woocommerce-gateway-paypal-express-checkout/"
1115
- msgstr ""
1116
-
1117
- #. Description of the plugin/theme
1118
- msgid "Accept all major credit and debit cards, plus Venmo and PayPal Credit in the US, presenting options in a customizable stack of payment buttons. Fast, seamless, and flexible."
1119
- msgstr ""
1120
-
1121
- #. Author of the plugin/theme
1122
- msgid "WooCommerce"
1123
- msgstr ""
1124
-
1125
- #. Author URI of the plugin/theme
1126
- msgid "https://woocommerce.com"
1127
- msgstr ""
1
+ # Copyright (C) 2020 WooCommerce
2
  # This file is distributed under the same license as the WooCommerce PayPal Checkout Gateway plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WooCommerce PayPal Checkout Gateway 1.6.21\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-gateway-paypal-express-checkout\n"
7
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
+ "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2020-04-14T16:21:37+10:00\n"
13
+ "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
+ "X-Generator: WP-CLI 2.4.0\n"
15
+ "X-Domain: woocommerce-gateway-paypal-express-checkout\n"
16
+
17
+ #. Plugin Name of the plugin
18
+ msgid "WooCommerce PayPal Checkout Gateway"
19
+ msgstr ""
20
+
21
+ #. Plugin URI of the plugin
22
+ msgid "https://woocommerce.com/products/woocommerce-gateway-paypal-express-checkout/"
23
+ msgstr ""
24
+
25
+ #. Description of the plugin
26
+ msgid "Accept all major credit and debit cards, plus Venmo and PayPal Credit in the US, presenting options in a customizable stack of payment buttons. Fast, seamless, and flexible."
27
+ msgstr ""
28
+
29
+ #. Author of the plugin
30
+ msgid "WooCommerce"
31
+ msgstr ""
32
+
33
+ #. Author URI of the plugin
34
+ msgid "https://woocommerce.com"
35
+ msgstr ""
36
 
37
  #: includes/abstracts/abstract-wc-gateway-ppec.php:18
38
  #: includes/class-wc-gateway-ppec-privacy.php:12
47
  msgid "Continue to payment"
48
  msgstr ""
49
 
50
+ #: includes/abstracts/abstract-wc-gateway-ppec.php:166
51
  msgid "Sorry, an error occurred while trying to process your payment. Please try again."
52
  msgstr ""
53
 
54
+ #: includes/abstracts/abstract-wc-gateway-ppec.php:199
55
  msgid "No API certificate on file."
56
  msgstr ""
57
 
 
 
 
 
 
58
  #: includes/abstracts/abstract-wc-gateway-ppec.php:208
59
+ msgid "expires on %s (%s)"
60
  msgstr ""
61
 
62
  #: includes/abstracts/abstract-wc-gateway-ppec.php:212
63
+ msgid "expired on %s (%s)"
64
+ msgstr ""
65
+
66
+ #: includes/abstracts/abstract-wc-gateway-ppec.php:222
67
+ msgid "Certificate belongs to API username %1$s; %2$s."
68
  msgstr ""
69
 
70
+ #: includes/abstracts/abstract-wc-gateway-ppec.php:224
71
  msgid "The certificate on file is not valid."
72
  msgstr ""
73
 
74
+ #: includes/abstracts/abstract-wc-gateway-ppec.php:284
75
  msgid "Error: You must enter API password."
76
  msgstr ""
77
 
78
+ #: includes/abstracts/abstract-wc-gateway-ppec.php:295
79
+ #: includes/abstracts/abstract-wc-gateway-ppec.php:329
80
  msgid "Error: The API credentials you provided are not valid. Please double-check that you entered them correctly and try again."
81
  msgstr ""
82
 
83
+ #: includes/abstracts/abstract-wc-gateway-ppec.php:300
84
+ #: includes/abstracts/abstract-wc-gateway-ppec.php:333
85
  msgid "An error occurred while trying to validate your API credentials. Unable to verify that your API credentials are correct."
86
  msgstr ""
87
 
88
+ #: includes/abstracts/abstract-wc-gateway-ppec.php:307
89
  msgid "Error: The API certificate is not valid."
90
  msgstr ""
91
 
92
+ #: includes/abstracts/abstract-wc-gateway-ppec.php:315
93
  msgid "Error: The API certificate has expired."
94
  msgstr ""
95
 
96
+ #: includes/abstracts/abstract-wc-gateway-ppec.php:320
97
  msgid "Error: The API username does not match the name in the API certificate. Make sure that you have the correct API certificate."
98
  msgstr ""
99
 
100
+ #: includes/abstracts/abstract-wc-gateway-ppec.php:338
101
  msgid "Error: You must provide API signature or certificate."
102
  msgstr ""
103
 
104
+ #: includes/abstracts/abstract-wc-gateway-ppec.php:356
105
  msgid "The \"require billing address\" option is not enabled by your account and has been disabled."
106
  msgstr ""
107
 
108
+ #: includes/abstracts/abstract-wc-gateway-ppec.php:375
109
  msgid "Refund Error: You need to specify a refund amount."
110
  msgstr ""
111
 
112
+ #: includes/abstracts/abstract-wc-gateway-ppec.php:395
113
+ #: includes/abstracts/abstract-wc-gateway-ppec.php:418
114
+ #: includes/abstracts/abstract-wc-gateway-ppec.php:468
115
  msgid "PayPal refund completed; transaction ID = %s"
116
  msgstr ""
117
 
118
+ #: includes/abstracts/abstract-wc-gateway-ppec.php:442
119
  msgid "Refund Error: All transactions have been fully refunded. There is no amount left to refund"
120
  msgstr ""
121
 
122
+ #: includes/abstracts/abstract-wc-gateway-ppec.php:444
123
  msgid "Refund Error: The requested refund amount is too large. The refund amount must be less than or equal to %s."
124
  msgstr ""
125
 
126
+ #: includes/abstracts/abstract-wc-gateway-ppec.php:559
127
  msgid "Already using URL as image: %s"
128
  msgstr ""
129
 
130
+ #: includes/abstracts/abstract-wc-gateway-ppec.php:567
131
  msgid "Select a image to upload"
132
  msgstr ""
133
 
134
+ #: includes/abstracts/abstract-wc-gateway-ppec.php:568
135
  msgid "Use this image"
136
  msgstr ""
137
 
138
+ #: includes/abstracts/abstract-wc-gateway-ppec.php:569
139
+ #: includes/abstracts/abstract-wc-gateway-ppec.php:572
140
  msgid "Add image"
141
  msgstr ""
142
 
143
+ #: includes/abstracts/abstract-wc-gateway-ppec.php:580
144
  msgid "Remove image"
145
  msgstr ""
146
 
147
+ #: includes/abstracts/abstract-wc-gateway-ppec.php:619
148
+ msgid "Remove"
149
+ msgstr ""
150
+
151
  #: includes/class-wc-gateway-ppec-admin-handler.php:62
152
  msgid "Capture Charge"
153
  msgstr ""
156
  msgid "NOTE: PayPal does not accept decimal places for the currency in which you are transacting. The \"Number of Decimals\" option in WooCommerce has automatically been set to 0 for you."
157
  msgstr ""
158
 
159
+ #: includes/class-wc-gateway-ppec-admin-handler.php:181
160
  msgid "Unable to capture charge!"
161
  msgstr ""
162
 
163
+ #: includes/class-wc-gateway-ppec-admin-handler.php:189
164
  msgid "PayPal Checkout charge complete (Charge ID: %s)"
165
  msgstr ""
166
 
167
+ #: includes/class-wc-gateway-ppec-admin-handler.php:231
168
  msgid "Unable to void charge!"
169
  msgstr ""
170
 
171
+ #: includes/class-wc-gateway-ppec-admin-handler.php:233
172
  msgid "PayPal Checkout charge voided (Charge ID: %s)"
173
  msgstr ""
174
 
175
+ #: includes/class-wc-gateway-ppec-admin-handler.php:340
176
  msgid "This represents the fee PayPal collects for the transaction."
177
  msgstr ""
178
 
179
+ #: includes/class-wc-gateway-ppec-admin-handler.php:341
180
  msgid "PayPal Fee:"
181
  msgstr ""
182
 
183
+ #: includes/class-wc-gateway-ppec-admin-handler.php:350
184
  msgid "This represents the net total that will be credited to your PayPal account. This may be in a different currency than is set in your PayPal account."
185
  msgstr ""
186
 
187
+ #: includes/class-wc-gateway-ppec-admin-handler.php:351
188
  msgid "PayPal Payout:"
189
  msgstr ""
190
 
191
+ #: includes/class-wc-gateway-ppec-admin-handler.php:386
192
  msgid "%1$sWarning!%2$s PayPal Checkout will drop support for WooCommerce %3$s in a soon to be released update. To continue using PayPal Checkout please %4$supdate to %1$sWooCommerce 3.0%2$s or greater%5$s."
193
  msgstr ""
194
 
292
  msgstr ""
293
 
294
  #: includes/class-wc-gateway-ppec-cart-handler.php:314
295
+ #: includes/class-wc-gateway-ppec-cart-handler.php:359
296
+ #: includes/class-wc-gateway-ppec-cart-handler.php:394
297
  msgid "Check out with PayPal"
298
  msgstr ""
299
 
300
+ #: includes/class-wc-gateway-ppec-cart-handler.php:349
301
  msgid "&mdash; or &mdash;"
302
  msgstr ""
303
 
304
+ #: includes/class-wc-gateway-ppec-cart-handler.php:364
305
  msgid "Pay with PayPal Credit"
306
  msgstr ""
307
 
308
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:77
309
  msgid "Confirm your PayPal order"
310
  msgstr ""
311
 
312
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:258
313
  msgid "Billing details"
314
  msgstr ""
315
 
316
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:261
317
  msgid "Address:"
318
  msgstr ""
319
 
320
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:263
321
  msgid "Name:"
322
  msgstr ""
323
 
324
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:267
325
  msgid "Email:"
326
  msgstr ""
327
 
328
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:273
329
  msgid "Phone:"
330
  msgstr ""
331
 
332
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:297
333
  msgid "Create an account?"
334
  msgstr ""
335
 
336
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:306
337
  msgid "Create an account by entering the information below. If you are a returning customer please login at the top of the page."
338
  msgstr ""
339
 
340
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:346
341
  msgid "Shipping details"
342
  msgstr ""
343
 
344
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:444
345
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:498
346
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:1156
347
  msgid "Your PayPal checkout session has expired. Please check out again."
348
  msgstr ""
349
 
350
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:493
351
  msgid "Sorry, an error occurred while trying to retrieve your information from PayPal. Please try again."
352
  msgstr ""
353
 
354
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:601
355
  msgid "Cancel"
356
  msgstr ""
357
 
358
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:624
359
  msgid "You have cancelled Checkout with PayPal. Please try to process your order again."
360
  msgstr ""
361
 
362
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:983
363
  #: includes/class-wc-gateway-ppec-ipn-handler.php:190
364
  msgid "Payment authorized. Change payment status to processing or complete to capture funds."
365
  msgstr ""
366
 
367
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:985
368
  #: includes/class-wc-gateway-ppec-ipn-handler.php:192
369
  msgid "Payment pending (%s)."
370
  msgstr ""
371
 
372
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:1167
373
  msgid "The payment method was updated for this subscription."
374
  msgstr ""
375
 
376
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:1172
377
  msgid "The payment method was updated for all your current subscriptions."
378
  msgstr ""
379
 
380
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:1181
381
  msgid "There was a problem updating your payment method. Please try again later or use a different payment method."
382
  msgstr ""
383
 
384
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:1204
385
  msgid "You have cancelled Checkout with PayPal. The payment method was not updated."
386
  msgstr ""
387
 
426
  msgid "Malformed response received from PayPal"
427
  msgstr ""
428
 
 
 
 
 
 
 
 
429
  #: includes/class-wc-gateway-ppec-ipn-handler.php:29
430
  msgid "Empty POST data."
431
  msgstr ""
501
  msgid "Success! Your PayPal account has been set up successfully."
502
  msgstr ""
503
 
504
+ #: includes/class-wc-gateway-ppec-plugin.php:157
505
  msgid "%s in WooCommerce Gateway PayPal Checkout plugin can only be called once"
506
  msgstr ""
507
 
529
  msgid "PayPal Checkout is almost ready. To get started, <a href=\"%s\">connect your PayPal account</a>."
530
  msgstr ""
531
 
532
+ #: includes/class-wc-gateway-ppec-plugin.php:450
533
  msgid "Settings"
534
  msgstr ""
535
 
536
+ #: includes/class-wc-gateway-ppec-plugin.php:453
537
  msgid "Docs"
538
  msgstr ""
539
 
571
  msgid "Subscriptions"
572
  msgstr ""
573
 
 
 
 
 
574
  #: includes/class-wc-gateway-ppec-privacy.php:245
575
  msgid "PayPal Checkout Subscriptions Data Erased."
576
  msgstr ""
584
  msgstr ""
585
 
586
  #. translators: placeholder is pending reason from PayPal API.
 
587
  #: includes/class-wc-gateway-ppec-with-paypal-addons.php:204
588
  msgid "PayPal transaction held: %s"
589
  msgstr ""
597
  msgstr ""
598
 
599
  #: includes/class-wc-gateway-ppec-with-paypal-credit.php:15
600
+ #: includes/settings/settings-ppec.php:586
601
  msgid "PayPal Credit"
602
  msgstr ""
603
 
607
  msgstr ""
608
 
609
  #. translators: placeholders are error code and message from PayPal
 
610
  #: includes/exceptions/class-wc-gateway-ppec-api-exception.php:64
611
  msgid "PayPal error (%1$s): %2$s"
612
  msgstr ""
623
  msgid "%s or <a href=\"#\" class=\"ppec-toggle-settings\">click here to toggle manual API credential input</a>."
624
  msgstr ""
625
 
626
+ #. Translators: Placeholders are opening an closing link HTML tags.
627
+ #: includes/settings/settings-ppec.php:29
628
+ msgid "To reset current credentials and use another account %1$sclick here%2$s. %3$sLearn more about your API Credentials%2$s."
629
  msgstr ""
630
 
631
+ #. Translators: Placeholders are opening an closing link HTML tags.
632
+ #. Translators: Placeholders are opening and closing link HTML tags.
633
+ #: includes/settings/settings-ppec.php:30
634
+ #: includes/settings/settings-ppec.php:52
635
  msgid "Reset current credentials"
636
  msgstr ""
637
 
638
+ #: includes/settings/settings-ppec.php:32
639
+ #: includes/settings/settings-ppec.php:54
640
+ msgid "Learn more"
641
  msgstr ""
642
 
643
+ #: includes/settings/settings-ppec.php:37
644
+ msgid "Setup or link an existing PayPal Sandbox account"
645
  msgstr ""
646
 
647
+ #: includes/settings/settings-ppec.php:38
648
+ msgid "%s or <a href=\"#\" class=\"ppec-toggle-sandbox-settings\">click here to toggle manual API credential input</a>."
649
  msgstr ""
650
 
651
+ #. Translators: Placeholders are opening and closing link HTML tags.
652
+ #: includes/settings/settings-ppec.php:51
653
+ msgid "Your account setting is set to sandbox, no real charging takes place. To accept live payments, switch your environment to live and connect your PayPal account. To reset current credentials and use other sandbox account %1$sclick here%2$s. %3$sLearn more about your API Credentials%2$s."
654
  msgstr ""
655
 
656
+ #: includes/settings/settings-ppec.php:58
657
+ #: includes/settings/settings-ppec.php:592
658
  msgid "Enable PayPal Credit"
659
  msgstr ""
660
 
661
+ #: includes/settings/settings-ppec.php:60
662
  msgid "This option is disabled. Currently PayPal Credit only available for U.S. merchants using USD currency."
663
  msgstr ""
664
 
665
+ #: includes/settings/settings-ppec.php:63
666
  msgid "This enables PayPal Credit, which displays a PayPal Credit button next to the primary PayPal Checkout button. PayPal Checkout lets you give customers access to financing through PayPal Credit® - at no additional cost to you. You get paid up front, even though customers have more time to pay. A pre-integrated payment button shows up next to the PayPal Button, and lets customers pay quickly with PayPal Credit®. (Should be unchecked for stores involved in Real Money Gaming.)"
667
  msgstr ""
668
 
669
+ #: includes/settings/settings-ppec.php:267
670
  msgid "Enable/Disable"
671
  msgstr ""
672
 
673
+ #: includes/settings/settings-ppec.php:269
674
  msgid "Enable PayPal Checkout"
675
  msgstr ""
676
 
677
+ #: includes/settings/settings-ppec.php:270
678
  msgid "This enables PayPal Checkout which allows customers to checkout directly via PayPal from your cart page."
679
  msgstr ""
680
 
681
+ #: includes/settings/settings-ppec.php:276
682
  msgid "Title"
683
  msgstr ""
684
 
685
+ #: includes/settings/settings-ppec.php:278
686
  msgid "This controls the title which the user sees during checkout."
687
  msgstr ""
688
 
689
+ #: includes/settings/settings-ppec.php:279
690
  msgid "PayPal"
691
  msgstr ""
692
 
693
+ #: includes/settings/settings-ppec.php:283
694
  msgid "Description"
695
  msgstr ""
696
 
697
+ #: includes/settings/settings-ppec.php:286
698
  msgid "This controls the description which the user sees during checkout."
699
  msgstr ""
700
 
701
+ #: includes/settings/settings-ppec.php:287
702
  msgid "Pay via PayPal; you can pay with your credit card if you don't have a PayPal account."
703
  msgstr ""
704
 
705
+ #: includes/settings/settings-ppec.php:291
706
  msgid "Account Settings"
707
  msgstr ""
708
 
709
+ #: includes/settings/settings-ppec.php:296
710
  msgid "Environment"
711
  msgstr ""
712
 
713
+ #: includes/settings/settings-ppec.php:299
714
  msgid "This setting specifies whether you will process live transactions, or whether you will process simulated transactions using the PayPal Sandbox."
715
  msgstr ""
716
 
717
+ #: includes/settings/settings-ppec.php:303
718
  msgid "Live"
719
  msgstr ""
720
 
721
+ #: includes/settings/settings-ppec.php:304
722
  msgid "Sandbox"
723
  msgstr ""
724
 
725
+ #: includes/settings/settings-ppec.php:309
726
  msgid "API Credentials"
727
  msgstr ""
728
 
729
+ #: includes/settings/settings-ppec.php:314
730
  msgid "Live API Username"
731
  msgstr ""
732
 
733
+ #: includes/settings/settings-ppec.php:316
734
+ #: includes/settings/settings-ppec.php:323
735
+ #: includes/settings/settings-ppec.php:330
736
+ #: includes/settings/settings-ppec.php:358
737
+ #: includes/settings/settings-ppec.php:365
738
+ #: includes/settings/settings-ppec.php:372
 
739
  msgid "Get your API credentials from PayPal."
740
  msgstr ""
741
 
742
+ #: includes/settings/settings-ppec.php:321
743
  msgid "Live API Password"
744
  msgstr ""
745
 
746
+ #: includes/settings/settings-ppec.php:328
747
  msgid "Live API Signature"
748
  msgstr ""
749
 
750
+ #: includes/settings/settings-ppec.php:333
751
+ #: includes/settings/settings-ppec.php:375
752
  msgid "Optional if you provide a certificate below"
753
  msgstr ""
754
 
755
+ #: includes/settings/settings-ppec.php:336
756
  msgid "Live API Certificate"
757
  msgstr ""
758
 
759
+ #: includes/settings/settings-ppec.php:342
760
  msgid "Live API Subject"
761
  msgstr ""
762
 
763
+ #: includes/settings/settings-ppec.php:344
764
+ #: includes/settings/settings-ppec.php:386
765
  msgid "If you're processing transactions on behalf of someone else's PayPal account, enter their email address or Secure Merchant Account ID (also known as a Payer ID) here. Generally, you must have API permissions in place with the other account in order to process anything other than \"sale\" transactions for them."
766
  msgstr ""
767
 
768
+ #: includes/settings/settings-ppec.php:347
769
+ #: includes/settings/settings-ppec.php:389
770
+ #: includes/settings/settings-ppec.php:410
771
+ #: includes/settings/settings-ppec.php:418
772
+ #: includes/settings/settings-ppec.php:426
773
  msgid "Optional"
774
  msgstr ""
775
 
776
+ #: includes/settings/settings-ppec.php:351
777
  msgid "Sandbox API Credentials"
778
  msgstr ""
779
 
780
+ #: includes/settings/settings-ppec.php:356
781
  msgid "Sandbox API Username"
782
  msgstr ""
783
 
784
+ #: includes/settings/settings-ppec.php:363
785
  msgid "Sandbox API Password"
786
  msgstr ""
787
 
788
+ #: includes/settings/settings-ppec.php:370
789
  msgid "Sandbox API Signature"
790
  msgstr ""
791
 
792
+ #: includes/settings/settings-ppec.php:378
793
  msgid "Sandbox API Certificate"
794
  msgstr ""
795
 
796
+ #: includes/settings/settings-ppec.php:384
797
  msgid "Sandbox API Subject"
798
  msgstr ""
799
 
800
+ #: includes/settings/settings-ppec.php:393
801
  msgid "PayPal-hosted Checkout Settings"
802
  msgstr ""
803
 
804
+ #: includes/settings/settings-ppec.php:395
805
  msgid "Customize the appearance of PayPal Checkout on the PayPal side."
806
  msgstr ""
807
 
808
+ #: includes/settings/settings-ppec.php:398
809
  msgid "Brand Name"
810
  msgstr ""
811
 
812
+ #: includes/settings/settings-ppec.php:400
813
  msgid "A label that overrides the business name in the PayPal account on the PayPal hosted checkout pages."
814
  msgstr ""
815
 
816
+ #: includes/settings/settings-ppec.php:405
817
  msgid "Logo Image (190×60)"
818
  msgstr ""
819
 
820
+ #: includes/settings/settings-ppec.php:407
821
  msgid "If you want PayPal to co-brand the checkout page with your logo, enter the URL of your logo image here.<br/>The image must be no larger than 190x60, GIF, PNG, or JPG format, and should be served over HTTPS."
822
  msgstr ""
823
 
824
+ #: includes/settings/settings-ppec.php:413
825
  msgid "Header Image (750×90)"
826
  msgstr ""
827
 
828
+ #: includes/settings/settings-ppec.php:415
829
  msgid "If you want PayPal to co-brand the checkout page with your header, enter the URL of your header image here.<br/>The image must be no larger than 750x90, GIF, PNG, or JPG format, and should be served over HTTPS."
830
  msgstr ""
831
 
832
+ #: includes/settings/settings-ppec.php:421
833
  msgid "Page Style"
834
  msgstr ""
835
 
836
+ #: includes/settings/settings-ppec.php:423
837
  msgid "Optionally enter the name of the page style you wish to use. These are defined within your PayPal account."
838
  msgstr ""
839
 
840
+ #: includes/settings/settings-ppec.php:429
841
  msgid "Landing Page"
842
  msgstr ""
843
 
844
+ #: includes/settings/settings-ppec.php:432
845
  msgid "Type of PayPal page to display."
846
  msgstr ""
847
 
848
+ #: includes/settings/settings-ppec.php:436
849
  msgctxt "Type of PayPal page"
850
  msgid "Billing (Non-PayPal account)"
851
  msgstr ""
852
 
853
+ #: includes/settings/settings-ppec.php:437
854
  msgctxt "Type of PayPal page"
855
  msgid "Login (PayPal account login)"
856
  msgstr ""
857
 
858
+ #: includes/settings/settings-ppec.php:442
859
  msgid "Advanced Settings"
860
  msgstr ""
861
 
862
+ #: includes/settings/settings-ppec.php:447
863
  msgid "Debug Log"
864
  msgstr ""
865
 
866
+ #: includes/settings/settings-ppec.php:449
867
  msgid "Enable Logging"
868
  msgstr ""
869
 
870
+ #: includes/settings/settings-ppec.php:452
871
  msgid "Log PayPal events, such as IPN requests."
872
  msgstr ""
873
 
874
+ #: includes/settings/settings-ppec.php:455
875
  msgid "Invoice Prefix"
876
  msgstr ""
877
 
878
+ #: includes/settings/settings-ppec.php:457
879
  msgid "Please enter a prefix for your invoice numbers. If you use your PayPal account for multiple stores ensure this prefix is unique as PayPal will not allow orders with the same invoice number."
880
  msgstr ""
881
 
882
+ #: includes/settings/settings-ppec.php:462
883
  msgid "Billing Addresses"
884
  msgstr ""
885
 
886
+ #: includes/settings/settings-ppec.php:464
887
  msgid "Require Billing Address"
888
  msgstr ""
889
 
890
+ #: includes/settings/settings-ppec.php:466
891
  msgid "PayPal only returns a shipping address back to the website. To make sure billing address is returned as well, please enable this functionality on your PayPal account by calling %1$sPayPal Technical Support%2$s."
892
  msgstr ""
893
 
894
+ #: includes/settings/settings-ppec.php:469
895
+ #: includes/settings/settings-ppec.php:471
896
  msgid "Require Phone Number"
897
  msgstr ""
898
 
899
+ #: includes/settings/settings-ppec.php:473
900
  msgid "Require buyer to enter their telephone number during checkout if none is provided by PayPal"
901
  msgstr ""
902
 
903
+ #: includes/settings/settings-ppec.php:476
904
  msgid "Payment Action"
905
  msgstr ""
906
 
907
+ #: includes/settings/settings-ppec.php:479
908
  msgid "Choose whether you wish to capture funds immediately or authorize payment only."
909
  msgstr ""
910
 
911
+ #: includes/settings/settings-ppec.php:483
912
  msgid "Sale"
913
  msgstr ""
914
 
915
+ #: includes/settings/settings-ppec.php:484
916
  msgid "Authorize"
917
  msgstr ""
918
 
919
+ #: includes/settings/settings-ppec.php:488
920
  msgid "Instant Payments"
921
  msgstr ""
922
 
923
+ #: includes/settings/settings-ppec.php:490
924
  msgid "Require Instant Payment"
925
  msgstr ""
926
 
927
+ #: includes/settings/settings-ppec.php:493
928
  msgid "If you enable this setting, PayPal will be instructed not to allow the buyer to use funding sources that take additional time to complete (for example, eChecks). Instead, the buyer will be required to use an instant funding source, such as an instant transfer, a credit/debit card, or PayPal Credit."
929
  msgstr ""
930
 
931
+ #: includes/settings/settings-ppec.php:496
932
  msgid "Subtotal Mismatch Behavior"
933
  msgstr ""
934
 
935
+ #: includes/settings/settings-ppec.php:499
936
  msgid "Internally, WC calculates line item prices and taxes out to four decimal places; however, PayPal can only handle amounts out to two decimal places (or, depending on the currency, no decimal places at all). Occasionally, this can cause discrepancies between the way WooCommerce calculates prices versus the way PayPal calculates them. If a mismatch occurs, this option controls how the order is dealt with so payment can still be taken."
937
  msgstr ""
938
 
939
+ #: includes/settings/settings-ppec.php:503
940
  msgid "Add another line item"
941
  msgstr ""
942
 
943
+ #: includes/settings/settings-ppec.php:504
944
  msgid "Do not send line items to PayPal"
945
  msgstr ""
946
 
947
+ #: includes/settings/settings-ppec.php:509
948
  msgid "Button Settings"
949
  msgstr ""
950
 
951
+ #: includes/settings/settings-ppec.php:511
952
  msgid "Customize the appearance of PayPal Checkout on your site."
953
  msgstr ""
954
 
955
+ #: includes/settings/settings-ppec.php:514
956
  msgid "Smart Payment Buttons"
957
  msgstr ""
958
 
959
+ #: includes/settings/settings-ppec.php:517
960
  msgid "Use Smart Payment Buttons"
961
  msgstr ""
962
 
963
+ #: includes/settings/settings-ppec.php:518
964
  msgid "PayPal Checkout's Smart Payment Buttons provide a variety of button customization options, such as color, language, shape, and multiple button layout. <a href=\"%s\">Learn more about Smart Payment Buttons</a>."
965
  msgstr ""
966
 
967
+ #: includes/settings/settings-ppec.php:521
968
  msgid "Button Color"
969
  msgstr ""
970
 
971
+ #: includes/settings/settings-ppec.php:526
972
  msgid "Controls the background color of the primary button. Use \"Gold\" to leverage PayPal's recognition and preference, or change it to match your site design or aesthetic."
973
  msgstr ""
974
 
975
+ #: includes/settings/settings-ppec.php:528
976
  msgid "Gold (Recommended)"
977
  msgstr ""
978
 
979
+ #: includes/settings/settings-ppec.php:529
980
  msgid "Blue"
981
  msgstr ""
982
 
983
+ #: includes/settings/settings-ppec.php:530
984
  msgid "Silver"
985
  msgstr ""
986
 
987
+ #: includes/settings/settings-ppec.php:531
988
  msgid "Black"
989
  msgstr ""
990
 
991
+ #: includes/settings/settings-ppec.php:535
992
  msgid "Button Shape"
993
  msgstr ""
994
 
995
+ #: includes/settings/settings-ppec.php:540
996
  msgid "The pill-shaped button's unique and powerful shape signifies PayPal in people's minds. Use the rectangular button as an alternative when pill-shaped buttons might pose design challenges."
997
  msgstr ""
998
 
999
+ #: includes/settings/settings-ppec.php:542
1000
  msgid "Pill"
1001
  msgstr ""
1002
 
1003
+ #: includes/settings/settings-ppec.php:543
1004
  msgid "Rectangle"
1005
  msgstr ""
1006
 
1007
+ #: includes/settings/settings-ppec.php:553
1008
  msgid "Button Layout"
1009
  msgstr ""
1010
 
1011
+ #: includes/settings/settings-ppec.php:558
1012
  msgid "If additional funding sources are available to the buyer through PayPal, such as Venmo, then multiple buttons are displayed in the space provided. Choose \"vertical\" for a dynamic list of alternative and local payment options, or \"horizontal\" when space is limited."
1013
  msgstr ""
1014
 
1015
+ #: includes/settings/settings-ppec.php:560
1016
  msgid "Vertical"
1017
  msgstr ""
1018
 
1019
+ #: includes/settings/settings-ppec.php:561
1020
  msgid "Horizontal"
1021
  msgstr ""
1022
 
1023
+ #: includes/settings/settings-ppec.php:565
1024
  msgid "Button Size"
1025
  msgstr ""
1026
 
1027
+ #: includes/settings/settings-ppec.php:570
1028
  msgid "PayPal offers different sizes of the \"PayPal Checkout\" buttons, allowing you to select a size that best fits your site's theme. This setting will allow you to choose which size button(s) appear on your cart page. (The \"Responsive\" option adjusts to container size, and is available and recommended for Smart Payment Buttons.)"
1029
  msgstr ""
1030
 
1031
+ #: includes/settings/settings-ppec.php:572
1032
  msgid "Responsive"
1033
  msgstr ""
1034
 
1035
+ #: includes/settings/settings-ppec.php:573
1036
  msgid "Small"
1037
  msgstr ""
1038
 
1039
+ #: includes/settings/settings-ppec.php:574
1040
  msgid "Medium"
1041
  msgstr ""
1042
 
1043
+ #: includes/settings/settings-ppec.php:575
1044
  msgid "Large"
1045
  msgstr ""
1046
 
1047
+ #: includes/settings/settings-ppec.php:584
1048
  msgid "Hides the specified funding methods."
1049
  msgstr ""
1050
 
1051
+ #: includes/settings/settings-ppec.php:587
1052
  msgid "ELV"
1053
  msgstr ""
1054
 
1055
+ #: includes/settings/settings-ppec.php:588
1056
  msgid "Credit Card"
1057
  msgstr ""
1058
 
1059
+ #: includes/settings/settings-ppec.php:611
1060
  msgid "Checkout on cart page"
1061
  msgstr ""
1062
 
1063
+ #: includes/settings/settings-ppec.php:614
1064
  msgid "Enable PayPal Checkout on the cart page"
1065
  msgstr ""
1066
 
1067
+ #: includes/settings/settings-ppec.php:615
1068
  msgid "This shows or hides the PayPal Checkout button on the cart page."
1069
  msgstr ""
1070
 
1071
+ #: includes/settings/settings-ppec.php:624
1072
  msgid "Mini-cart Button Settings"
1073
  msgstr ""
1074
 
1075
+ #: includes/settings/settings-ppec.php:629
1076
+ #: includes/settings/settings-ppec.php:660
1077
+ #: includes/settings/settings-ppec.php:692
1078
  msgid "Configure Settings"
1079
  msgstr ""
1080
 
1081
+ #: includes/settings/settings-ppec.php:630
1082
  msgid "Configure settings specific to mini-cart"
1083
  msgstr ""
1084
 
1085
+ #: includes/settings/settings-ppec.php:635
1086
+ #: includes/settings/settings-ppec.php:666
1087
+ #: includes/settings/settings-ppec.php:698
1088
  msgid "Optionally override global button settings above and configure buttons for this context."
1089
  msgstr ""
1090
 
1091
+ #: includes/settings/settings-ppec.php:646
1092
  msgid "Single Product Button Settings"
1093
  msgstr ""
1094
 
1095
+ #: includes/settings/settings-ppec.php:651
1096
+ #: includes/settings/settings-ppec.php:654
1097
  msgid "Checkout on Single Product"
1098
  msgstr ""
1099
 
1100
+ #: includes/settings/settings-ppec.php:657
1101
  msgid "Enable PayPal Checkout on Single Product view."
1102
  msgstr ""
1103
 
1104
+ #: includes/settings/settings-ppec.php:661
1105
  msgid "Configure settings specific to Single Product view"
1106
  msgstr ""
1107
 
1108
+ #: includes/settings/settings-ppec.php:678
1109
  msgid "Regular Checkout Button Settings"
1110
  msgstr ""
1111
 
1112
+ #: includes/settings/settings-ppec.php:683
1113
  msgid "PayPal Mark"
1114
  msgstr ""
1115
 
1116
+ #: includes/settings/settings-ppec.php:686
1117
  msgid "Enable the PayPal Mark on regular checkout"
1118
  msgstr ""
1119
 
1120
+ #: includes/settings/settings-ppec.php:687
1121
  msgid "This enables the PayPal mark, which can be shown on regular WooCommerce checkout to use PayPal Checkout like a regular WooCommerce gateway."
1122
  msgstr ""
1123
 
1124
+ #: includes/settings/settings-ppec.php:693
1125
  msgid "Configure settings specific to regular checkout"
1126
  msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: automattic, woothemes, akeda, dwainm, royho, allendav, slash1andy,
3
  Tags: ecommerce, e-commerce, commerce, woothemes, wordpress ecommerce, store, sales, sell, shop, shopping, cart, checkout, configurable, paypal
4
  Requires at least: 4.4
5
  Tested up to: 5.3
6
- Stable tag: 1.6.20
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -101,6 +101,20 @@ Please use this to inform us about bugs, or make contributions via PRs.
101
 
102
  == Changelog ==
103
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  = 1.6.20 - 2020-02-18 =
105
  * Fix - Upgrade the plugin on plugins loaded rather than on plugin init. PR#682
106
 
3
  Tags: ecommerce, e-commerce, commerce, woothemes, wordpress ecommerce, store, sales, sell, shop, shopping, cart, checkout, configurable, paypal
4
  Requires at least: 4.4
5
  Tested up to: 5.3
6
+ Stable tag: 1.6.21
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
101
 
102
  == Changelog ==
103
 
104
+ = 1.6.21 - 2020-04-14 =
105
+ * Fix - Ensure Puerto Rico and supported Locales are eligible for PayPal Credit. PR#693
106
+ * Fix - Support purchasing subscriptions with $0 initial payment - free trials, synced etc. PR#698
107
+ * Fix - Only make the billing fields optional during an active PayPal Checkout session. PR#697
108
+ * Fix - Uncaught JS errors on product page when viewing and out-of-stock product. PR#704
109
+ * Fix - Loading API certificates and improves managing certificate settings. PR#696
110
+ * Fix - Displaying PayPal Smart Payment buttons on pages with single product shortcode. PR#665
111
+ * Fix - Do not add discounts to total item amount and cause line item amount offset. PR#677
112
+ * Fix - Redirect to Confirm your PayPal Order page for subscriptions initial purchases using PayPal Smart Buttons. PR#702
113
+ * Fix - Display missing checkout notice when email format is incorrect. PR#708
114
+ * Add - Filter product form validity via a new `wc_ppec_validate_product_form` event. PR#695
115
+ * Add - Translation tables for states of more countries. PR#659
116
+ * Update - WooCommerce 4.0 compatibility
117
+
118
  = 1.6.20 - 2020-02-18 =
119
  * Fix - Upgrade the plugin on plugins loaded rather than on plugin init. PR#682
120
 
woocommerce-gateway-paypal-express-checkout.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WooCommerce PayPal Checkout Gateway
4
  * Plugin URI: https://woocommerce.com/products/woocommerce-gateway-paypal-express-checkout/
5
  * Description: Accept all major credit and debit cards, plus Venmo and PayPal Credit in the US, presenting options in a customizable stack of payment buttons. Fast, seamless, and flexible.
6
- * Version: 1.6.20
7
  * Author: WooCommerce
8
  * Author URI: https://woocommerce.com
9
  * Copyright: © 2019 WooCommerce / PayPal.
@@ -11,7 +11,7 @@
11
  * License URI: http://www.gnu.org/licenses/gpl-3.0.html
12
  * Text Domain: woocommerce-gateway-paypal-express-checkout
13
  * Domain Path: /languages
14
- * WC tested up to: 3.9
15
  * WC requires at least: 2.6
16
  */
17
  /**
@@ -27,7 +27,7 @@ if ( ! defined( 'ABSPATH' ) ) {
27
  exit; // Exit if accessed directly
28
  }
29
 
30
- define( 'WC_GATEWAY_PPEC_VERSION', '1.6.20' );
31
 
32
  /**
33
  * Return instance of WC_Gateway_PPEC_Plugin.
3
  * Plugin Name: WooCommerce PayPal Checkout Gateway
4
  * Plugin URI: https://woocommerce.com/products/woocommerce-gateway-paypal-express-checkout/
5
  * Description: Accept all major credit and debit cards, plus Venmo and PayPal Credit in the US, presenting options in a customizable stack of payment buttons. Fast, seamless, and flexible.
6
+ * Version: 1.6.21
7
  * Author: WooCommerce
8
  * Author URI: https://woocommerce.com
9
  * Copyright: © 2019 WooCommerce / PayPal.
11
  * License URI: http://www.gnu.org/licenses/gpl-3.0.html
12
  * Text Domain: woocommerce-gateway-paypal-express-checkout
13
  * Domain Path: /languages
14
+ * WC tested up to: 4.0
15
  * WC requires at least: 2.6
16
  */
17
  /**
27
  exit; // Exit if accessed directly
28
  }
29
 
30
+ define( 'WC_GATEWAY_PPEC_VERSION', '1.6.21' );
31
 
32
  /**
33
  * Return instance of WC_Gateway_PPEC_Plugin.