Post by jpedroza2k » Thu Oct 19, 2017 6:16 am

I am getting an error that
`amount_money.amount` must be greater than 100. Field: amount_money.amount
when trying to process a payment. I have items in my cart, but I am not seeing a total amount to pay on the checkout page. Can someone tell me where the extension lives so I can see where it is getting its amount from, or point me in the direction of a fix, please?
Last edited by jpedroza2k on Thu Oct 19, 2017 3:20 pm, edited 1 time in total.

New member

Posts

Joined
Wed Jul 12, 2017 1:45 am

Post by straightlight » Thu Oct 19, 2017 7:08 am

Squareup payment module includes a debug functionality. In your admin - > extensions - > extensions - > payments - > your enabled squareup payment module - > edit, ensure to activate the debug option. Then, put your site under maintenance from your admin - > system - > settings - > edit - > server tab. Test another order on your store to see if you are able to replicate the issue. When so, see either in your admin error logs or your squareup error logs tab for new debug entries.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by jpedroza2k » Thu Oct 19, 2017 7:29 am

Here is the entry in the log:

Code: Select all

2017-10-18 23:17:26 - SQUAREUP DEBUG START...
2017-10-18 23:17:26 - SQUAREUP ENDPOINT: https://connect.squareup.com/v2/locations/CBASEHT1FRZvI9DyBdYNX6kNVpggAQ/transactions
2017-10-18 23:17:26 - SQUAREUP HEADERS: Array
(
    [0] => Authorization: Bearer sandbox-sq0atb-YGyUaR_QrKFW_sn42mR80Q
    [1] => Content-Type: application/json
)

2017-10-18 23:17:26 - SQUAREUP PARAMS: {"idempotency_key":"59e7e1060ed14","amount_money":{"amount":0,"currency":"USD"},"billing_address":{"first_name":"Xxxxx","last_name":"Xxxxxxx","address_line_1":"XXXX Xxxxxxxx Xx","address_line_2":"","locality":"Xxxxxxx","sublocality":"Xxxxxxx","postal_code":"XXXXX","country":"US","organization":""},"buyer_email_address":"Xxxxxxx@XXXXXXX.com","delay_capture":false,"integration_id":"sqi_65a5ac54459940e3600a8561829fd970","shipping_address":{"first_name":"Xxxxxx","last_name":"Xxxxxxxxx","address_line_1":"XXXX Xxxxxxxx Xx","address_line_2":"","locality":"Xxxxxxx","sublocality":"Xxxxxxx","postal_code":"XXXXX","country":"US","organization":""},"customer_card_id":"[redacted]","customer_id":"[redacted]"}
2017-10-18 23:17:26 - SQUAREUP RESULT: {"errors":[{"category":"INVALID_REQUEST_ERROR","code":"VALUE_TOO_LOW","detail":"`amount_money.amount` must be greater than 100.","field":"amount_money.amount"}]}
2017-10-18 23:17:26 - `amount_money.amount` must be greater than 100. Field: amount_money.amount
As you can see the amount_money.amount is set to 0. I looked through /opencart/admin/controller/extension/payment/squareup.php and it appears that amount_money is only set in the case of rebates.

