prophoto Posted November 6, 2020 Share Posted November 6, 2020 I recently switched my website to cubecart from another software. I finished the design and set-up my new Square app. (I used Square on the old website too.) Everything worked in sandbox mode, but I decided to try an actual transaction. I completed a sale using a credit card for $1.49 total sale. Everything worked fine but the total amount of sale that showed up at Square was $1.00... NOT $1.49. EVERYTHING on the website end (including "customer e-mails" shows $1.49 total. EVERYTHING on the Square end shows $1.00 total sale. I did check with Square and they said the total sale WAS only $1.00. I am BAFFLED!!! Any ideas? thoughts? suggestions? Thanks in advance. -Bob Link to comment Share on other sites More sharing options...
bsmither Posted November 7, 2020 Share Posted November 7, 2020 Please confirm the exact version of the Square module being used. Square requires that the basket total be sent as an integer, and so the module first multiplies the basket total by 100 and declares it an integer. This cuts off any decimal portion of a floating point number (if that should happen). The module also sends the store's default currency name - so if the order was being shown using a currency not the default, there may have been a conversion fault. Link to comment Share on other sites More sharing options...
prophoto Posted November 7, 2020 Author Share Posted November 7, 2020 4 hours ago, bsmither said: Please confirm the exact version of the Square module being used. Square requires that the basket total be sent as an integer, and so the module first multiplies the basket total by 100 and declares it an integer. This cuts off any decimal portion of a floating point number (if that should happen). The module also sends the store's default currency name - so if the order was being shown using a currency not the default, there may have been a conversion fault. I am using Square version 1.1.5. I do have the default currency as USD, which is correct. Link to comment Share on other sites More sharing options...
prophoto Posted November 7, 2020 Author Share Posted November 7, 2020 I am using Square version 1.1.5. I do have the default currency as USD, which is correct. What do you suggest? Link to comment Share on other sites More sharing options...
bsmither Posted November 7, 2020 Share Posted November 7, 2020 I believe I see a setting in the Square administrative settings panel for a Debug mode. Please enable this. (I do not know where the debug output will be, but we will look for it later.) For another experiment, try to purchase an item for $2.49. If the value that comes back is still 1.00, then maybe there is a logic error (1 ~ true), or if 2.00, then the number getting truncated somehow. The module has some complexity to it, but nothing is catching my attention that would cause a problem with PHP 7 versus PHP 5. Link to comment Share on other sites More sharing options...
prophoto Posted November 8, 2020 Author Share Posted November 8, 2020 I am sorry.... I cannot find a debug mode in Square. Can you narrow it down for me, please? Also, I ran a test, as you recommended, and it came back as $2 rather than the $2.49 total sale. I SINCERELY appreciate your help! -Bob Link to comment Share on other sites More sharing options...
prophoto Posted November 8, 2020 Author Share Posted November 8, 2020 I have a second cubecart website using the Square app. I just took a closer look at that site and realized I am have the same problem. The customer e-mails and the sale on the website show the total sale amount, but the customer credit card is only being charged an even dollar amount. Good grief... this is frustrating! I prefer Square over Paypal, but I may need to switch back if a solution does not present itself. Link to comment Share on other sites More sharing options...
bsmither Posted November 8, 2020 Share Posted November 8, 2020 I would like for you to try this: In the Square module's file gateway.php, near line 87: Find: "amount" => (int)$this->_basket['total']*100, Change to: "amount" => (int)($this->_basket['total']*100), Link to comment Share on other sites More sharing options...
prophoto Posted November 8, 2020 Author Share Posted November 8, 2020 It looks like it worked! THANK YOU so much for your help! MUCH APPRECIATED! -Bob Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.