You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue reports an incorrect displayed amount in the Apple Pay popup when using the Spree::Gateway::StripeApplePayGateway payment method provided by the Spree Gateway gem.
Problem:
When using Apple Pay with the mentioned payment method, the displayed amount in the Apple Pay popup is incorrect. Instead of showing the actual amount, it shows the amount multiplied by 100 (e.g., for ¥8000, it shows ¥800,000).
Investigation:
Identified potential cause: The issue might be related to the amount_in_cents method in the Spree Gateway gem, which converts monetary amounts to cents. The additional multiplication by 100 could lead to this discrepancy.
Expected Behaviour:
The Apple Pay popup should display the correct monetary amount without any unintended multiplications.
Reproduction Steps:
Configure the Spree::Gateway::StripeApplePayGateway payment method in Spree Commerce.
Add items to the cart and proceed to checkout.
Select the Spree::Gateway::StripeApplePayGateway payment method.
Use Apple Pay to attempt payment.
Observe the incorrect amount displayed in the Apple Pay popup.
Additional Information:
Please find the relevant code snippet in the following file strpe_apple_pay.html.erb
This file contains the logic for calculating and displaying amounts in the Apple Pay popup.
It's important to note that the incorrect amount is only shown in the Apple Pay popup. The actual charged amount by Stripe is correct, as demonstrated by the localized_amount method in the activemerchant-1.133.0 (for reference, see its code snippet below).
def localized_amount(money, currency)
amount = amount(money)
return amount unless non_fractional_currency?(currency) || three_decimal_currency?(currency)
if non_fractional_currency?(currency)
if self.money_format == :cents
sprintf('%.0f', amount.to_f / 100)
else
amount.split('.').first
end
elsif three_decimal_currency?(currency)
if self.money_format == :cents
amount.to_s
else
sprintf('%.3f', (amount.to_f / 10))
end
end
end
The text was updated successfully, but these errors were encountered:
defactual_amount(amount,currency)money=Spree::Money.new(amount,currency: currency)ifnon_decimal_currencies.include?('JPY')money.amount_in_cents / 100elsemoney.amount_in_centsendenddefnon_decimal_currencies%w(JPY)# add all non decimal currencies here.end
This issue reports an incorrect displayed amount in the Apple Pay popup when using the Spree::Gateway::StripeApplePayGateway payment method provided by the Spree Gateway gem.
Problem:
When using Apple Pay with the mentioned payment method, the displayed amount in the Apple Pay popup is incorrect. Instead of showing the actual amount, it shows the amount multiplied by 100 (e.g., for ¥8000, it shows ¥800,000).
Investigation:
Identified potential cause: The issue might be related to the amount_in_cents method in the Spree Gateway gem, which converts monetary amounts to cents. The additional multiplication by 100 could lead to this discrepancy.
Expected Behaviour:
The Apple Pay popup should display the correct monetary amount without any unintended multiplications.
Reproduction Steps:
Configure the Spree::Gateway::StripeApplePayGateway payment method in Spree Commerce.
Add items to the cart and proceed to checkout.
Select the Spree::Gateway::StripeApplePayGateway payment method.
Use Apple Pay to attempt payment.
Observe the incorrect amount displayed in the Apple Pay popup.
Additional Information:
Please find the relevant code snippet in the following file
strpe_apple_pay.html.erb
This file contains the logic for calculating and displaying amounts in the Apple Pay popup.
The text was updated successfully, but these errors were encountered: