Zen Cart Logo
Forums / Addon Payment Modules / Square Payment Module for Zen Cart [Support Thread]

Square Payment Module for Zen Cart [Support Thread]

Sticky

Views: 366,766

Results 321 to 340 of 835
20 Dec 2019, 11:37 PM
#321
todoonada avatar

todoonada

Zen Follower

Join Date:
Nov 2006
Posts:
127
Plugin Contributions:
0

Square Payment Module for Zen Cart [Support Thread]

Great work on the Square module! Thank you!

When Square is updating their API (which they did quite often in 2019), can I usually update without worrying or is there a good chance that the Zen Cart module will not work anymore?

26 Dec 2019, 5:29 PM
#322
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: Square Payment Module for Zen Cart [Support Thread]

DrByte:

The customer's name is transmitted with the payment, but Square doesn't display it in their dashboard.

I think getting it to display requires injecting your customer into your Square account whenever a sale is made, then linking an order to that customer, and then linking the payment to that customer+order. That's gonna require a notable reworking of the Square module. It's on the radar but no date has been set for working on that yet.

I'm prepping for an update that improves other underlying components to be compatible with Square's latest updates. This update will also increase some of the data transmitted, but I don't expect it will fix the "Unknown" label you mentioned.

Would it be possible to display a field in the form instead? that way we store owners could also verify that information when processing the order. We had some quite serious problems in the past 2 years where a few of our customers were using their spouses/ex-spouses/boyfriends credit cards without their authorization (or so the credit card owners claimed) to place orders on our website, which we had to refund as they ended up being unauthorized. We lost the products and the funds, so not cool. Having a field in the form to verify the name on the card would at least provide a certain level of security for merchants (somewhat).

I looked into the square developer and I found (not that I even pretend to know anything about it) a the cardholder_name parameter https://developer.squareup.com/reference/square/customers-api/create-customer-card
Could this be incorporated?

Thank you for all you do, and for looking into this.

27 Dec 2019, 5:55 PM
#323
dennisns7d avatar

dennisns7d

New Zenner

Join Date:
Jan 2010
Posts:
55
Plugin Contributions:
0

Re: Square Payment Module for Zen Cart [Support Thread]

ZC 1.5.5f
PHP 7.1.33
MySQL 5.7.23-23
Square 0.97

I've got a cron job that runs on odd numbered days to refresh OAuth. It's been running quietly for months. A bit over a week ago, it's been triggering the following error:

[19-Dec-2019 00:00:02 America/Los_Angeles] PHP Fatal error:  Uncaught Error: Class 'square' not found in /*****/********/public_html/mystoredomain/square_handler.php:21
Stack trace:
#0 {main}
  thrown in /*****/********/public_html/mystoredomain/square_handler.php on line 21

I've verified that the cron is running PHP 7.1.33.

My host changed how they serve up PHP on December 17 that bumped the PHP version my cart used to 7.3, which triggered numerous errors/warnings. I went into the control panel and backed PHP down to 7.1.33. I've been getting the cron triggered errors since then.

I haven't done any significant changes to the cart in this time frame. Square payments are being processed normally.

I would appreciate any thoughts and suggestions on how to fix this.

29 Dec 2019, 12:49 AM
#324
dennisns7d avatar

dennisns7d

New Zenner

Join Date:
Jan 2010
Posts:
55
Plugin Contributions:
0

Re: Square Payment Module for Zen Cart [Support Thread]

I've tracked down the reason that the cron job triggers the error reported in my last post.

It appears that with the latest host changes that $PHP_SELF and (most?) $_SERVER variables are empty when the script is run from cron. The code in includes/classes/payment.php failed to find the square payment module because it extracts the script type (.php) from the $PHP_SELF variable.

My patch to get around this problem was to set $PHP_SELF to FILE if $PHP_SELF was empty in square_handler.php near line 13:

require 'includes/application_top.php';
if (empty($PHP_SELF)) $PHP_SELF = __FILE__; // ensure that $PHP_SELF is not empty
require DIR_WS_CLASSES . 'payment.php';

All seems well now.

11 Jan 2020, 1:43 PM
#325
dkerfoot avatar

dkerfoot

New Zenner

Join Date:
Mar 2007
Posts:
72
Plugin Contributions:
0

Re: Square Payment Module for Zen Cart [Support Thread]

