WooCommerce Square - Version 1.0.34

Version Description

  • 2018-11-07 =
  • Update - Fieldset tag to div tag in payment box to prevent unwanted styling.
  • Fix - Provide unique idempotency ID to the order instead of random unique number.
  • Update - WP tested up to version 5.0
Download this release

Release Info

Developer bor0
Plugin Icon 128x128 WooCommerce Square
Version 1.0.34
Comparing to
See all releases

Code changes from version 1.0.33 to 1.0.34

assets/js/wc-square-payments.js CHANGED
@@ -78,7 +78,7 @@
78
  html += '</ul>';
79
 
80
  // append it to DOM
81
- $( '.payment_method_square fieldset' ).eq(0).prepend( html );
82
  } else {
83
  var $form = $( 'form.woocommerce-checkout, form#order_review' );
84
 
@@ -101,7 +101,7 @@
101
  html += '</ul>';
102
 
103
  // append it to DOM
104
- $( '.payment_method_square fieldset' ).eq(0).prepend( html );
105
  }
106
  },
107
  inputStyles: $.parseJSON( square_params.payment_form_input_styles )
78
  html += '</ul>';
79
 
80
  // append it to DOM
81
+ $( '.payment_method_square .sq-fieldset' ).eq(0).prepend( html );
82
  } else {
83
  var $form = $( 'form.woocommerce-checkout, form#order_review' );
84
 
101
  html += '</ul>';
102
 
103
  // append it to DOM
104
+ $( '.payment_method_square .sq-fieldset' ).eq(0).prepend( html );
105
  }
106
  },
107
  inputStyles: $.parseJSON( square_params.payment_form_input_styles )
assets/js/wc-square-payments.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){"use strict";var o;e.wc_square_payments={init:function(){e(document.body).on("updated_checkout",function(){e.wc_square_payments.loadForm()}),e("form#order_review").length&&e.wc_square_payments.loadForm();var o=square_params.custom_form_trigger_element;o.length&&e(document.body).on("click",o,function(){e.wc_square_payments.loadForm()}),e(document.body).on("click","#payment_method_square",function(){e(".payment_box.payment_method_square").css({display:"block",visibility:"visible",height:"auto"})})},loadForm:function(){e("#payment_method_square").length&&(e("#payment_method_square").is(":checked")||e(".payment_box.payment_method_square").css({display:"block",visibility:"hidden",height:"0"}),"object"===e.type(o)&&o.destroy(),(o=new SqPaymentForm({env:square_params.environment,applicationId:square_params.application_id,inputClass:"sq-input",cardNumber:{elementId:"sq-card-number",placeholder:square_params.placeholder_card_number},cvv:{elementId:"sq-cvv",placeholder:square_params.placeholder_card_cvv},expirationDate:{elementId:"sq-expiration-date",placeholder:square_params.placeholder_card_expiration},postalCode:{elementId:"sq-postal-code",placeholder:square_params.placeholder_card_postal_code},callbacks:{cardNonceResponseReceived:function(o,r,a){if(o){var t="";t+='<ul class="woocommerce_error woocommerce-error">',e(o).each(function(e,o){t+="<li>"+o.message+"</li>"}),t+="</ul>",e(".payment_method_square fieldset").eq(0).prepend(t)}else{var n=e("form.woocommerce-checkout, form#order_review");n.append('<input type="hidden" class="square-nonce" name="square_nonce" value="'+r+'" />'),n.submit()}},paymentFormLoaded:function(){o.setPostalCode(e("#billing_postcode").val())},unsupportedBrowserDetected:function(){var o="";o+='<ul class="woocommerce_error woocommerce-error">',o+="<li>"+square_params.unsupported_browser+"</li>",o+="</ul>",e(".payment_method_square fieldset").eq(0).prepend(o)}},inputStyles:e.parseJSON(square_params.payment_form_input_styles)})).build(),e("form.woocommerce-checkout").on("checkout_place_order_square",function(r){return e(".payment_method_square .woocommerce-error").remove(),!e("#payment_method_square").is(":checked")||0!==e("input.square-nonce").length||(o.requestCardNonce(),!1)}),e("form#order_review").on("submit",function(r){return e(".payment_method_square .woocommerce-error").remove(),!e("#payment_method_square").is(":checked")||0!==e("input.square-nonce").length||(o.requestCardNonce(),!1)}),e(document.body).on("checkout_error",function(){e("input.square-nonce").remove()}),setTimeout(function(){e("#payment_method_square").is(":checked")||e(".payment_box.payment_method_square").css({display:"none",visibility:"visible",height:"auto"})},1e3))}},e.wc_square_payments.init()}(jQuery);
1
+ !function(e){"use strict";var o;e.wc_square_payments={init:function(){e(document.body).on("updated_checkout",function(){e.wc_square_payments.loadForm()}),e("form#order_review").length&&e.wc_square_payments.loadForm();var o=square_params.custom_form_trigger_element;o.length&&e(document.body).on("click",o,function(){e.wc_square_payments.loadForm()}),e(document.body).on("click","#payment_method_square",function(){e(".payment_box.payment_method_square").css({display:"block",visibility:"visible",height:"auto"})})},loadForm:function(){e("#payment_method_square").length&&(e("#payment_method_square").is(":checked")||e(".payment_box.payment_method_square").css({display:"block",visibility:"hidden",height:"0"}),"object"===e.type(o)&&o.destroy(),(o=new SqPaymentForm({env:square_params.environment,applicationId:square_params.application_id,inputClass:"sq-input",cardNumber:{elementId:"sq-card-number",placeholder:square_params.placeholder_card_number},cvv:{elementId:"sq-cvv",placeholder:square_params.placeholder_card_cvv},expirationDate:{elementId:"sq-expiration-date",placeholder:square_params.placeholder_card_expiration},postalCode:{elementId:"sq-postal-code",placeholder:square_params.placeholder_card_postal_code},callbacks:{cardNonceResponseReceived:function(o,r,a){if(o){var t="";t+='<ul class="woocommerce_error woocommerce-error">',e(o).each(function(e,o){t+="<li>"+o.message+"</li>"}),t+="</ul>",e(".payment_method_square .sq-fieldset").eq(0).prepend(t)}else{var n=e("form.woocommerce-checkout, form#order_review");n.append('<input type="hidden" class="square-nonce" name="square_nonce" value="'+r+'" />'),n.submit()}},paymentFormLoaded:function(){o.setPostalCode(e("#billing_postcode").val())},unsupportedBrowserDetected:function(){var o="";o+='<ul class="woocommerce_error woocommerce-error">',o+="<li>"+square_params.unsupported_browser+"</li>",o+="</ul>",e(".payment_method_square .sq-fieldset").eq(0).prepend(o)}},inputStyles:e.parseJSON(square_params.payment_form_input_styles)})).build(),e("form.woocommerce-checkout").on("checkout_place_order_square",function(r){return e(".payment_method_square .woocommerce-error").remove(),!e("#payment_method_square").is(":checked")||0!==e("input.square-nonce").length||(o.requestCardNonce(),!1)}),e("form#order_review").on("submit",function(r){return e(".payment_method_square .woocommerce-error").remove(),!e("#payment_method_square").is(":checked")||0!==e("input.square-nonce").length||(o.requestCardNonce(),!1)}),e(document.body).on("checkout_error",function(){e("input.square-nonce").remove()}),setTimeout(function(){e("#payment_method_square").is(":checked")||e(".payment_box.payment_method_square").css({display:"none",visibility:"visible",height:"auto"})},1e3))}},e.wc_square_payments.init()}(jQuery);
changelog.txt CHANGED
@@ -1,5 +1,10 @@
1
  *** WooCommerce Square Changelog ***