Code: Select all

            foreach ($refunds as $refund) {
                $amount = $this->currency->format(
                    $this->squareup->standardDenomination(
                        $refund['amount_money']['amount'],
                        $refund['amount_money']['currency']
                    ),
                    $refund['amount_money']['currency']
                );
straightlight wrote:
Thu Oct 19, 2017 7:08 am
Squareup payment module includes a debug functionality. In your admin - > extensions - > extensions - > payments - > your enabled squareup payment module - > edit, ensure to activate the debug option. Then, put your site under maintenance from your admin - > system - > settings - > edit - > server tab. Test another order on your store to see if you are able to replicate the issue. When so, see either in your admin error logs or your squareup error logs tab for new debug entries.

New member

Posts

Joined
Wed Jul 12, 2017 1:45 am

Post by straightlight » Thu Oct 19, 2017 7:43 am

Have you applied the last month's bug fixes on the squareup module? They can be found on Github:

- https://github.com/opencart/opencart/bl ... uareup.php
- https://github.com/opencart/opencart/bl ... order.twig

Before you apply the bug fixes, make sure to take a screenshot at your squareup admin payment modules configurations. Then, uninstall the module. Then apply the bug fixes, reinstall the module, clear all caches (Opencart's both cache, then logout, browser's cache), close the browser, reopen the browser and log back into the admin section. Then, go to the squareup module page, reconfigure the form, re-test an order in sandbox and debug mode, see if the issue persists.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by jpedroza2k » Thu Oct 19, 2017 7:46 am

I have not. Is there a script to apply patches, or should I just replace the files?
straightlight wrote:
Thu Oct 19, 2017 7:43 am
Have you applied the last month's bug fixes on the squareup module? They can be found on Github:

- https://github.com/opencart/opencart/bl ... uareup.php
- https://github.com/opencart/opencart/bl ... order.twig

Before you apply the bug fixes, make sure to take a screenshot at your squareup admin payment modules configurations. Then, uninstall the module. Then apply the bug fixes, reinstall the module, clear all caches (Opencart's both cache, then logout, browser's cache), close the browser, reopen the browser and log back into the admin section. Then, go to the squareup module page, reconfigure the form, re-test an order in sandbox and debug mode, see if the issue persists.

New member

Posts

Joined
Wed Jul 12, 2017 1:45 am

Post by straightlight » Thu Oct 19, 2017 7:52 am

Follow the steps above, as indicated.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by jpedroza2k » Thu Oct 19, 2017 7:59 am

Followed the steps, updated the files, cleared the caches, error persists.
I am thinking this is not an issue with the square module, as the total in the Show Cart button is $0.00 and there is no grand total on the checkout form, it just shows the individual items.

Is there an easy way to apply the version update (3.0.2.0), or is it just upload the upload directory and clear caches?
straightlight wrote:
Thu Oct 19, 2017 7:52 am
Follow the steps above, as indicated.

New member

Posts

Joined
Wed Jul 12, 2017 1:45 am

Post by straightlight » Thu Oct 19, 2017 8:03 am

The steps provided above are the step-by-step guide. However, if your settings are properly saved and you go back to the form seeing those settings as you entered them, then the issue might need to be addressed due to an invalid response with the Squareup API caused by possible missing parameters.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by jpedroza2k » Thu Oct 19, 2017 8:08 am

The parameter is not missing, what appears to be happening is that the grand total is not being calculated correctly, which is causing an incorrect total to be displayed on the cart button on each page (although the number of items is correct), and that is causing the error when submitting the payment.

I will upgrade to 3.0.2.0 and see if that helps.
straightlight wrote:
Thu Oct 19, 2017 8:03 am
The steps provided above are the step-by-step guide. However, if your settings are properly saved and you go back to the form seeing those settings as you entered them, then the issue might need to be addressed due to an invalid response with the Squareup API caused by possible missing parameters.

New member

Posts

Joined
Wed Jul 12, 2017 1:45 am

Post by straightlight » Thu Oct 19, 2017 8:13 am

No problem. The issue has now been addressed.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by jpedroza2k » Thu Oct 19, 2017 3:21 pm

There was an issue with the database, specifically in the oc_setting table, where some of the key->value pairs were missing. I added a UNIQUE index to the `key` column, and then ran the setup for that table from /install/opencart.sql changing the INSERT to an INSERT IGNORE. Once I did that the prices started showing correctly for logged in users. When processing payment, these missing elements caused there to be a $0 balance in the cart, which was causing the failure.

New member

Posts

Joined
Wed Jul 12, 2017 1:45 am

Post by KlingstedtBros » Mon Nov 25, 2019 11:22 pm

jpedroza2k wrote:
Thu Oct 19, 2017 3:21 pm
There was an issue with the database, specifically in the oc_setting table, where some of the key->value pairs were missing. I added a UNIQUE index to the `key` column, and then ran the setup for that table from /install/opencart.sql changing the INSERT to an INSERT IGNORE. Once I did that the prices started showing correctly for logged in users. When processing payment, these missing elements caused there to be a $0 balance in the cart, which was causing the failure.
Details about how to do the above here:
viewtopic.php?f=202&t=198774&p=769963#p769963


Posts

Joined
Fri Nov 30, 2012 12:47 am
Who is online

Users browsing this forum: No registered users and 10 guests