ZC 1.5.4
PHP 5.6.40
MySQL 5.7.28
Square 0.97

Hoping for some help troubleshooting SQ-NONCE-FAILURE. Understand it is probably in my template's tpl_checkout_payment_default.php file. I have done some coding in the past, but this is beyond my current understanding of ZC. To me, line 22 below (not numbered, sorry)
<?php echo zen_draw_form('checkout_payment', zen_href_lin
looks to me to fulfill the "<form> element with a name="checkout_payment" in it" requirement, but there is much I don't understand. :)

Console errors:
Uncaught ReferenceError: $ is not defined at index.php?main_page=checkout_payment:100Uncaught ReferenceError: $ is not defined at index.php?main_page=checkout_payment:188

Using a Template named Cold_Steel

Please?

tpl_checkout_payment_default.php

<?php
/**
 * Page Template
 *
 * Loaded automatically by index.php?main_page=checkout_payment.<br />
 * Displays the allowed payment modules, for selection by customer.
 *
 * @package templateSystem
 * @copyright Copyright 2003-2011 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license [URL]http://www.zen-cart.com/license/2_0.txt[/URL] GNU Public License V2.0
  **********************************************************************
 *This program is distributed in the hope that it will be useful, but
 *WITHOUT ANY WARRANTY; without even the implied warranty of
 *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
**********************************************************************
* @version $Id: tpl_checkout_payment_default.php 19358 2011-08-24 17:36:50Z drbyte $
 */
?>
<?php echo $payment_modules->javascript_validation(); ?>
<div class="centerColumn" id="checkoutPayment">
<?php echo zen_draw_form('checkout_payment', zen_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post', ($flagOnSubmit ? 'onsubmit="return check_form();"' : '')); ?>
<?php echo zen_draw_hidden_field('action', 'submit'); ?>


<h1 id="checkoutPaymentHeading"><?php echo HEADING_TITLE; ?></h1>


<!-- bof Order Steps (tableless) -->
    <div class="progressmeter">
        <?php echo TEXT_ORDER_STEPS_INFO; ?>
        <ol>
        <li class="one"><span><?php echo DONE_TEXT_ORDER_STEPS; ?></span><?php echo TEXT_ORDER_STEPS_1; ?></li>
        <li class="two current"><span><?php echo CURRENT_TEXT_ORDER_STEPS; ?></span><?php echo TEXT_ORDER_STEPS_2; ?></li>
        <li class="three"><span><?php echo NEXT_TEXT_ORDER_STEPS_3; ?></span><?php echo TEXT_ORDER_STEPS_3; ?></li>
        <li class="four"><span><?php echo NEXT_TEXT_ORDER_STEPS_4; ?></span><?php echo TEXT_ORDER_STEPS_4; ?></li>
        </ol>
    </div>


<!-- eof Order Steps (tableless) -->


<?php if ($messageStack->size('redemptions') > 0) echo $messageStack->output('redemptions'); ?>
<?php if ($messageStack->size('checkout') > 0) echo $messageStack->output('checkout'); ?>
<?php if ($messageStack->size('checkout_payment') > 0) echo $messageStack->output('checkout_payment'); ?>


<?php
  if (DISPLAY_CONDITIONS_ON_CHECKOUT == 'true') {
?>
<fieldset>
<legend><?php echo TABLE_HEADING_CONDITIONS; ?></legend>
<div><?php echo TEXT_CONDITIONS_DESCRIPTION;?></div>
<?php echo  zen_draw_checkbox_field('conditions', '1', false, 'id="conditions"');?>
<label class="checkboxLabel" for="conditions"><?php echo TEXT_CONDITIONS_CONFIRM; ?></label>
</fieldset>
<?php
  }
?>


<?php // ** BEGIN PAYPAL EXPRESS CHECKOUT **
      if (!$payment_modules->in_special_checkout()) {
      // ** END PAYPAL EXPRESS CHECKOUT ** ?>
<h2 id="checkoutPaymentHeadingAddress"><?php echo TITLE_BILLING_ADDRESS; ?></h2>


<div id="checkoutBillto" class="floatingBox back">
<?php if (MAX_ADDRESS_BOOK_ENTRIES >= 2) { ?>
<div class="buttonRow forward"><?php echo '<a href="' . zen_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_CHANGE_ADDRESS, BUTTON_CHANGE_ADDRESS_ALT) . '</a>'; ?></div>
<?php } ?>
<address><?php echo zen_address_label($_SESSION['customer_id'], $_SESSION['billto'], true, ' ', '<br />'); ?></address>
</div>


<div class="floatingBox important forward"><?php echo TEXT_SELECTED_BILLING_DESTINATION; ?></div>
<br class="clearBoth" />
<?php // ** BEGIN PAYPAL EXPRESS CHECKOUT **
      }
      // ** END PAYPAL EXPRESS CHECKOUT ** ?>


<fieldset id="checkoutOrderTotals">
<legend id="checkoutPaymentHeadingTotal"><?php echo TEXT_YOUR_TOTAL; ?></legend>
<?php
  if (MODULE_ORDER_TOTAL_INSTALLED) {
    $order_totals = $order_total_modules->process();
?>
<?php $order_total_modules->output(); ?>
<?php
  }
?>
</fieldset>


<?php
  $selection =  $order_total_modules->credit_selection();
  if (sizeof($selection)>0) {
    for ($i=0, $n=sizeof($selection); $i<$n; $i++) {
      if ($_GET['credit_class_error_code'] == $selection[$i]['id']) {
?>
<div class="messageStackError"><?php echo zen_output_string_protected($_GET['credit_class_error']); ?></div>


<?php
      }
      for ($j=0, $n2=sizeof($selection[$i]['fields']); $j<$n2; $j++) {
?>
<fieldset>
<legend><?php echo $selection[$i]['module']; ?></legend>
<?php echo $selection[$i]['redeem_instructions']; ?>
<div class="gvBal larger"><?php echo $selection[$i]['checkbox']; ?></div>
<label class="inputLabel"<?php echo ($selection[$i]['fields'][$j]['tag']) ? ' for="'.$selection[$i]['fields'][$j]['tag'].'"': ''; ?>><?php echo $selection[$i]['fields'][$j]['title']; ?></label>
<?php echo $selection[$i]['fields'][$j]['field']; ?>
</fieldset>
<?php
      }
    }
?>


<?php
    }
?>


<?php // ** BEGIN PAYPAL EXPRESS CHECKOUT **
      if (!$payment_modules->in_special_checkout()) {
      // ** END PAYPAL EXPRESS CHECKOUT ** ?>
<fieldset>
<legend><?php echo TABLE_HEADING_PAYMENT_METHOD; ?></legend>


<?php
  if (SHOW_ACCEPTED_CREDIT_CARDS != '0') {
?>


<?php
    if (SHOW_ACCEPTED_CREDIT_CARDS == '1') {
      echo TEXT_ACCEPTED_CREDIT_CARDS . zen_get_cc_enabled();
    }
    if (SHOW_ACCEPTED_CREDIT_CARDS == '2') {
      echo TEXT_ACCEPTED_CREDIT_CARDS . zen_get_cc_enabled('IMAGE_');
    }
?>
<br class="clearBoth" />
<?php } ?>


<?php
  $selection = $payment_modules->selection();


  if (sizeof($selection) > 1) {
?>
<p class="important"><?php echo TEXT_SELECT_PAYMENT_METHOD; ?></p>
<?php
  } elseif (sizeof($selection) == 0) {
?>
<p class="important"><?php echo TEXT_NO_PAYMENT_OPTIONS_AVAILABLE; ?></p>


<?php
  }
?>


<?php
  $radio_buttons = 0;
  for ($i=0, $n=sizeof($selection); $i<$n; $i++) {
?>
<?php
    if (sizeof($selection) > 1) {
        if (empty($selection[$i]['noradio'])) {
 ?>
<?php echo zen_draw_radio_field('payment', $selection[$i]['id'], ($selection[$i]['id'] == $_SESSION['payment'] ? true : false), 'id="pmt-'.$selection[$i]['id'].'"'); ?>
<?php   } ?>
<?php
    } else {


?>
<?php echo zen_draw_hidden_field('payment', $selection[$i]['id'], 'id="pmt-'.$selection[$i]['id'].'"'); ?>
<?php
    }
?>
<label for="pmt-<?php echo $selection[$i]['id']; ?>" class="radioButtonLabel"><?php echo $selection[$i]['module']; ?></label>


<?php
    if (defined('MODULE_ORDER_TOTAL_COD_STATUS') && MODULE_ORDER_TOTAL_COD_STATUS == 'true' and $selection[$i]['id'] == 'cod') {
?>
<div class="alert"><?php echo TEXT_INFO_COD_FEES; ?></div>
<?php
    } else {
      // echo 'WRONG ' . $selection[$i]['id'];
?>
<?php
    }
?>
<br class="clearBoth" />


<?php
    if (isset($selection[$i]['error'])) {
?>
    <div><?php echo $selection[$i]['error']; ?></div>


<?php
    } elseif (isset($selection[$i]['fields']) && is_array($selection[$i]['fields'])) {
?>


<div class="ccinfo">
<?php
      for ($j=0, $n2=sizeof($selection[$i]['fields']); $j<$n2; $j++) {
?>
<label <?php echo (isset($selection[$i]['fields'][$j]['tag']) ? 'for="'.$selection[$i]['fields'][$j]['tag'] . '" ' : ''); ?>class="inputLabelPayment"><?php echo $selection[$i]['fields'][$j]['title']; ?></label><?php echo $selection[$i]['fields'][$j]['field']; ?>
<br class="clearBoth" />
<?php
      }
?>
</div>
<br class="clearBoth" />
<?php
    }
    $radio_buttons++;
?>
<br class="clearBoth" />
<?php
  }
?>


</fieldset>
<?php // ** BEGIN PAYPAL EXPRESS CHECKOUT **
      } else {
        ?><input type="hidden" name="payment" value="<?php echo $_SESSION['payment']; ?>" /><?php
      }
      // ** END PAYPAL EXPRESS CHECKOUT ** ?>
<fieldset>
<legend><?php echo TABLE_HEADING_COMMENTS; ?></legend>
<?php echo zen_draw_textarea_field('comments', '45', '3'); ?>
</fieldset>


<div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_CONTINUE_CHECKOUT, BUTTON_CONTINUE_ALT, 'onclick="submitFunction('.zen_user_has_gv_account($_SESSION['customer_id']).','.$order->info['total'].')"'); ?></div>
<div class="buttonRow back"><?php echo TITLE_CONTINUE_CHECKOUT_PROCEDURE . '<br />' . TEXT_CONTINUE_CHECKOUT_PROCEDURE; ?></div>


