-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
Description
Since upgrading to v4 payments appear in Stripe with a description of pi_*. In v3 they appeared as #123 (Order ID), with a prefix via Craft::t('commerce-stripe', 'Order') that my client makes use of to distinguish sales channels.
Steps to reproduce
- Complete a payment in v3
- Check Stripe to verify payment appears with a description of
#123 - Complete a payment in v4
- Check Stripe to verify payment appears with a description of
pi_*
Possible solution
I compared v3 to v4 and found v3 uses base\Gateway::buildRequestData to add 'description' => Craft::t('commerce-stripe', 'Order') . ' #' . $transaction->orderId, directly to the PaymentIntent request, but has been deprecated in v4. In v4 gateways\PaymentIntents::authorizeOrPurchase adds the same description as metadata to the request.
I tested adding the metadata description to the request directly in gateways\PaymentIntents::createPaymentIntent and verified that Stripe payments appear as #123 again.
if (!empty($metadata['description'])) {
$paymentIntentData['description'] = $metadata['description'];
}
Additional info
- Craft CMS version: Craft Pro 4.16.14
- Stripe for Craft Commerce version: 4.1.8
- PHP version: 8.3.27
- Database driver & version: MariaDB 10.5.29