Wrong price being sent

Created on 17 May 2024, 9 months ago

In stripe-payment.html.twig the data-amount attribute hard-coded to '1234' and not taken from the field value? This way the price will be always 12,34. I have not found it documented anywhere.

Is this because this is a reference module? If so, feel free to close this issue - I just think this would be close to being finished.

πŸ’¬ Support request
Status

Active

Version

1.1

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany gbyte Berlin

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @gbyte
  • πŸ‡©πŸ‡ͺGermany gbyte Berlin
  • πŸ‡¬πŸ‡§United Kingdom aaron.ferris

    aaron.ferris β†’ made their first commit to this issue’s fork.

  • πŸ‡¬πŸ‡§United Kingdom aaron.ferris

    Raised an MR, but for complete transparency its a bit of a flyer as I don't use Stripe.

  • Status changed to Needs review 9 months ago
  • πŸ‡¬πŸ‡§United Kingdom aaron.ferris
  • Status changed to Active 9 months ago
  • πŸ‡©πŸ‡ͺGermany gbyte Berlin

    @aaron.ferris

    This is a support ticket still - I'd like to hear from the maintainer. Your MR won't work properly as Stripe expects the last two digits to be the cents value, so 1234 will be 12,34 instead of 1234. The stripe field does not accept floating point numbers so there are more things to do here anyway. Just checking with the maintainer what the overall goal is and I'm happy to share my work afterwards.

  • Status changed to Fixed 26 days ago
  • πŸ‡³πŸ‡΅Nepal sujan shrestha KathmanduπŸ‡³πŸ‡΅, Nepal

    Hi @gbyte @aaron.ferris , Apologies for the late response, and thank you for your feedback! I’ve updated the stripe-payment.html.twig file so that the price is pulled from the field value instead of being hard-coded. I also made a change in the StripeController.php file, where I added $productPrice = $productPrice * 100; to convert the price into the smallest unit of the currency (like cents). Could you please review the changes and let me know if everything looks good?

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024