Skip to content

Payment description in Stripe defaulting to ID #360

@eese-dev

Description

@eese-dev

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

  1. Complete a payment in v3
  2. Check Stripe to verify payment appears with a description of #123
  3. Complete a payment in v4
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions