- Issue created by @sumit22kalra
For anyone trying to make it work for INR/Stripe India
1. Go to commerce_stripe/src/Plugin/Commerce/PaymentGateway
2. Edit Stripe.php
3. Add Description like below$default_intent_attributes = [
'amount' => $this->minorUnitsConverter->toMinorUnits($amount),
'currency' => strtolower($amount->getCurrencyCode()),
'payment_method_types' => ['card'],
'metadata' => [
'order_id' => $order->id(),
'store_id' => $order->getStoreId(),
],
'description' => 'Your Transaction Description',- 🇺🇸United States rszrama
I don't really see how the module would know when or how to set this value, but it wouldn't be a bad idea to make the description field available in the payment gateway settings. I propose the following:
- Add an optional "Default payment description" /
default_payment_description
setting to both payment gateway configuration forms. Give it the help text, "Sent to Stripe when creating a payment intent. Required for some transaction types such as international payments." - If the gateway has a value for this setting, include it in the
$default_intent_attributes
.
Note: this description field can already be set from a custom event subscriber via the
StripeEvents::PAYMENT_INTENT_CREATE
, so we don't need any sort of alter hook here ... the module already supports adding custom properties to the payment intent. - Add an optional "Default payment description" /
- Status changed to Closed: works as designed
5 months ago 7:06pm 8 July 2024 - 🇺🇸United States TomTech
Since the description will vary per order/transaction, e.g. "Software Services", "Initial Setup", etc... this appears to be beyond the scope of what this module can provide.
A likely implementation would probably have a "transaction description" field on product variations (or products), and then an EventSubscriber could update the PaymentIntent based on the order items.