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,726

Results 81 to 100 of 835
22 Nov 2017, 4:55 AM
#81
drbyte avatar

drbyte

Sensei

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

Square Payment Module for Zen Cart [Support Thread]

jmsnyder23:

Okay, I figured it out :)

For those who may encounter the same problem, make sure your Redirect URL includes /square_handler.php. This information is NOT included in the instructions on the Square website, which were the ones I was following (it IS in the Zen Cart instructions).
Thanks for posting back.
I note that the correct Redirect URL is also displayed in your Zen Cart Admin's Square page, near the Token Authorize button.

22 Nov 2017, 7:36 PM
#82
top_hatt avatar

top_hatt

Zen Follower

Join Date:
Feb 2010
Posts:
237
Plugin Contributions:
0

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

Hi:

I need some help trying to use the Square payments with my Zen Cart store.

I am a Canadian, but my website sells in both Canadian and U.S. dollars. I kept the U.S. currency as the default since most of my goods come from the U.S. and are sold to me in U.S. dollars.

I set up the Square Payments last week and it seemed to be working fine.

When the sale goes though in U.S. dollars the admin order edit screen is correct and everything is fine. Square reads that amount and the payment is correct.

Yesterday, I had a sale in Canadian funds. When that happens the admin order edit screen is wrong. It always has been. (the amount is converted to U.S. dollars in the display). The printed invoice is correct, but the edit order screen is not.

Square is taking that edit orders screen amount as the actual payment amount, which is incorrect.

Has anyone else had this happen? Is there a way to get the edit orders screen to be correct in Canadian currency? Is there a way to have Square payments get the correct amount when this happens?

My website is https://poolcuesexpress.com. I am running version 1.5.4.

Any help would be appreciated.

Dave H.

22 Nov 2017, 7:49 PM
#83
drbyte avatar

drbyte

Sensei

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

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

Hmmm, the last time I did an alternate-currency sale using this module it did the exchange correctly for me.

You may already have this correct, but I must ask: What exchange rates do you have set for CAD vs USD in your Admin?

22 Nov 2017, 8:36 PM
#84
top_hatt avatar

top_hatt

Zen Follower

Join Date:
Feb 2010
Posts:
237
Plugin Contributions:
0

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

Dr. Byte

I have U.S. default set at 1.000 and Canadian set at 1.2999

Dave H

24 Nov 2017, 5:21 AM
#85
mvstudio avatar

mvstudio

Zen Follower

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

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

Hello everyone.

I've tried implementing ApplePay to the Square payment as per the instructions on the blog post https://medium.com/square-corner-blog/introducing-apple-pay-on-the-web-for-squares-apis-1f85cb6fe433 and the instructions found here https://docs.connect.squareup.com/payments/sqpaymentform/config-apple-pay-web with no success.

Can someone please provide some guidance?

Thank you.

27 Nov 2017, 12:40 PM
#86
top_hatt avatar

top_hatt

Zen Follower

Join Date:
Feb 2010
Posts:
237
Plugin Contributions:
0

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

Hi:

Can someone offer any guidance on where I should look to correct this.

I have the Square payment module turned off for right now, but I would like to get it working.

Dave

30 Nov 2017, 2:13 AM
#87
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]

We are experiencing problems with Square and One Page Checkout (OPC) See thread starting at https://www.zen-cart.com/showthread.php?220781-One-Page-Checkout-Support-Thread&p=1338767#post1338767