</form>
</div>
11 Jan 2020, 2:13 PM
#326
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Square Payment Module for Zen Cart [Support Thread]

The console error that you noted above:

Console errors:
Uncaught ReferenceError: $ is not defined at index.php?main_page=checkout_payment:100Uncaught ReferenceError: $ is not defined at index.php?main_page=checkout_payment:188

implies to me that your template's /common/html_header.php isn't loading jQuery (or loading a woefully old version). Make sure, too, that your template includes /jscript/jscript_framework.php (that's the AJAX support interface).

12 Jan 2020, 2:31 AM
#327
todoonada avatar

todoonada

Zen Follower

Join Date:
Nov 2006
Posts:
127
Plugin Contributions:
0

Re: Square Payment Module for Zen Cart [Support Thread]

What is the postal code input in the Square module needed for? Normally postal code is not needed for payment by credit card.

12 Jan 2020, 6:44 PM
#328
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,763
Plugin Contributions:
9

Re: Square Payment Module for Zen Cart [Support Thread]

todoonada:

What is the postal code input in the Square module needed for? Normally postal code is not needed for payment by credit card.Square looks for a match between the billing zip and the zip presented in the form. Not unlike many gas stations that ask for a zip to verify the card.

We've had several instances where corporate or charitable zip codes do not match the billing as they often confuse the zip of the holder with the zip of the institution.

Just another way for Square to better verify the transaction.

14 Jan 2020, 2:50 PM
#329
dkerfoot avatar

dkerfoot

New Zenner

Join Date:
Mar 2007
Posts:
72
Plugin Contributions:
0

Re: Square Payment Module for Zen Cart [Support Thread]

lat9:

The console error that you noted above:

Console errors:
Uncaught ReferenceError: $ is not defined at index.php?main_page=checkout_payment:100Uncaught ReferenceError: $ is not defined at index.php?main_page=checkout_payment:188

> implies to me that your template's /common/html_header.php isn't loading jQuery (or loading a woefully old version).  Make sure, too, that your template includes /jscript/jscript_framework.php (that's the AJAX support interface).

Thanks!  I've updated to 1.5.6c and confirmed that the standard responsive_classic template fixes the error while it remains a problem with the cold_steel template.  I appreciate you taking the time to set me on the right path.

-Doug
14 Jan 2020, 3:17 PM
#330
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Square Payment Module for Zen Cart [Support Thread]

dkerfoot:

Thanks! I've updated to 1.5.6c and confirmed that the standard responsive_classic template fixes the error while it remains a problem with the cold_steel template. I appreciate you taking the time to set me on the right path.

-Doug
Ah, yes, that cold_steel template far out-dates the introduction of the Zen Cart AJAX framework. If you want to continue using cold_steel, just copy the zc156c's responsive_classic/jscript/jscript_framework.php to cold_steel/jscript. That version of the file simply brings in the common, template_default, version of the framework.

Note, though, that there will be a significant number of changes needed for that template to continue operation under current versions of PHP.

17 Jan 2020, 12:25 PM
#331
todoonada avatar

todoonada

Zen Follower

Join Date:
Nov 2006
Posts:
127
Plugin Contributions:
0

Re: Square Payment Module for Zen Cart [Support Thread]

Any error in input of the cc data is handled by https://js.squareup.com/v2/paymentform which is linked to from jscript_square.php.
How can I change the language of the error messages? Error messages are

  • Credit card number is not valid
  • CVV is not valid
  • Expiration date is not valid
    I need Japanese.
17 Jan 2020, 6:50 PM
#332
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Square Payment Module for Zen Cart [Support Thread]

todoonada:

Any error in input of the cc data is handled by https://js.squareup.com/v2/paymentform which is linked to from jscript_square.php.
How can I change the language of the error messages? Error messages are

  • Credit card number is not valid
  • CVV is not valid
  • Expiration date is not valid

I need Japanese.

I asked Square about it, and they said:

SquareSupport:

Currently all payment form errors are returned in English; we don’t offer any translations at this time, so it would be up to you to provide those translations if needed

So I guess that means needing to write some custom javascript, which you'd fire from jscript_square.php before the paymentform js is loaded.

17 Jan 2020, 6:55 PM
#333
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Square Payment Module for Zen Cart [Support Thread]

todoonada:

Great work on the Square module! Thank you!

When Square is updating their API (which they did quite often in 2019), can I usually update without worrying or is there a good chance that the Zen Cart module will not work anymore?

Zen Cart can only implement the features it knows about, which is done in conjunction with the actual API SDK files distributed with the module. You could find yourself having problems if you mismatch them.

17 Jan 2020, 7:06 PM
#334
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Square Payment Module for Zen Cart [Support Thread]

mvstudio:

DrByte:

The customer's name is transmitted with the payment, but Square doesn't display it in their dashboard.

I think getting it to display requires injecting your customer into your Square account whenever a sale is made, then linking an order to that customer, and then linking the payment to that customer+order. That's gonna require a notable reworking of the Square module. It's on the radar but no date has been set for working on that yet.Would it be possible to display a field in the form instead? that way we store owners could also verify that information when processing the order. We had some quite serious problems in the past 2 years where a few of our customers were using their spouses/ex-spouses/boyfriends credit cards without their authorization (or so the credit card owners claimed) to place orders on our website, which we had to refund as they ended up being unauthorized. We lost the products and the funds, so not cool. Having a field in the form to verify the name on the card would at least provide a certain level of security for merchants (somewhat).

I looked into the square developer and I found (not that I even pretend to know anything about it) a the cardholder_name parameter https://developer.squareup.com/reference/square/customers-api/create-customer-card
Could this be incorporated?

Thank you for all you do, and for looking into this.

As far as having that data show on Square's end, I believe it's tied to the same thing I mentioned earlier. I think it'll require creating the complete customer record in order to get any of that data to show in their dashboard.

I suppose you could add the custom field to the payment page and make sure the Order class stores it when saving the order, so that in your own Zen Cart admin screens you could access the cardholder name. Again, you wouldn't see it on Square's end though. You'd need to add cc_owner in the various parts of this section of the module: https://github.com/zencart/zencart/blob/b4bbe3f4832b32e05e7bf74c45450abe737477d4/includes/modules/payment/square.php#L166-L257 akin to what's done here in this one: https://github.com/zencart/zencart/blob/b4bbe3f4832b32e05e7bf74c45450abe737477d4/includes/modules/payment/authorizenet_aim.php#L222-L318

18 Jan 2020, 2:00 AM
#335
todoonada avatar

todoonada

Zen Follower

Join Date:
Nov 2006
Posts:
127
Plugin Contributions:
0

Re: Square Payment Module for Zen Cart [Support Thread]

DrByte:

I asked Square about it, and they said:

So I guess that means needing to write some custom javascript, which you'd fire from jscript_square.php before the paymentform js is loaded.
Thank you.
I tried that changing jscript_square.php. First I made a little test. I changed the line
console.error("Encountered errors:");
to
console.error("Test");

My changed line shows up in the source code of the page, but the console still shows "Encountered errors:" instead of "Test".

18 Jan 2020, 6:43 PM
#336
brds avatar

brds

New Zenner

Join Date:
Jan 2020
Location:
UK
Posts:
2
Plugin Contributions:
0

Re: Square Payment Module for Zen Cart [Support Thread]

I am unable to make this module work and am confronted with the SQ-NONCE-FAILURE error at every turn.

I am running zencart 1.5.6c on php 7.3

I have check and tried all the previous advise in this thread and the Square set up common problems, but still no luck. All files are in the right place, the module is installed and activated with a valid token and date. I also have no js errors... I have even removed my custom js code and just tried with plain jquery (deferred and not).

One thing I have noticed is that in the console the following error is logged...

0: Unable to get property 'SavePersonalAndPaymentData' of undefined or null reference - Autoformfill_ContentScript.js (1,20660)

I am getting a nonce code, I amended the code to log this in the console to ensure one is generated... and even unhid the input field that this is placed in to see it is actually placed in the input field before the submit confinues.... but it just refuses to work.

What else can I try, I have been at this all day, and going crazy :wacko:

18 Jan 2020, 8:43 PM
#337
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,763
Plugin Contributions:
9

Re: Square Payment Module for Zen Cart [Support Thread]

Have you tried backing off of 7.3? No problems here with 7.2

19 Jan 2020, 9:29 AM
#338
todoonada avatar

todoonada

Zen Follower

Join Date:
Nov 2006
Posts:
127
Plugin Contributions:
0

Re: Square Payment Module for Zen Cart [Support Thread]

todoonada:

Thank you.
I tried that changing jscript_square.php. First I made a little test. I changed the line
console.error("Encountered errors:");
to
console.error("Test");

My changed line shows up in the source code of the page, but the console still shows "Encountered errors:" instead of "Test".

I tried again and for some unknown reason it works now. No idea what I did wrong the first time. I did the following quick'n dirty fix:
After this line in jscript_square.php
error_html += "<li> " + error.message + " </li>";
I added
error_html=error_html.replace("Credit card number is not valid","Translation Text Here");
error_html=error_html.replace("CVV is not valid","Translation Text Here");
error_html=error_html.replace("Expiration date is not valid","Translation Text Here");

23 Jan 2020, 4:10 PM
#339
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: Square Payment Module for Zen Cart [Support Thread]

DrByte:

As far as having that data show on Square's end, I believe it's tied to the same thing I mentioned earlier. I think it'll require creating the complete customer record in order to get any of that data to show in their dashboard.

I suppose you could add the custom field to the payment page and make sure the Order class stores it when saving the order, so that in your own Zen Cart admin screens you could access the cardholder name. Again, you wouldn't see it on Square's end though. You'd need to add cc_owner in the various parts of this section of the module: https://github.com/zencart/zencart/blob/b4bbe3f4832b32e05e7bf74c45450abe737477d4/includes/modules/payment/square.php#L166-L257 akin to what's done here in this one: https://github.com/zencart/zencart/blob/b4bbe3f4832b32e05e7bf74c45450abe737477d4/includes/modules/payment/authorizenet_aim.php#L222-L318

Thank you for pointing me in the right direction Dr Byte! I don't mind if it doesn't show on Square's end, as long as I have that information on my own Zen Cart admin screens prior to processing the order. If I get it working I'll share what I've done, which I'm sure will need some corrections from the masters :D

24 Jan 2020, 3:54 PM
#340
dkerfoot avatar

dkerfoot

New Zenner

Join Date:
Mar 2007
Posts:
72
Plugin Contributions:
0

Re: Square Payment Module for Zen Cart [Support Thread]

Do I understand correctly that there is no address verification service (AVS) with Square?