Results 1 to 10 of 821

Hybrid View

  1. #1
    Join Date
    Jun 2023
    Location
    UK
    Posts
    21
    Plugin Contributions
    0

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

    Quote Originally Posted by carlwhat View Post
    dax,
    i have looked at this issue. i will have a solution for you soon.

    i have started a discussion about this issue here.

    IMO, this is a design flaw inherent in ZC with which i will be forced to handle.

    thanks for your patience.
    Thank you for this information. It is interesting that ZC leaves totalling of the order (in part) to the payment module... I can, I think, now comprehend the scale of the issue!

    What is strange to me is that the bank actually processes the discounted amount despite the original request for the customer to approve (via the 3D pop-up screen) being the pre-discount amount. Where does the information for that initial bank response originate? - that is not used subsequently.

    Probably over simplifying the issue.

    dax

  2. #2
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,915
    Plugin Contributions
    13

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

    Quote Originally Posted by DaxtheMan View Post
    Thank you for this information. It is interesting that ZC leaves totalling of the order (in part) to the payment module... I can, I think, now comprehend the scale of the issue!

    What is strange to me is that the bank actually processes the discounted amount despite the original request for the customer to approve (via the 3D pop-up screen) being the pre-discount amount. Where does the information for that initial bank response originate? - that is not used subsequently.

    Probably over simplifying the issue.

    dax
    dax,
    i think you have done something wrong. or you have some other modifications going on.

    i have replicated your issue exactly using the low order fee, which is similar to group pricing, except it is adding and not subtracting the order_total amount.

    in the following screencasts (in ogg format) which demonstrates the problem as you have described it, and then enacts my fixes to address it.

    as to whether these changes will get merged into the base ZC, we will see.

    base zen-cart square webPay SCA with wrong amount in SCA.

    fixes zen-cart square webPay SCA with correct amount in SCA.

    best.
    author of square Webpay.
    mxWorks now has Apple Pay and Google Pay. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  3. #3
    Join Date
    Jun 2023
    Location
    UK
    Posts
    21
    Plugin Contributions
    0

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

    Hi carlwhat

    Very many thanks.

    I reviewed the ogg files and noticed that you used the standard zc checkout. I mentioned, in the beginning, that I was using OPC. So I thought, what if...I switch off OPC?

    It works. Proper amount used in the bank pop-up matching the discounted amount etc.

    So, I guess I now need to see what OPC is doing. So your suggestion that a modification is at play was correct. It would appear that One Page Checkout doesn't quite link to the Square Webpay payment module in the same way as the standard 3 page checkout!

    Is this one for the OPC forum?

    dax

  4. #4
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,915
    Plugin Contributions
    13

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

    dax,
    while i would love to blame OPC, it is not one for that forum. and sorry i missed that part!

    i have a new and simpler solution that will not break other things in the way that my previous modification of core code might.

    you said square webPay 2.0.2? assuming that is correct, here are my proposed changes:

    in this file:

    includes/modules/pages/checkout_payment/jscript_square_webPay.php

    make the following few changes:

    Code:
    // starting at line 41 from:
        $values = json_encode([
                                  'orderInfo' => $order->info,
                                  'orderBilling' => $order->billing,
                                  'orderCustomer' => $order->customer,
                                  'appId' => MODULE_PAYMENT_SQ_WEBPAY_APPLICATION_ID,
                                  'locationId' => $square_webPay->getLocationDetails()->getId(),
                                  'handler' => DIR_WS_HTTPS_CATALOG . 'squareWebPay_handler.php',
                                  'textTotal' => TEXT_YOUR_TOTAL ?? 'Total:',
                                  'orderTotal' => zen_round($order->info['total'], 2),
                                  'locale' => $locale,
                                  'google' => $google,
                                  'apple' => $applePay,
                                  'creditCards' => $creditCards,
                              ]);
    
    // to:
    
        $calculatedTotal = $order_total_modules->pre_confirmation_check(true);
        $values = json_encode([
                                  'orderInfo' => $order->info,
                                  'orderBilling' => $order->billing,
                                  'orderCustomer' => $order->customer,
                                  'appId' => MODULE_PAYMENT_SQ_WEBPAY_APPLICATION_ID,
                                  'locationId' => $square_webPay->getLocationDetails()->getId(),
                                  'handler' => DIR_WS_HTTPS_CATALOG . 'squareWebPay_handler.php',
                                  'textTotal' => TEXT_YOUR_TOTAL ?? 'Total:',
                                  'orderTotal' => zen_round($calculatedTotal, 2),
                                  'locale' => $locale,
                                  'google' => $google,
                                  'apple' => $applePay,
                                  'creditCards' => $creditCards,
                              ]);
    
    // on line 157 (now line 158... or thereabouts), from:
    
    async function verifyBuyer(payments, token) {
                const verificationDetails = {
                    amount: squareOrderValues.orderInfo.total.toFixed(2),
    
    //to: 
    async function verifyBuyer(payments, token) {
                const verificationDetails = {
                    amount: squareOrderValues.orderTotal.toFixed(2),
    all of the changes are in red.

    please let us know how that goes!

    best.
    author of square Webpay.
    mxWorks now has Apple Pay and Google Pay. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  5. #5
    Join Date
    Jun 2023
    Location
    UK
    Posts
    21
    Plugin Contributions
    0

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

    Hi carlwhat,

    Brilliant! That cured it. Thank you and kindest regards.

    P.S. Sorry for delay in responding but had a long weekend off...

    dax

  6. #6
    Join Date
    Aug 2007
    Location
    Amarillo, Tx
    Posts
    1,674
    Plugin Contributions
    0

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

    Is this compatible to ZC version 2.0.0 yet?

  7. #7
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,701
    Plugin Contributions
    11

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

    A little help with colors.
    myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
    Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.

 

 

Similar Threads

  1. WordPress® for Zen Cart® (wp4zen) [Support Thread]
    By DivaVocals in forum All Other Contributions/Addons
    Replies: 109
    Last Post: 1 Dec 2024, 01:36 PM
  2. Bambora/Beanstream Payment Module Support Thread
    By swguy in forum Addon Payment Modules
    Replies: 127
    Last Post: 26 Mar 2021, 04:13 PM
  3. 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
  4. Layaway Payment Module Support Thread
    By Danielle in forum Addon Payment Modules
    Replies: 0
    Last Post: 21 Nov 2006, 06:43 AM

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