Further investigation shows that Square Payment is somehow inserting itself into the OPC proccess when a new customer selects Pay Pal Express. We were getting```
paymentform:1 Uncaught Error: SqPaymentForm element with id square_cc-number not found. Has the DOM finished loading?
See: https://docs.connect.squareup.com/articles/adding-payment-form/#generatingpaymentform
at s.buildIframeController (paymentform:1)
at s.buildIframeControllers (paymentform:1)
at s.build (paymentform:1)
at s.build (paymentform:1)
s.buildIframeController @ paymentform:1
s.buildIframeControllers @ paymentform:1
s.build @ paymentform:1
s.build @ paymentform:1

PayPal brings the customer back to OPC and Square is looking for the cc number.
When PayPal brings the customer back to Step 2 of 3 in the standard checkout, the Square error is also there BUT, it disappears when the customer goes to Step 3 of 3.  Once on Step 3 of 3, PayPal will confirm even with Square turned on as the error disappears between steps 2 and 3.


The system goes through all steps including registering the New Customer, emailing info, order shows up, etc.


Again, ALL failed testing is done as never before customer, using PayPal from Split-Page Login.


Conversely, when a logged-in user orders an item and clicks on Checkout (OPC ON - Square ON), the OPC is shown with the options for a CC or PayPal Express.  Choosing PayPal Express and clicking Confirm takes the logged-in user to PayPal and completes the order on return.  It does not return to OPC to give the user the option to confirm but, goes immediately to completion.


Synopsis:


We were wondering why some PayPal orders were coming in and we were getting emails that PayPal would not allow others to check out.  Current trials result in:


1.  Customer NOT logged in and NOT a previous customer with both Square and OPC enabled
    *    Places item in cart
    * Selects Check Out
    * Arrives a split-login
    * Selects PayPal Express
    * Browser opens PayPal
    * Customer selects method of payment and pays
    * Browser returns to site with "uncaught Error" from Square
    * Customer is unable to complete the transaction as the Confirm Order Button does nothing
    
2.  Returning Customer Or Newly Registered Customer, logged in with both Square and OPC enabled. 
    *    Places item in cart
    * Selects Check Out
    * Arrives at OPC with options for Square, PayPal, or Money Order
    * Selects PayPal Express
    * Browser opens PayPal
    * Customer selects method of payment and pays
    * Browser returns to site and completes the transaction without requiring any further action from the Customer


We are still not certain whether Square or OPC is the culprit but, one of them is "sticking it's nose in where it doesn't belong."

Still uncertain as to whether Square is incorrectly looking for a cc_number or OPC is incorrecly looking for the cc_number from Square upon the Customer's return from PayPal.

Turning OPC off allows all customers to complete the process so, we have disabled OPC for now and hope a resolution is forthcoming.

Any information needed will be gladly provided.
7 Dec 2017, 10:56 PM
#88
mvstudio avatar

mvstudio

Zen Follower

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

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

Hi again. I posted this sort of request above, but got no answer, so I'm posting it again (thank you and sorry!)

I've tried implementing ApplePay to the Square payment as per the instructions on the blog post https://medium.com/square-corner-blo...s-1f85cb6fe433 and the instructions found here https://docs.connect.squareup.com/pa...-apple-pay-web with no success.

Can someone please provide some guidance?

Thank you. 

Also would it be possible to have customers insert the name on the card along side the rest of the information? As it is right now, the plugin isn't asking for the name on the card, and we have strict policies in this regard. Before anyone asks, we've been burned before (ex-wife buying with ex-husbands CC) and of course bank sided with CC owner, needless to say we lost both the money and the merchandise, so if possible would like to prevent this sort of issue in the future.

Thank you!! =)

8 Dec 2017, 12:56 PM
#89
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

top hatt:

Hi:

I need some help trying to use the Square payments with my Zen Cart store.

I am a Canadian, but my website sells in both Canadian and U.S. dollars. I kept the U.S. currency as the default since most of my goods come from the U.S. and are sold to me in U.S. dollars.

I set up the Square Payments last week and it seemed to be working fine.

When the sale goes though in U.S. dollars the admin order edit screen is correct and everything is fine. Square reads that amount and the payment is correct.

Yesterday, I had a sale in Canadian funds. When that happens the admin order edit screen is wrong. It always has been. (the amount is converted to U.S. dollars in the display). The printed invoice is correct, but the edit order screen is not.

Square is taking that edit orders screen amount as the actual payment amount, which is incorrect.

Has anyone else had this happen? Is there a way to get the edit orders screen to be correct in Canadian currency? Is there a way to have Square payments get the correct amount when this happens?

My website is https://poolcuesexpress.com. I am running version 1.5.4.

Any help would be appreciated.

Dave H.

DrByte:

Hmmm, the last time I did an alternate-currency sale using this module it did the exchange correctly for me.

You may already have this correct, but I must ask: What exchange rates do you have set for CAD vs USD in your Admin?

top hatt:

Dr. Byte

I have U.S. default set at 1.000 and Canadian set at 1.2999

Dave H

Haven't checked if the issue remains in ZC 1.5.5 yet, but unrelated to Square. Looking over the purchase history from a ZC 1.5.3 site, came across the same scenario. Purchase made in foreign currency (store set for USD as default, purchase made with €. On the standard invoice slip, all amounts shown in € with proper units and values. On invoice, the sub-total and total reflect $ as converted using the then current conversion rate. Ie. The price of the item was $30.00, no taxes, the price was shown correctly for the product as paid for in € on the product line and correctly in $ for sub-total and total, but it seems unusual to not all be in one currency. When I changed the in store currency conversion for € (drastic change from something like 0.98xxxx to 0.5) there was no change in the display of price on the standard edit screen for the order.

Again, I don't think the issue is in Square or any particular payment module as the payment described above was through paypal and that it instead is some factor of display/calculation associated with the edit screen/orders code.

8 Dec 2017, 3:26 PM
#90
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]

I've determined that there is an interoperability issue when Square, PayPal Express Checkout (shortcut) and One-Page Checkout are all enabled for a site. See https://www.zen-cart.com/showthread.php?220781-One-Page-Checkout-Support-Thread&p=1339137#post1339137 One-Page Checkout posting for details.

The update for the Square payment method requires change to the plugin's /includes/modules/pages/checkout_payment/jscript_square.php as follows:

if ([B]$payment_modules->in_special_checkout() ||[/B] !defined(MODULE_PAYMENT_SQUARE_STATUS) || MODULE_PAYMENT_SQUARE_STATUS != 'True' || (!defined('MODULE_PAYMENT_SQUARE_APPLICATION_ID') || MODULE_PAYMENT_SQUARE_ACCESS_TOKEN == '')) {
    return false;
}
10 Dec 2017, 12:50 PM
#91
top_hatt avatar

top_hatt

Zen Follower

Join Date:
Feb 2010
Posts:
237
Plugin Contributions:
0

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

Hi:

I agree with you that it does not seem to be an issue with Square making the admin/customers/orders/edit screen incorrect.

When the sale goes though in U.S. dollars the admin/customers/orders/edit screen is correct and everything is fine.

When I have a sale in Canadian funds the admin/customers/orders/edit screen is wrong.

The product description line with pricing is correct in Canadian dollars.

The Subtotal line is incorrect. The price is displayed converted to U.S. dollars.

The shipping cost line is incorrect. The price is displayed converted to U.S. dollars.

The sales tax line is incorrect. The price is displayed converted to U.S. dollars.

The Grand Total amount is incorrect. The price is displayed converted to U.S. dollars.

Square is taking the Grand Total amount from the admin/customers/order/edit order screen as the amount to pay in Canadian dollars, since the purchase was made in Canadian dollars.

This is off by the difference in the conversion rate between USD and CDN.

Is there a way to either correct the admin/customers/orders/edit screen or get Square to take the payment amount from the admin/customers/orders/invoice screen. The invoice screen is correct.

Dave

27 Dec 2017, 8:30 PM
#92
drbyte avatar

drbyte

Sensei

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

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

A few days ago I did some testing with this on a store configured with USD as primary currency.
When I placed an order as a customer using CAD currency, the Admin displays all amounts in CAD as calculated at the time the order was placed.
In the Square data (gray box) Square reports that it charged a certain USD equivalent on the specified day.

The rest of the Admin order details page shows everything in CAD, since that's what got stored in the database when the order was placed.

I don't think Square is causing any issues here at all.

Are you saying you wish that the Admin forced all prices back to your primary USD amount, instead of displaying what the customer purchased it as? I think that's a bigger challenge ... again, a separate discussion from Square, as I think the same behavior happens regardless which payment module is in use.

29 Dec 2017, 1:10 PM
#93
top_hatt avatar

top_hatt

Zen Follower

Join Date:
Feb 2010
Posts:
237
Plugin Contributions:
0

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

Dr. Byte:

I am using Zen Cart version 1.5.4.

On my install the admin/customers/orders/edit screen has always been wonky.

When the sale goes though in U.S. dollars the admin/customers/orders/edit screen is correct and everything is fine.

When I have a sale in Canadian funds the admin/customers/orders/edit screen is incorrect.

The product description line with pricing is correct in Canadian dollars.

The Subtotal line is incorrect. The price is displayed converted to U.S. dollars.

The shipping cost line is incorrect. The price is displayed converted to U.S. dollars.

The sales tax line is incorrect. The price is displayed converted to U.S. dollars.

The Grand Total amount is incorrect. The price is displayed converted to U.S. dollars.

I believe Square took the grand total amount for payment, but treated it as if it was Canadian funds. This made the payment incorrect by the amount of the currency conversion.

After posting my problem on the Square Payment Module forum, I reevaluated what had happened and thought that fixing my admin/customers/orders/edit screen may be a better approach to the problem.

I posted my issue about the admin/customers/orders/edit screen on the Managing Customers and Orders forum and mc12345678 helped me change the code for the admin/orders.php file which resolved the issue. The admin/customers/orders/edit screen now is correct in either USD or CDN.

I have not had time to retest the Square module yet to confirm that this change has corrected the issue. I will try to do that today.

Thank you for taking the time to help me. I will report back when I have retested the Square payments.

Dave H.

29 Dec 2017, 2:37 PM
#94
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

If I may again weigh in on the discussion and somewhat importantly the terminology.

The statement that the amount is "wrong" perhaps comes from the equivalent display of a currency symbol between US and CAD (would suggest adding an identifier to each if both currencies are going to be used within the same store by way of the currencies portion of the admin). Reason being, the amounts are not incorrect as displayed, they are mis-understood.

As to how they are displayed differently or mixed within a purchase, a similar "issue" was seen using a different payment processor where the payment processor setup allowed the currency to be collected and remain in the "alternate" or selected currency. Ie. A payment made in Canadian dollars (CAD) would be "stored" to remain in CAD unless requested to be converted to another currency. The same was possible for whatever currency was accepted by the payment processor and as handled by the account holder. This allows the store to "dictate" the conversion rate, but collect and keep the funds in the paid for currency. At a later time the funds could be converted by the payment processor or used as provided to perform a transaction.

Now I just looked at the setup options available in the 0.90 version of this module within ZC, but that side of the payment module does not offer settings like described above of "choosing" which currency in which to collect and store the money provided by a customer.

That said though, when using PayPal express where the currency selection was chosen to be the selected currency, then the mixed content of currencies on the order's edit screen had been seen (ultimately prompting a change in payment acceptance to Only {the currency primary to the store} as there has not been a need to maintain funds in alternate currencies).

As DrByte has run at least one test condition of a purchase in a currency that was not the primary currency of the store and the display of information about the order is consistent throughout the order's edit screen, I am not sure that the problem described can even be made visible with this payment gateway perhaps unless somehow multiple accounts are able to be active selected by the location of the purchaser and the data reported back to the store in a "mixed" state which is then captured/displayed as identified. Remember the "currency" was chosen by the location of the individual not necessarily by changing the selected currency. The test purchase above shows FL tax being applied in a CAD purchase which itself seems a little odd, but possible based on setup and testing within the store. Regardless I don't know the complete configuration of either of those two stores to necessarily cause the explained result. I do know that I have seen the condition described and was able to track down the difference in code that permitted the difference in display. I believe though that the difference in display (again now that have seen the image provided by DrByte I would suggest changing something about the currency indicator to improve clarity when two or more currencies sharing the same symbol are used in a single store) is important to be provided somewhere on the page (note the example provided by DrByte still shows both the "paid for" currency as well as the converted to currency with what appears to be a conversion rate determined primarily by square although would say that there is a bit of a mix of square and ZC involved which perhaps is not fully captured in square.)

Anyways the thread where a code modification was provided was here: https://www.zen-cart.com/showthread.php?223204-Problem-with-Edit-Orders-Screen
As described I don't necessarily think that the modification is the right thing for everyone and don't really see a problem with the potential different display provided there is some understanding (preferably visual) of what is being shown.

3 Jan 2018, 2:28 PM
#95
earmsby avatar

earmsby

Zen Follower

Join Date:
Oct 2006
Location:
Worcester, MA
Posts:
451
Plugin Contributions:
0

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

I've had this payment module running nicely now for a month or two. Definitely prefer it over PayPal that I was using previously. However, I'm wondering if there is a way to modify the module to send the customer/cardholder name to Square. All the payments come through as "Unknown Name" in the square dashboard. It would be very handy to have the customer's name or the cardholder name for bookkeeping purposes in Square. I'm curious as to whether the module is already supposed to do this and it's just not working in my installation of it or whether this is functionality that could be added. I'm willing to tinker if I knew where to start.

3 Jan 2018, 5:21 PM
#96
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]

I believe that's something you need to take up with the folks at Square.

They would never process a card without the cardholder's name so, they must have it. If it doesn't show up in your Square report, it's probably because their system is not coded to do it.

3 Jan 2018, 6:25 PM
#97
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

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

I believe it's a security/data protection thing. I have a Square and an iZettle account and the latter also omits customers names.

3 Jan 2018, 9:04 PM
#98
drbyte avatar

drbyte

Sensei

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

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

earmsby:

I've had this payment module running nicely now for a month or two. Definitely prefer it over PayPal that I was using previously. However, I'm wondering if there is a way to modify the module to send the customer/cardholder name to Square. All the payments come through as "Unknown Name" in the square dashboard. It would be very handy to have the customer's name or the cardholder name for bookkeeping purposes in Square. I'm curious as to whether the module is already supposed to do this and it's just not working in my installation of it or whether this is functionality that could be added. I'm willing to tinker if I knew where to start.
Not sure if it'll make a difference, but you could add the first_name parameter to accompany the last_name parameter here: https://github.com/zencart/zencart/blob/v155/includes/modules/payment/square.php#L288

9 Jan 2018, 9:45 PM
#99
mvstudio avatar

mvstudio

Zen Follower

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

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

Hello everyone.

We received an order today. The client paid by CC through Square which generated this weird email.

Jan-09-2018 12:41:20
=================================

Error Dump: stdClass Object
(
    [errors] => Array
        (
            [0] => stdClass Object
                (
                    [category] => PAYMENT_METHOD_ERROR
                    [code] => CARD_DECLINED
                    [detail] => Card declined.
                )

        )

)


Transaction ID assigned: 
Sent to Square: Array
(
    [idempotency_key] => XXXXXXXXXX
    [card_nonce] => XXXXXXXXXXXXXXXX
    [amount_money] => Array
        (
            [amount] => 91800
            [currency] => USD
        )

    [delay_capture] => 1
    [reference_id] => XXXXXXXXXXXXXXXXXX
    [note] => By Valenti Organics
    [customer_id] => 12
    [buyer_email_address] => XXXXXXXXXXXXXXXX
    [billing_address] => Array
        (
            [address_line] => XXXXXXXXXXXXXXXX
            [address_line_2] => 
            [locality] => ##########
            [administrative_district_level_1] =>  ##########
            [postal_code] => 00000
            [country] => AE
            [last_name] => salim
            [organization] => 
        )

    [shipping_address] => Array
        (
            [address_line] => XXXXXXXXXXXXXXXXX
            [address_line_2] => 
            [locality] => ##########
            [administrative_district_level_1] =>  ##########
            [postal_code] => 00000
            [country] => AE
            [last_name] => salim
            [organization] => 
        )

)


Results Received back from Square: Array (
    [402] => [HTTP/1.1 402 Payment Required] {"errors":[{"category":"PAYMENT_METHOD_ERROR","code":"CARD_DECLINED","detail":"Card declined."}]}
)

The amount in US $862.05 yet the amount in the email is wrong.
The order seems to have gone through just fine by the way.

Any ideas why this email was generated??

9 Jan 2018, 10:53 PM
#100
drbyte avatar

drbyte

Sensei

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

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

That error occurred when the customer attempted a payment which was declined, exactly as the message says.

You said that an order came through later, so most likely the customer chose a different credit card to complete their purchase.