How to convert an order price to a different currency in Commerce 2? The Stripe payment gateway only accepts JCB and Diners Club transactions in US dollars (no international currencies).

Most of the transactions on my site are in Japanese yen.

In fact, I would prefer to have everything in yen, but I want to try to handle JCB (major credit card in Japan) by somehow converting the JPY prices to USD and then billing in USD (of course, I will notify the user I am doing this).

Ideally, the flow looks like this:


User browses my store where prices are shown in JPY.
User adds a product to the cart.
User goes to checkout and chooses a payment method (if user chooses "Pay with Mastercard/Visa" (standard Stripe payment gateway), transaction proceeds as normal.
If the user chooses "JCB", price is converted to USD and then billed in USD.


How might I begin to implement this kind of conversion?  Or, is there a better approach/flow for converting the order price from one currency to another?
This is what I've done for now.


Add the currencies you will use in the UI. /admin/commerce/config/currencies
Add a "currency" product attribute in the UI. /admin/commerce/product-attributes
On the product edit page for the product you want, add variations with the currencies and set the prices.


This lets the user choose the currency he/she likes. So you can just put a message "If you're using JCB, you must pay with JCB."  It's not perfect but it's a decent solution.