2
 
 
 
 
 
 
3
  = 1.0.33 - 2018-09-27 =
4
  * Update - WC tested up to version 3.5
5
 
1
  *** WooCommerce Square Changelog ***
2
 
3
+ = 1.0.34 - 2018-11-07 =
4
+ * Update - Fieldset tag to div tag in payment box to prevent unwanted styling.
5
+ * Fix - Provide unique idempotency ID to the order instead of random unique number.
6
+ * Update - WP tested up to version 5.0
7
+
8
  = 1.0.33 - 2018-09-27 =
9
  * Update - WC tested up to version 3.5
10
 
includes/payment/class-wc-square-gateway.php CHANGED
@@ -42,7 +42,7 @@ class WC_Square_Gateway extends WC_Payment_Gateway {
42
  if ( WC_SQUARE_ENABLE_STAGING ) {
43
  $this->description .= ' ' . __( 'STAGING MODE ENABLED. In staging mode, you can use the card number 4111111111111111 with any CVC and a valid expiration date.', 'woocommerce-square' );
44
 
45
- $this->description = trim( $this->description );
46
  }
47
 
48
  // Hooks
@@ -80,6 +80,7 @@ class WC_Square_Gateway extends WC_Payment_Gateway {
80
 
81
  // Show message if SSL is not detected in checkout page.
82
  if ( ! WC_SQUARE_ENABLE_STAGING && ! wc_checkout_is_https() ) {
 
83
  echo '<div class="error"><p>' . sprintf( __( 'Square is enabled, but a SSL certificate is not detected. Your checkout may not be secure! Please ensure your server has a valid <a href="%1$s" target="_blank">SSL certificate</a>', 'woocommerce-square' ), 'https://en.wikipedia.org/wiki/Transport_Layer_Security' ) . '</p></div>';
84
  }
85
  }
@@ -114,48 +115,51 @@ class WC_Square_Gateway extends WC_Payment_Gateway {
114
  * Initialize Gateway Settings Form Fields
115
  */
116
  public function init_form_fields() {
117
- $this->form_fields = apply_filters( 'woocommerce_square_gateway_settings', array(
118
- 'enabled' => array(
119
- 'title' => __( 'Enable/Disable', 'woocommerce-square' ),
120
- 'label' => __( 'Enable Square', 'woocommerce-square' ),
121
- 'type' => 'checkbox',
122
- 'description' => '',
123
- 'default' => 'no',
124
- ),
125
- 'title' => array(
126
- 'title' => __( 'Title', 'woocommerce-square' ),
127
- 'type' => 'text',
128
- 'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-square' ),
129
- 'default' => __( 'Credit card (Square)', 'woocommerce-square' ),
130
- ),
131
- 'description' => array(
132
- 'title' => __( 'Description', 'woocommerce-square' ),
133
- 'type' => 'textarea',
134
- 'description' => __( 'This controls the description which the user sees during checkout.', 'woocommerce-square' ),
135
- 'default' => __( 'Pay with your credit card via Square.', 'woocommerce-square' ),
136
- ),
137
- 'capture' => array(
138
- 'title' => __( 'Delay Capture', 'woocommerce-square' ),
139
- 'label' => __( 'Enable Delay Capture', 'woocommerce-square' ),
140
- 'type' => 'checkbox',
141
- 'description' => __( 'When enabled, the request will only perform an Auth on the provided card. You can then later perform either a Capture or Void.', 'woocommerce-square' ),
142
- 'default' => 'no',
143
- ),
144
- 'create_customer' => array(
145
- 'title' => __( 'Create Customer', 'woocommerce-square' ),
146
- 'label' => __( 'Enable Create Customer', 'woocommerce-square' ),
147
- 'type' => 'checkbox',
148
- 'description' => __( 'When enabled, processing a payment will create a customer profile on Square.', 'woocommerce-square' ),
149
- 'default' => 'no',
150
- ),
151
- 'logging' => array(
152
- 'title' => __( 'Logging', 'woocommerce-square' ),
153
- 'label' => __( 'Log debug messages', 'woocommerce-square' ),
154
- 'type' => 'checkbox',
155
- 'description' => __( 'Save debug messages to the WooCommerce System Status log.', 'woocommerce-square' ),
156
- 'default' => 'no',
157
- ),
158
- ) );
 
 
 
159
  }
160
 
161
  /**
@@ -163,19 +167,19 @@ class WC_Square_Gateway extends WC_Payment_Gateway {
163
  */
164
  public function payment_fields() {
165
  ?>
166
- <fieldset>
167
  <?php
168
  $allowed = array(
169
- 'a' => array(
170
- 'href' => array(),
171
- 'title' => array(),
172
- ),
173
- 'br' => array(),
174
- 'em' => array(),
175
- 'strong' => array(),
176
- 'span' => array(
177
- 'class' => array(),
178
- ),
179
  );
180
  if ( $this->description ) {
181
  echo apply_filters( 'woocommerce_square_description', wpautop( wp_kses( $this->description, $allowed ) ) );
@@ -185,7 +189,7 @@ class WC_Square_Gateway extends WC_Payment_Gateway {
185
  <label for="sq-card-number"><?php esc_html_e( 'Card Number', 'woocommerce-square' ); ?> <span class="required">*</span></label>
186
  <input id="sq-card-number" type="text" maxlength="20" autocomplete="off" placeholder="•••• •••• •••• ••••" name="<?php echo esc_attr( $this->id ); ?>-card-number" />
187
  </p>
188
-
189
  <p class="form-row form-row-first">
190
  <label for="sq-expiration-date"><?php esc_html_e( 'Expiry (MM/YY)', 'woocommerce-square' ); ?> <span class="required">*</span></label>
191
  <input id="sq-expiration-date" type="text" autocomplete="off" placeholder="<?php esc_attr_e( 'MM / YY', 'woocommerce-square' ); ?>" name="<?php echo esc_attr( $this->id ); ?>-card-expiry" />
@@ -200,7 +204,7 @@ class WC_Square_Gateway extends WC_Payment_Gateway {
200
  <label for="sq-postal-code"><?php esc_html_e( 'Card Postal Code', 'woocommerce-square' ); ?> <span class="required">*</span></label>
201
  <input id="sq-postal-code" type="text" autocomplete="off" placeholder="<?php esc_attr_e( 'Card Postal Code', 'woocommerce-square' ); ?>" name="<?php echo esc_attr( $this->id ); ?>-card-postal-code" />
202
  </p>
203
- </fieldset>
204
  <?php
205
  }
206
 
@@ -251,16 +255,20 @@ class WC_Square_Gateway extends WC_Payment_Gateway {
251
  wp_register_script( 'square', 'https://js.squareup.com/v2/paymentform', '', '0.0.2', true );
252
  wp_register_script( 'woocommerce-square', WC_SQUARE_PLUGIN_URL . '/assets/js/wc-square-payments' . $suffix . '.js', array( 'jquery', 'square' ), WC_SQUARE_VERSION, true );
253
 
254
- wp_localize_script( 'woocommerce-square', 'square_params', array(
255
- 'application_id' => SQUARE_APPLICATION_ID,
256
- 'environment' => WC_SQUARE_ENABLE_STAGING ? 'staging' : 'production',
257
- 'placeholder_card_number' => __( '•••• •••• •••• ••••', 'woocommerce-square' ),
258
- 'placeholder_card_expiration' => __( 'MM / YY', 'woocommerce-square' ),
259
- 'placeholder_card_cvv' => __( 'CVV', 'woocommerce-square' ),
260
- 'placeholder_card_postal_code' => __( 'Card Postal Code', 'woocommerce-square' ),
261
- 'payment_form_input_styles' => esc_js( $this->get_input_styles() ),
262
- 'custom_form_trigger_element' => apply_filters( 'woocommerce_square_payment_form_trigger_element', esc_js( '' ) ),
263
- ) );
 
 
 
 
264
 
265
  wp_enqueue_script( 'woocommerce-square' );
266
 
@@ -281,8 +289,8 @@ class WC_Square_Gateway extends WC_Payment_Gateway {
281
 
282
  try {
283
  $data = array(
284
- 'idempotency_key' => uniqid(),
285
- 'amount_money' => array(
286
  'amount' => (int) WC_Square_Utils::format_amount_to_square( $order->get_total(), $currency ),
287
  'currency' => $currency,
288
  ),
@@ -298,7 +306,7 @@ class WC_Square_Gateway extends WC_Payment_Gateway {
298
  'postal_code' => version_compare( WC_VERSION, '3.0.0', '<' ) ? $order->billing_postcode : $order->get_billing_postcode(),
299
  'country' => version_compare( WC_VERSION, '3.0.0', '<' ) ? $order->billing_country : $order->get_billing_country(),
300
  ),
301
- 'note' => apply_filters( 'woocommerce_square_payment_order_note', 'WooCommerce: Order #' . (string) $order->get_order_number(), $order ),
302
  );
303
 
304
  if ( $order->needs_shipping_address() ) {
@@ -327,7 +335,7 @@ class WC_Square_Gateway extends WC_Payment_Gateway {
327
 
328
  if ( 'PAYMENT_METHOD_ERROR' === $result->errors[0]->category || 'VALIDATION_ERROR' === $result->errors[0]->category ) {
329
  // format errors for display
330
- $error_html = __( 'Payment Error: ', 'woocommerce-square' );
331
  $error_html .= '<br />';
332
  $error_html .= '<ul>';
333
 
@@ -359,6 +367,7 @@ class WC_Square_Gateway extends WC_Payment_Gateway {
359
  $order->payment_complete( $result->transaction->id );
360
 
361
  // Add order note
 
362
  $complete_message = sprintf( __( 'Square charge complete (Charge ID: %s)', 'woocommerce-square' ), $result->transaction->id );
363
  $order->add_order_note( $complete_message );
364
  $this->log( "Success: $complete_message" );
@@ -368,6 +377,7 @@ class WC_Square_Gateway extends WC_Payment_Gateway {
368
  update_post_meta( $order_id, '_transaction_id', $result->transaction->id );
369
 
370
  // Mark as on-hold
 
371
  $authorized_message = sprintf( __( 'Square charge authorized (Authorized ID: %s). Process order to take payment, or cancel to remove the pre-authorization.', 'woocommerce-square' ), $result->transaction->id );
372
  $order->update_status( 'on-hold', $authorized_message );
373
  $this->log( "Success: $authorized_message" );
@@ -390,6 +400,7 @@ class WC_Square_Gateway extends WC_Payment_Gateway {
390
  'redirect' => $this->get_return_url( $order ),
391
  );
392
  } catch ( Exception $e ) {
 
393
  $this->log( sprintf( __( 'Error: %s', 'woocommerce-square' ), $e->getMessage() ) );
394
 
395
  $order->update_status( 'failed', $e->getMessage() );
@@ -421,8 +432,8 @@ class WC_Square_Gateway extends WC_Payment_Gateway {
421
  'postal_code' => version_compare( WC_VERSION, '3.0.0', '<' ) ? $order->billing_postcode : $order->get_billing_postcode(),
422
  'country' => version_compare( WC_VERSION, '3.0.0', '<' ) ? $order->billing_country : $order->get_billing_country(),
423
  ),
424
- 'phone_number' => ! empty( $phone_number ) ? $phone_number : null,
425
- 'reference_id' => ! empty( $user ) ? (string) $user : __( 'Guest', 'woocommerce-square' ),
426
  );
427
 
428
  // to prevent creating duplicate customer
@@ -441,19 +452,24 @@ class WC_Square_Gateway extends WC_Payment_Gateway {
441
 
442
  // we don't want to halt any processes here just log it
443
  if ( is_wp_error( $result ) ) {
 
444
  $this->log( sprintf( __( 'Error creating customer: %s', 'woocommerce-square' ), $result->get_error_message() ) );
 
445
  $order->add_order_note( sprintf( __( 'Error creating customer: %s', 'woocommerce-square' ), $result->get_error_message() ) );
446
  }
447
 
448
  // we don't want to halt any processes here just log it
449
  if ( ! empty( $result->errors ) ) {
 
450
  $this->log( sprintf( __( 'Error creating customer: %s', 'woocommerce-square' ), print_r( $result->errors, true ) ) );
 
451
  $order->add_order_note( sprintf( __( 'Error creating customer: %s', 'woocommerce-square' ), print_r( $result->errors, true ) ) );
452
  }
453
 
454
  // if no errors save Square customer ID to user meta
455
  if ( ! is_wp_error( $result ) && empty( $result->errors ) && ! empty( $user ) ) {
456
  update_user_meta( $user, '_square_customer_id', $result->customer->id );
 
457
  $order->add_order_note( sprintf( __( 'Customer created on Square: %s', 'woocommerce-square' ), $result->customer->id ) );
458
  }
459
  }
@@ -487,7 +503,7 @@ class WC_Square_Gateway extends WC_Payment_Gateway {
487
 
488
  $body = array();
489
 
490
- $body['idempotency_key'] = uniqid();
491
  $body['tender_id'] = $tender_id;
492
 
493
  if ( ! is_null( $amount ) ) {
@@ -511,6 +527,7 @@ class WC_Square_Gateway extends WC_Payment_Gateway {
511
 
512
  } else {
513
  if ( 'APPROVED' === $result->refund->status || 'PENDING' === $result->refund->status ) {
 
514
  $refund_message = sprintf( __( 'Refunded %1$s - Refund ID: %2$s - Reason: %3$s', 'woocommerce-square' ), wc_price( $result->refund->amount_money->amount / 100 ), $result->refund->id, $reason );
515
 
516
  $order->add_order_note( $refund_message );
@@ -522,6 +539,7 @@ class WC_Square_Gateway extends WC_Payment_Gateway {
522
  }
523
  }
524
  } catch ( Exception $e ) {
 
525
  $this->log( sprintf( __( 'Error: %s', 'woocommerce-square' ), $e->getMessage() ) );
526
 
527
  return false;
42
  if ( WC_SQUARE_ENABLE_STAGING ) {
43
  $this->description .= ' ' . __( 'STAGING MODE ENABLED. In staging mode, you can use the card number 4111111111111111 with any CVC and a valid expiration date.', 'woocommerce-square' );
44
 
45
+ $this->description = trim( $this->description );
46
  }
47
 
48
  // Hooks
80
 
81
  // Show message if SSL is not detected in checkout page.
82
  if ( ! WC_SQUARE_ENABLE_STAGING && ! wc_checkout_is_https() ) {
83
+ /* translators: %1$s - transport layer securtiy wiki URL */
84
  echo '<div class="error"><p>' . sprintf( __( 'Square is enabled, but a SSL certificate is not detected. Your checkout may not be secure! Please ensure your server has a valid <a href="%1$s" target="_blank">SSL certificate</a>', 'woocommerce-square' ), 'https://en.wikipedia.org/wiki/Transport_Layer_Security' ) . '</p></div>';
85
  }
86
  }
115
  * Initialize Gateway Settings Form Fields
116
  */
117
  public function init_form_fields() {
118
+ $this->form_fields = apply_filters(
119
+ 'woocommerce_square_gateway_settings',
120
+ array(
121
+ 'enabled' => array(
122
+ 'title' => __( 'Enable/Disable', 'woocommerce-square' ),
123
+ 'label' => __( 'Enable Square', 'woocommerce-square' ),
124
+ 'type' => 'checkbox',
125
+ 'description' => '',
126
+ 'default' => 'no',
127
+ ),
128
+ 'title' => array(
129
+ 'title' => __( 'Title', 'woocommerce-square' ),
130
+ 'type' => 'text',
131
+ 'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-square' ),
132
+ 'default' => __( 'Credit card (Square)', 'woocommerce-square' ),
133
+ ),
134
+ 'description' => array(
135
+ 'title' => __( 'Description', 'woocommerce-square' ),
136
+ 'type' => 'textarea',
137
+ 'description' => __( 'This controls the description which the user sees during checkout.', 'woocommerce-square' ),
138
+ 'default' => __( 'Pay with your credit card via Square.', 'woocommerce-square' ),
139
+ ),
140
+ 'capture' => array(
141
+ 'title' => __( 'Delay Capture', 'woocommerce-square' ),
142
+ 'label' => __( 'Enable Delay Capture', 'woocommerce-square' ),
143
+ 'type' => 'checkbox',
144
+ 'description' => __( 'When enabled, the request will only perform an Auth on the provided card. You can then later perform either a Capture or Void.', 'woocommerce-square' ),
145
+ 'default' => 'no',
146
+ ),
147
+ 'create_customer' => array(
148
+ 'title' => __( 'Create Customer', 'woocommerce-square' ),
149
+ 'label' => __( 'Enable Create Customer', 'woocommerce-square' ),
150
+ 'type' => 'checkbox',
151
+ 'description' => __( 'When enabled, processing a payment will create a customer profile on Square.', 'woocommerce-square' ),
152
+ 'default' => 'no',
153
+ ),
154
+ 'logging' => array(
155
+ 'title' => __( 'Logging', 'woocommerce-square' ),
156
+ 'label' => __( 'Log debug messages', 'woocommerce-square' ),
157
+ 'type' => 'checkbox',
158
+ 'description' => __( 'Save debug messages to the WooCommerce System Status log.', 'woocommerce-square' ),
159
+ 'default' => 'no',
160
+ ),
161
+ )
162
+ );
163
  }
164
 
165
  /**
167
  */
168
  public function payment_fields() {
169
  ?>
170
+ <div class="sq-fieldset">
171
  <?php
172
  $allowed = array(
173
+ 'a' => array(
174
+ 'href' => array(),
175
+ 'title' => array(),
176
+ ),
177
+ 'br' => array(),
178
+ 'em' => array(),
179
+ 'strong' => array(),
180
+ 'span' => array(
181
+ 'class' => array(),
182
+ ),
183
  );
184
  if ( $this->description ) {
185
  echo apply_filters( 'woocommerce_square_description', wpautop( wp_kses( $this->description, $allowed ) ) );
189
  <label for="sq-card-number"><?php esc_html_e( 'Card Number', 'woocommerce-square' ); ?> <span class="required">*</span></label>
190
  <input id="sq-card-number" type="text" maxlength="20" autocomplete="off" placeholder="•••• •••• •••• ••••" name="<?php echo esc_attr( $this->id ); ?>-card-number" />
191
  </p>
192
+
193
  <p class="form-row form-row-first">
194
  <label for="sq-expiration-date"><?php esc_html_e( 'Expiry (MM/YY)', 'woocommerce-square' ); ?> <span class="required">*</span></label>
195
  <input id="sq-expiration-date" type="text" autocomplete="off" placeholder="<?php esc_attr_e( 'MM / YY', 'woocommerce-square' ); ?>" name="<?php echo esc_attr( $this->id ); ?>-card-expiry" />
204
  <label for="sq-postal-code"><?php esc_html_e( 'Card Postal Code', 'woocommerce-square' ); ?> <span class="required">*</span></label>
205
  <input id="sq-postal-code" type="text" autocomplete="off" placeholder="<?php esc_attr_e( 'Card Postal Code', 'woocommerce-square' ); ?>" name="<?php echo esc_attr( $this->id ); ?>-card-postal-code" />
206
  </p>
207
+ </div>
208
  <?php
209
  }
210
 
255
  wp_register_script( 'square', 'https://js.squareup.com/v2/paymentform', '', '0.0.2', true );
256
  wp_register_script( 'woocommerce-square', WC_SQUARE_PLUGIN_URL . '/assets/js/wc-square-payments' . $suffix . '.js', array( 'jquery', 'square' ), WC_SQUARE_VERSION, true );
257
 
258
+ wp_localize_script(
259
+ 'woocommerce-square',
260
+ 'square_params',
261
+ array(
262
+ 'application_id' => SQUARE_APPLICATION_ID,
263
+ 'environment' => WC_SQUARE_ENABLE_STAGING ? 'staging' : 'production',
264
+ 'placeholder_card_number' => __( '•••• •••• •••• ••••', 'woocommerce-square' ),
265
+ 'placeholder_card_expiration' => __( 'MM / YY', 'woocommerce-square' ),
266
+ 'placeholder_card_cvv' => __( 'CVV', 'woocommerce-square' ),
267
+ 'placeholder_card_postal_code' => __( 'Card Postal Code', 'woocommerce-square' ),
268
+ 'payment_form_input_styles' => esc_js( $this->get_input_styles() ),
269
+ 'custom_form_trigger_element' => apply_filters( 'woocommerce_square_payment_form_trigger_element', esc_js( '' ) ),
270
+ )
271
+ );
272
 
273
  wp_enqueue_script( 'woocommerce-square' );
274
 
289
 
290
  try {
291
  $data = array(
292
+ 'idempotency_key' => apply_filters( 'woocommerce_square_idempotency_key', $order_id . '-' . $order->get_order_number(), $order ),
293
+ 'amount_money' => array(
294
  'amount' => (int) WC_Square_Utils::format_amount_to_square( $order->get_total(), $currency ),
295
  'currency' => $currency,
296
  ),
306
  'postal_code' => version_compare( WC_VERSION, '3.0.0', '<' ) ? $order->billing_postcode : $order->get_billing_postcode(),
307
  'country' => version_compare( WC_VERSION, '3.0.0', '<' ) ? $order->billing_country : $order->get_billing_country(),
308
  ),
309
+ 'note' => apply_filters( 'woocommerce_square_payment_order_note', 'WooCommerce: Order #' . (string) $order->get_order_number(), $order ),
310
  );
311
 
312
  if ( $order->needs_shipping_address() ) {
335
 
336
  if ( 'PAYMENT_METHOD_ERROR' === $result->errors[0]->category || 'VALIDATION_ERROR' === $result->errors[0]->category ) {
337
  // format errors for display
338
+ $error_html = __( 'Payment Error: ', 'woocommerce-square' );
339
  $error_html .= '<br />';
340
  $error_html .= '<ul>';
341
 
367
  $order->payment_complete( $result->transaction->id );
368
 
369
  // Add order note
370
+ /* translators: %s - transaction id */
371
  $complete_message = sprintf( __( 'Square charge complete (Charge ID: %s)', 'woocommerce-square' ), $result->transaction->id );
372
  $order->add_order_note( $complete_message );
373
  $this->log( "Success: $complete_message" );
377
  update_post_meta( $order_id, '_transaction_id', $result->transaction->id );
378
 
379
  // Mark as on-hold
380
+ /* translators: %s - transaction id */
381
  $authorized_message = sprintf( __( 'Square charge authorized (Authorized ID: %s). Process order to take payment, or cancel to remove the pre-authorization.', 'woocommerce-square' ), $result->transaction->id );
382
  $order->update_status( 'on-hold', $authorized_message );
383
  $this->log( "Success: $authorized_message" );
400
  'redirect' => $this->get_return_url( $order ),
401
  );
402
  } catch ( Exception $e ) {
403
+ /* translators: %s - error message */
404
  $this->log( sprintf( __( 'Error: %s', 'woocommerce-square' ), $e->getMessage() ) );
405
 
406
  $order->update_status( 'failed', $e->getMessage() );
432
  'postal_code' => version_compare( WC_VERSION, '3.0.0', '<' ) ? $order->billing_postcode : $order->get_billing_postcode(),
433
  'country' => version_compare( WC_VERSION, '3.0.0', '<' ) ? $order->billing_country : $order->get_billing_country(),
434
  ),
435
+ 'phone_number' => ! empty( $phone_number ) ? $phone_number : null,
436
+ 'reference_id' => ! empty( $user ) ? (string) $user : __( 'Guest', 'woocommerce-square' ),
437
  );
438
 
439
  // to prevent creating duplicate customer
452
 
453
  // we don't want to halt any processes here just log it
454
  if ( is_wp_error( $result ) ) {
455
+ /* translators: %s - error message */
456
  $this->log( sprintf( __( 'Error creating customer: %s', 'woocommerce-square' ), $result->get_error_message() ) );
457
+ /* translators: %s - error message */
458
  $order->add_order_note( sprintf( __( 'Error creating customer: %s', 'woocommerce-square' ), $result->get_error_message() ) );
459
  }
460
 
461
  // we don't want to halt any processes here just log it
462
  if ( ! empty( $result->errors ) ) {
463
+ /* translators: %s - errors */
464
  $this->log( sprintf( __( 'Error creating customer: %s', 'woocommerce-square' ), print_r( $result->errors, true ) ) );
465
+ /* translators: %s - errors */
466
  $order->add_order_note( sprintf( __( 'Error creating customer: %s', 'woocommerce-square' ), print_r( $result->errors, true ) ) );
467
  }
468
 
469
  // if no errors save Square customer ID to user meta
470
  if ( ! is_wp_error( $result ) && empty( $result->errors ) && ! empty( $user ) ) {
471
  update_user_meta( $user, '_square_customer_id', $result->customer->id );
472
+ /* translators: %s - customer id */
473
  $order->add_order_note( sprintf( __( 'Customer created on Square: %s', 'woocommerce-square' ), $result->customer->id ) );
474
  }
475
  }
503
 
504
  $body = array();
505
 
506
+ $body['idempotency_key'] = apply_filters( 'woocommerce_square_idempotency_key', $order_id . '-' . $order->get_order_number(), $order );
507
  $body['tender_id'] = $tender_id;
508
 
509
  if ( ! is_null( $amount ) ) {
527
 
528
  } else {
529
  if ( 'APPROVED' === $result->refund->status || 'PENDING' === $result->refund->status ) {
530
+ /* translators: %1$s - refund amount, %2$s - refund id, %3$s - refund reason */
531
  $refund_message = sprintf( __( 'Refunded %1$s - Refund ID: %2$s - Reason: %3$s', 'woocommerce-square' ), wc_price( $result->refund->amount_money->amount / 100 ), $result->refund->id, $reason );
532
 
533
  $order->add_order_note( $refund_message );
539
  }
540
  }
541
  } catch ( Exception $e ) {
542
+ /* translators: %s - error message */
543
  $this->log( sprintf( __( 'Error: %s', 'woocommerce-square' ), $e->getMessage() ) );
544
 
545
  return false;
languages/woocommerce-square.pot CHANGED
@@ -2,17 +2,17 @@
2
  # This file is distributed under the same license as the WooCommerce Square package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce Square 1.0.30\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://github.com/woocommerce/woocommerce-square/issues\n"
8
- "POT-Creation-Date: 2018-06-05 14:39:13+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
  "PO-Revision-Date: 2018-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <EMAIL@ADDRESS>\n"
15
- "X-Generator: grunt-wp-i18n1.0.1\n"
16
 
17
  #: includes/admin/class-wc-square-admin-integration.php:20
18
  #: includes/admin/class-wc-square-privacy.php:12
@@ -52,17 +52,17 @@ msgid ""
52
  msgstr ""
53
 
54
  #: includes/admin/class-wc-square-admin-integration.php:69
55
- #: includes/payment/class-wc-square-gateway.php:152
56
  msgid "Logging"
57
  msgstr ""
58
 
59
  #: includes/admin/class-wc-square-admin-integration.php:70
60
- #: includes/payment/class-wc-square-gateway.php:153
61
  msgid "Log debug messages"
62
  msgstr ""
63
 
64
  #: includes/admin/class-wc-square-admin-integration.php:72
65
- #: includes/payment/class-wc-square-gateway.php:155
66
  msgid "Save debug messages to the WooCommerce System Status log."
67
  msgstr ""
68
 
@@ -459,147 +459,156 @@ msgid ""
459
  "4111111111111111 with any CVC and a valid expiration date."
460
  msgstr ""
461
 
462
- #: includes/payment/class-wc-square-gateway.php:83
 
463
  msgid ""
464
  "Square is enabled, but a SSL certificate is not detected. Your checkout may "
465
  "not be secure! Please ensure your server has a valid <a href=\"%1$s\" "
466
  "target=\"_blank\">SSL certificate</a>"
467
  msgstr ""
468
 
469
- #: includes/payment/class-wc-square-gateway.php:119
470
  msgid "Enable/Disable"
471
  msgstr ""
472
 
473
- #: includes/payment/class-wc-square-gateway.php:120
474
  msgid "Enable Square"
475
  msgstr ""
476
 
477
- #: includes/payment/class-wc-square-gateway.php:126
478
  msgid "Title"
479
  msgstr ""
480
 
481
- #: includes/payment/class-wc-square-gateway.php:128
482
  msgid "This controls the title which the user sees during checkout."
483
  msgstr ""
484
 
485
- #: includes/payment/class-wc-square-gateway.php:129
486
  msgid "Credit card (Square)"
487
  msgstr ""
488
 
489
- #: includes/payment/class-wc-square-gateway.php:132
490
  msgid "Description"
491
  msgstr ""
492
 
493
- #: includes/payment/class-wc-square-gateway.php:134
494
  msgid "This controls the description which the user sees during checkout."
495
  msgstr ""
496
 
497
- #: includes/payment/class-wc-square-gateway.php:135
498
  msgid "Pay with your credit card via Square."
499
  msgstr ""
500
 
501
- #: includes/payment/class-wc-square-gateway.php:138
502
  msgid "Delay Capture"
503
  msgstr ""
504
 
505
- #: includes/payment/class-wc-square-gateway.php:139
506
  msgid "Enable Delay Capture"
507
  msgstr ""
508
 
509
- #: includes/payment/class-wc-square-gateway.php:141
510
  msgid ""
511
  "When enabled, the request will only perform an Auth on the provided card. "
512
  "You can then later perform either a Capture or Void."
513
  msgstr ""
514
 
515
- #: includes/payment/class-wc-square-gateway.php:145
516
  msgid "Create Customer"
517
  msgstr ""
518
 
519
- #: includes/payment/class-wc-square-gateway.php:146
520
  msgid "Enable Create Customer"
521
  msgstr ""
522
 
523
- #: includes/payment/class-wc-square-gateway.php:148
524
  msgid "When enabled, processing a payment will create a customer profile on Square."
525
  msgstr ""
526
 
527
- #: includes/payment/class-wc-square-gateway.php:185
528
  msgid "Card Number"
529
  msgstr ""
530
 
531
- #: includes/payment/class-wc-square-gateway.php:190
532
  msgid "Expiry (MM/YY)"
533
  msgstr ""
534
 
535
- #: includes/payment/class-wc-square-gateway.php:191
536
- #: includes/payment/class-wc-square-gateway.php:258
537
  msgid "MM / YY"
538
  msgstr ""
539
 
540
- #: includes/payment/class-wc-square-gateway.php:195
541
  msgid "Card Code"
542
  msgstr ""
543
 
544
- #: includes/payment/class-wc-square-gateway.php:196
545
- #: includes/payment/class-wc-square-gateway.php:259
546
  msgid "CVV"
547
  msgstr ""
548
 
549
- #: includes/payment/class-wc-square-gateway.php:200
550
- #: includes/payment/class-wc-square-gateway.php:201
551
- #: includes/payment/class-wc-square-gateway.php:260
552
  msgid "Card Postal Code"
553
  msgstr ""
554
 
555
- #: includes/payment/class-wc-square-gateway.php:257
556
  msgid "•••• •••• •••• ••••"
557
  msgstr ""
558
 
559
- #: includes/payment/class-wc-square-gateway.php:318
560
- #: includes/payment/class-wc-square-gateway.php:325
561
- #: includes/payment/class-wc-square-gateway.php:349
562
  msgid ""
563
  "Error: Square was unable to complete the transaction. Please try again "
564
  "later or use another means of payment."
565
  msgstr ""
566
 
567
- #: includes/payment/class-wc-square-gateway.php:330
568
  msgid "Payment Error: "
569
  msgstr ""
570
 
571
- #: includes/payment/class-wc-square-gateway.php:362
572
  #: includes/payment/class-wc-square-payments.php:136
 
573
  msgid "Square charge complete (Charge ID: %s)"
574
  msgstr ""
575
 
576
- #: includes/payment/class-wc-square-gateway.php:371
 
577
  msgid ""
578
  "Square charge authorized (Authorized ID: %s). Process order to take "
579
  "payment, or cancel to remove the pre-authorization."
580
  msgstr ""
581
 
582
- #: includes/payment/class-wc-square-gateway.php:393
583
- #: includes/payment/class-wc-square-gateway.php:525
 
584
  msgid "Error: %s"
585
  msgstr ""
586
 
587
- #: includes/payment/class-wc-square-gateway.php:425
588
  msgid "Guest"
589
  msgstr ""
590
 
591
- #: includes/payment/class-wc-square-gateway.php:444
592
- #: includes/payment/class-wc-square-gateway.php:445
593
- #: includes/payment/class-wc-square-gateway.php:450
594
- #: includes/payment/class-wc-square-gateway.php:451
 
 
 
595
  msgid "Error creating customer: %s"
596
  msgstr ""
597
 
598
- #: includes/payment/class-wc-square-gateway.php:457
 
599
  msgid "Customer created on Square: %s"
600
  msgstr ""
601
 
602
- #: includes/payment/class-wc-square-gateway.php:514
 
603
  msgid "Refunded %1$s - Refund ID: %2$s - Reason: %3$s"
604
  msgstr ""
605
 
2
  # This file is distributed under the same license as the WooCommerce Square package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WooCommerce Square 1.0.34\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://github.com/woocommerce/woocommerce-square/issues\n"
8
+ "POT-Creation-Date: 2018-11-07 12:59:39+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
  "PO-Revision-Date: 2018-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <EMAIL@ADDRESS>\n"
15
+ "X-Generator: grunt-wp-i18n1.0.2\n"
16
 
17
  #: includes/admin/class-wc-square-admin-integration.php:20
18
  #: includes/admin/class-wc-square-privacy.php:12
52
  msgstr ""
53
 
54
  #: includes/admin/class-wc-square-admin-integration.php:69
55
+ #: includes/payment/class-wc-square-gateway.php:155
56
  msgid "Logging"
57
  msgstr ""
58
 
59
  #: includes/admin/class-wc-square-admin-integration.php:70
60
+ #: includes/payment/class-wc-square-gateway.php:156
61
  msgid "Log debug messages"
62
  msgstr ""
63
 
64
  #: includes/admin/class-wc-square-admin-integration.php:72
65
+ #: includes/payment/class-wc-square-gateway.php:158
66
  msgid "Save debug messages to the WooCommerce System Status log."
67
  msgstr ""
68
 
459
  "4111111111111111 with any CVC and a valid expiration date."
460
  msgstr ""
461
 
462
+ #: includes/payment/class-wc-square-gateway.php:84
463
+ #. translators: %1$s - transport layer securtiy wiki URL
464
  msgid ""
465
  "Square is enabled, but a SSL certificate is not detected. Your checkout may "
466
  "not be secure! Please ensure your server has a valid <a href=\"%1$s\" "
467
  "target=\"_blank\">SSL certificate</a>"
468
  msgstr ""
469
 
470
+ #: includes/payment/class-wc-square-gateway.php:122
471
  msgid "Enable/Disable"
472
  msgstr ""
473
 
474
+ #: includes/payment/class-wc-square-gateway.php:123
475
  msgid "Enable Square"
476
  msgstr ""
477
 
478
+ #: includes/payment/class-wc-square-gateway.php:129
479
  msgid "Title"
480
  msgstr ""
481
 
482
+ #: includes/payment/class-wc-square-gateway.php:131
483
  msgid "This controls the title which the user sees during checkout."
484
  msgstr ""
485
 
486
+ #: includes/payment/class-wc-square-gateway.php:132
487
  msgid "Credit card (Square)"
488
  msgstr ""
489
 
490
+ #: includes/payment/class-wc-square-gateway.php:135
491
  msgid "Description"
492
  msgstr ""
493
 
494
+ #: includes/payment/class-wc-square-gateway.php:137
495
  msgid "This controls the description which the user sees during checkout."
496
  msgstr ""
497
 
498
+ #: includes/payment/class-wc-square-gateway.php:138
499
  msgid "Pay with your credit card via Square."
500
  msgstr ""
501
 
502
+ #: includes/payment/class-wc-square-gateway.php:141
503
  msgid "Delay Capture"
504
  msgstr ""
505
 
506
+ #: includes/payment/class-wc-square-gateway.php:142
507
  msgid "Enable Delay Capture"
508
  msgstr ""
509
 
510
+ #: includes/payment/class-wc-square-gateway.php:144
511
  msgid ""
512
  "When enabled, the request will only perform an Auth on the provided card. "
513
  "You can then later perform either a Capture or Void."
514
  msgstr ""
515
 
516
+ #: includes/payment/class-wc-square-gateway.php:148
517
  msgid "Create Customer"
518
  msgstr ""
519
 
520
+ #: includes/payment/class-wc-square-gateway.php:149
521
  msgid "Enable Create Customer"
522
  msgstr ""
523
 
524
+ #: includes/payment/class-wc-square-gateway.php:151
525
  msgid "When enabled, processing a payment will create a customer profile on Square."
526
  msgstr ""
527
 
528
+ #: includes/payment/class-wc-square-gateway.php:189
529
  msgid "Card Number"
530
  msgstr ""
531
 
532
+ #: includes/payment/class-wc-square-gateway.php:194
533
  msgid "Expiry (MM/YY)"
534
  msgstr ""
535
 
536
+ #: includes/payment/class-wc-square-gateway.php:195
537
+ #: includes/payment/class-wc-square-gateway.php:265
538
  msgid "MM / YY"
539
  msgstr ""
540
 
541
+ #: includes/payment/class-wc-square-gateway.php:199
542
  msgid "Card Code"
543
  msgstr ""
544
 
545
+ #: includes/payment/class-wc-square-gateway.php:200
546
+ #: includes/payment/class-wc-square-gateway.php:266
547
  msgid "CVV"
548
  msgstr ""
549
 
550
+ #: includes/payment/class-wc-square-gateway.php:204
551
+ #: includes/payment/class-wc-square-gateway.php:205
552
+ #: includes/payment/class-wc-square-gateway.php:267
553
  msgid "Card Postal Code"
554
  msgstr ""
555
 
556
+ #: includes/payment/class-wc-square-gateway.php:264
557
  msgid "•••• •••• •••• ••••"
558
  msgstr ""
559
 
560
+ #: includes/payment/class-wc-square-gateway.php:326
561
+ #: includes/payment/class-wc-square-gateway.php:333
562
+ #: includes/payment/class-wc-square-gateway.php:357
563
  msgid ""
564
  "Error: Square was unable to complete the transaction. Please try again "
565
  "later or use another means of payment."
566
  msgstr ""
567
 
568
+ #: includes/payment/class-wc-square-gateway.php:338
569
  msgid "Payment Error: "
570
  msgstr ""
571
 
572
+ #: includes/payment/class-wc-square-gateway.php:371
573
  #: includes/payment/class-wc-square-payments.php:136
574
+ #. translators: %s - transaction id
575
  msgid "Square charge complete (Charge ID: %s)"
576
  msgstr ""
577
 
578
+ #: includes/payment/class-wc-square-gateway.php:381
579
+ #. translators: %s - transaction id
580
  msgid ""
581
  "Square charge authorized (Authorized ID: %s). Process order to take "
582
  "payment, or cancel to remove the pre-authorization."
583
  msgstr ""
584
 
585
+ #: includes/payment/class-wc-square-gateway.php:404
586
+ #: includes/payment/class-wc-square-gateway.php:543
587
+ #. translators: %s - error message
588
  msgid "Error: %s"
589
  msgstr ""
590
 
591
+ #: includes/payment/class-wc-square-gateway.php:436
592
  msgid "Guest"
593
  msgstr ""
594
 
595
+ #: includes/payment/class-wc-square-gateway.php:456
596
+ #: includes/payment/class-wc-square-gateway.php:458
597
+ #: includes/payment/class-wc-square-gateway.php:464
598
+ #: includes/payment/class-wc-square-gateway.php:466
599
+ #. translators: %s - error message
600
+ #. translators: %s - errors
601
+ #. translators: %s - errors
602
  msgid "Error creating customer: %s"
603
  msgstr ""
604
 
605
+ #: includes/payment/class-wc-square-gateway.php:473
606
+ #. translators: %s - customer id
607
  msgid "Customer created on Square: %s"
608
  msgstr ""
609
 
610
+ #: includes/payment/class-wc-square-gateway.php:531
611
+ #. translators: %1$s - refund amount, %2$s - refund id, %3$s - refund reason
612
  msgid "Refunded %1$s - Refund ID: %2$s - Reason: %3$s"
613
  msgstr ""
614
 
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: automattic, royho, woothemes, bor0
3
  Tags: credit card, square, woocommerce, inventory sync
4
  Requires at least: 4.4
5
- Tested up to: 4.9
6
  Requires PHP: 5.6
7
- Stable tag: 1.0.33
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -57,6 +57,11 @@ If you get stuck, you can ask for help in the Plugin Forum.
57
 
58
  == Changelog ==
59
 
 
 
 
 
 
60
  = 1.0.33 - 2018-09-27 =
61
  * Update - WC tested up to version 3.5
62
 
2
  Contributors: automattic, royho, woothemes, bor0
3
  Tags: credit card, square, woocommerce, inventory sync
4
  Requires at least: 4.4
5
+ Tested up to: 5.0
6
  Requires PHP: 5.6
7
+ Stable tag: 1.0.34
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
57
 
58
  == Changelog ==
59
 
60
+ = 1.0.34 - 2018-11-07 =
61
+ * Update - Fieldset tag to div tag in payment box to prevent unwanted styling.
62
+ * Fix - Provide unique idempotency ID to the order instead of random unique number.
63
+ * Update - WP tested up to version 5.0
64
+
65
  = 1.0.33 - 2018-09-27 =
66
  * Update - WC tested up to version 3.5
67
 
woocommerce-square.php CHANGED
@@ -1,13 +1,13 @@
1
  <?php
2
  /**
3
  * Plugin Name: WooCommerce Square
4
- * Version: 1.0.33
5
  * Plugin URI: https://woocommerce.com/products/square/
6
  * Description: Adds ability to sync inventory between WooCommerce and Square POS. In addition, you can also make purchases through the Square payment gateway.
7
  * Author: WooCommerce
8
  * Author URI: https://www.woocommerce.com/
9
  * Requires at least: 4.5.0
10
- * Tested up to: 4.9
11
  * WC requires at least: 2.6
12
  * WC tested up to: 3.5
13
  * Text Domain: woocommerce-square
@@ -23,7 +23,7 @@ if ( ! defined( 'ABSPATH' ) ) {
23
 
24
  if ( ! class_exists( 'Woocommerce_Square' ) ) :
25
 
26
- define( 'WC_SQUARE_VERSION', '1.0.33' );
27
 
28
  /**
29
  * Main class.
1
  <?php
2
  /**
3
  * Plugin Name: WooCommerce Square
4
+ * Version: 1.0.34
5
  * Plugin URI: https://woocommerce.com/products/square/
6
  * Description: Adds ability to sync inventory between WooCommerce and Square POS. In addition, you can also make purchases through the Square payment gateway.
7
  * Author: WooCommerce
8
  * Author URI: https://www.woocommerce.com/
9
  * Requires at least: 4.5.0
10
+ * Tested up to: 5.0
11
  * WC requires at least: 2.6
12
  * WC tested up to: 3.5
13
  * Text Domain: woocommerce-square
23
 
24
  if ( ! class_exists( 'Woocommerce_Square' ) ) :
25
 
26
+ define( 'WC_SQUARE_VERSION', '1.0.34' );
27
 
28
  /**
29
  * Main class.