Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Allow payments to be converted to another currency. This can be useful when a payment amount is in a particular currency, but the customer wants to use a payment method that does not support that currency. See how this overlaps with #1844850: Add support for Dynamic Currency Conversion (DCC), and how we make this feature transparent for the merchant, who expects the original currency, and the customer, who wants to see the currency he paid in, and perhaps the original as well.
Postponed to 8.x-2.x.
Comment | File | Size | Author |
---|---|---|---|
#26 | payment_1905902_26.patch | 65.04 KB | Xano |
#26 | interdiff.txt | 1.79 KB | Xano |
Comments
Comment #1
XanoComment #2
XanoComment #3
XanoThis may tie into #2037081: Distinguish between amounts charged and paid.
Comment #4
XanoThe original philosophy behind Payment is that payment entities reflect real-world payments/transactions and they are not invoices. There amounts that are charged, are set on the line items. The amount that is paid, is the payment amount itself. The latter can change, depending on the real-world payment the entity reflects. This is also why we cannot fix #2334237: Consider removing line item's currencies, because line items contain the amounts that are charged, and they may be dynamically based on referenced data, such as orders.
Instead, allow payment methods to change a payment's amount and currency, and add line items after payment execution to balance out any differences between the charged amounts and the paid amount. This way the line items still contain the original charged amounts, but the payment amount and currency reflect reality.
Comment #5
XanoComment #7
XanoAdd a
PaymentLineItemCollectionInterface
that gets the methods for the charged amount, as that's what line items represents. Keep the methods for the paid amount onPaymentInterface
.Comment #8
XanoPayment types, however, must be able to work with the paid amounts. If they charge in EUR, but are paid in USD, they may not be able to figure out if the charged amount was paid completely. How will we deal with that?
Comment #9
XanoSo there are three types of amounts we have to deal with:
In essence only 1 and 3 are necessary for the system to function. 2 is really more of a reference for the payer to match a payment entity to a transaction on their back account. We can start by implementing 1 and 3, and add 2 later if there is a need for it.
Comment #10
XanoComment #12
XanoComment #14
XanoComment #16
XanoComment #20
XanoComment #22
XanoComment #24
XanoRe-roll.
Comment #26
Xano