Page 24 of 75 FirstFirst ... 1422232425263474 ... LastLast
Results 231 to 240 of 750
  1. #231
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

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

    To get rid of that 'id' error, a temporary fix is this ...

    In that file, on line 140 you'll see the first line below. Add the second line:
    Code:
            if (!isset($order->billing['country'])) return;
            if (!isset($order->billing['country']['id'])) return;

    I may use a different approach in the future, but for now that should suffice.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  2. #232
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

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

    Quote Originally Posted by Spikenzie View Post
    Yes, all the captured amounts are now correct. Yay, thanks!

    A side effect of this change that I noticed, but is no a big deal, on the admin side (and the note sent to Square) all transactions now say "Converted from: n.nn CAD" or "Converted from: n.nn USD" even when no conversion "math" is required (eg. CAD -> CAD).
    Okay, looking again around line 274, let's test one more change, to get rid of the CAD->CAD message.
    Add the extra condition, as shown, including the { } braces:
    Code:
           // force conversion to Square Account's currency:
            if ($order->info['currency'] != $location->currency || $order->info['currency'] != DEFAULT_CURRENCY) {
                global $currencies;
                $payment_amount = round($order->info['total'] * $currencies->get_value($location->currency), 2);
                $currency_code  = $location->currency;
                if ($order->info['currency'] != $location->currency) {
                    $this->currency_comment = '(Converted from: ' . round($order->info['total'] * $order->info['currency_value'], 2) . ' ' . $order->info['currency'] . ')';
                }
                // @TODO - if Square adds support for transmission of tax and shipping amounts, these may need recalculation here too
            }
    While you're at it, do you mind testing another optimization I'd like to use. Does this still give the same converted price correctly for the actual payment collected?
    Code:
            // force conversion to Square Account's currency:
            if ($order->info['currency'] != $location->currency || $order->info['currency'] != DEFAULT_CURRENCY) {
                global $currencies;
                $payment_amount = $currencies->rateAdjusted($order->info['total'], true, $location->currency);
                $currency_code  = $location->currency;
                if ($order->info['currency'] != $location->currency) {
                    $this->currency_comment = '(Converted from: ' . round($order->info['total'] * $order->info['currency_value'], 2) . ' ' . $order->info['currency'] . ')';
                }
                // @TODO - if Square adds support for transmission of tax and shipping amounts, these may need recalculation here too
            }
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #233
    Join Date
    Nov 2018
    Location
    Montreal
    Posts
    6
    Plugin Contributions
    0

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

    Hey DrByte, all of your suggestions worked!

    To get rid of that 'id' error, a temporary fix is this ...
    No more id log warnings,

    Okay, looking again around line 274, let's test one more change, to get rid of the CAD->CAD message.
    "Converted from:" text appears at correct time
    and

    ...do you mind testing another optimization...
    the optimization you wanted me to test still calculates the correct converted amounts (or not converted amounts when that is the case) Note: my tests were under $5.00
    Thanks!
    Last edited by Spikenzie; 21 Nov 2018 at 03:13 AM.

  4. #234
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

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

    Great! I've posted a new v0.95 version of the module, including these fixes.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #235
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,151
    Plugin Contributions
    11

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

    All of a sudden, Square is bouncing with INVALID_ENUM_VALUE with the detail - "is not a valid enum value for 'billing_address.country' "

    Is this something 0.95 might fix or do we need to come up with a country field to satisfy a new requirement.

    [27-Nov-2018 17:04:48 UTC] Request URI: /index.php?main_page=checkout_process, IP address: 72.190.125.38
    #1 trigger_error() called at [/home/spicdavi/public_html/includes/modules/payment/square.php:338]
    #2 square->before_process() called at [/home/spicdavi/public_html/includes/classes/payment.php:245]
    #3 payment->before_process() called at [/home/spicdavi/public_html/includes/modules/checkout_process.php:84]
    #4 require(/home/spicdavi/public_html/includes/modules/checkout_process.php) called at [/home/spicdavi/public_html/includes/modules/pages/checkout_process/header_php.php:14]
    #5 require(/home/spicdavi/public_html/includes/modules/pages/checkout_process/header_php.php) called at [/home/spicdavi/public_html/index.php:36]

    [27-Nov-2018 17:04:48 UTC] PHP Notice: Square Connect [configuration] error.
    Response Body:
    stdClass Object
    (
    [errors] => Array
    (
    [0] => stdClass Object
    (
    [category] => INVALID_REQUEST_ERROR
    Code:
     => INVALID_ENUM_VALUE
    [code]
    [detail] => `` is not a valid enum value for `billing_address.country`.
    [field] => billing_address.country
    )

    )

    )

    Response Headers:
    Array
    (
    [0] => HTTP/1.1 400 Bad Request
    [Content-Type] => application/json
    [Vary] => Origin, Accept-Encoding
    [X-Content-Type-Options] => nosniff
    [X-Download-Options] => noopen
    [X-Frame-Options] => SAMEORIGIN
    [X-Permitted-Cross-Domain-Policies] => none
    [X-Xss-Protection] => 1; mode=block
    [Date] => Tue, 27 Nov 2018 17:04:47 GMT
    [keep-alive] => timeout=60
    [Strict-Transport-Security] => max-age=631152000
    [content-length] => 182
    )
    in /home/spicdavi/public_html/includes/modules/payment/square.php on line 338

  6. #236
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,151
    Plugin Contributions
    11

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

    More info to the above. Both transaction attempts were American Express with Free Shipping. Both were finally successful in ordering, but neither has responded to requests for what difficulties they had when ordering.

  7. #237
    Join Date
    Nov 2018
    Location
    Montreal
    Posts
    6
    Plugin Contributions
    0

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

    I have found a potential store user problem with this plug-in. It is not so much a bug but rather an issue that could cause financial problems for shop owners and unsatisfied customers.

    This is the scenario, you let customers shop in multiple currencies but Square only takes payments in the currency in the country that the shop is based. We are in Canada but our store is set to a default currency of USD. If a Canadian customer checks out and their cart is set to USD their CC will be billed in CAD at about 30% more then their cart total. There is no warning from Square (or rather this plug-in) that they are going to do a currency conversion. See the potential problem?

    I've been trying for a long time to create something I'm calling a clarity message that would appear at check-out, something like;

    Square checkout only processes payments in (your square's currency), your order total is (your order total in some other currency), your CC will be billed (your order currency converted to your square's currency).

    I had it working and nice looking from the user side; it would show the clear we will be charging your CC something else (if that was the case) or a generic "Secure check out with Square Payments" type message if no conversion was required.

    I did this by using simon1066's post #126 to add an image, where he wrote:

    Here's one way to add an image:
    ,and the logic from DrByte's post # 232 where he wrote

    if ($order->info['currency'] != $location->currency) {
    Problems where two fold, where I needed to insert the "if" logic into the code to get the payment title it caused errors on the admin side in modules payments menu and in places other than checkout the message would appear sort of like "your payment will be (nothing printed here) $."

    I now have a static work around without amounts that look like this;

    Click image for larger version. 

Name:	static not so clear message.png 
Views:	41 
Size:	21.5 KB 
ID:	18145

    but, it does not appear correctly on the admin / customer orders pages or the order confirmation emailed to users. And, I don't think the message without amounts it is clear enough for some people.

    Any ideas?

  8. #238
    Join Date
    Apr 2006
    Location
    Ohio
    Posts
    6,162
    Plugin Contributions
    0

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

    Fresh install 155f
    PHP: 7.1.24
    Square Payment Module 0.95
    One Page Checkout (OPC) 2.0.5

    Dr. Bytes,
    OPC turned on
    Category set up as Document - General called Printable Brochure
    Product enabled under it called Document - Product which I have the pdf & zip of the brochure to download
    When clicking confirm to order when logged in to download pdf/zip the cursor just spins and does not complete the order
    Also using guest check out the cursor just spin and does not complete the order

    OPC turned off
    I can successfully purchase the downloadable brochure pdf/zip sucessfully.

    This is the error console below.

    Click image for larger version. 

Name:	screenshot.jpg 
Views:	34 
Size:	30.4 KB 
ID:	18146
    Mark
    Hare Do

  9. #239
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,492
    Plugin Contributions
    88

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

    Note that the jQuery issue that @haredo describes occurs when the cart contains only unpriced items, e.g. the demo product A Free Product - All (index.php?main_page=product_info&cPath=24&products_id=57), i.e. the payment method for the order is set to FreeOrder/freecharger.

    This is similar in nature to the issue that was previously corrected when PayPal Express Checkout/Shortcut-Button was selected.

  10. #240
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,492
    Plugin Contributions
    88

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

    FWIW, I was able to correct the integration issue by editing the /includes/modules/pages/checkout_payment/jscript_square.php (it's also copied to the /checkout_one/jscript_square.php for the OPC integration) and changing:
    Code:
    if ($payment_modules->in_special_checkout()) {
        return false;
    }
    to
    Code:
    if ($payment_modules->in_special_checkout() || (isset($payment_modules->paymentClass) && $payment_modules->paymentClass->code != 'square')) {
        return false;
    }
    The result is that Square's jQuery module doesn't load if the payment class is selected and it's not Square.

 

 
Page 24 of 75 FirstFirst ... 1422232425263474 ... LastLast

Similar Threads

  1. Bambora/Beanstream Payment Module Support Thread
    By swguy in forum Addon Payment Modules
    Replies: 127
    Last Post: 26 Mar 2021, 04:13 PM
  2. v154 Support Thread: AddToAny for Zen Cart (The Universal Sharing Platform)
    By DivaVocals in forum All Other Contributions/Addons
    Replies: 8
    Last Post: 8 Apr 2019, 02:39 PM
  3. WordPress® for Zen Cart® (wp4zen) [Support Thread]
    By DivaVocals in forum All Other Contributions/Addons
    Replies: 107
    Last Post: 13 Jan 2019, 12:32 PM
  4. Layaway Payment Module Support Thread
    By Danielle in forum Addon Payment Modules
    Replies: 0
    Last Post: 21 Nov 2006, 06:43 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR