Display payment method details in order transactions#6339
Conversation
🦋 Changeset detectedLatest commit: f6dafad The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6339 +/- ##
========================================
Coverage 42.73% 42.74%
========================================
Files 2509 2513 +4
Lines 43559 43627 +68
Branches 9910 10307 +397
========================================
+ Hits 18615 18647 +32
- Misses 24906 24942 +36
Partials 38 38 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This pull request adds GraphQL types and UI components to display payment method details in order transactions. The changes enable the dashboard to show card brand information (Visa, Mastercard) and other payment method types (PayPal, Klarna, Blik, etc.) when viewing transaction details.
Changes:
- Added GraphQL fragments for
CardPaymentMethodDetailsandOtherPaymentMethodDetails - Created new React components to display card and other payment method information with brand logos
- Updated all transaction fixtures and test data to include the new
createdByandpaymentMethodDetailsfields - Enhanced the EventAvatar component to display app logos when available
- Added Storybook stories demonstrating various payment method display scenarios
Reviewed changes
Copilot reviewed 15 out of 22 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/fragments/orders.ts | Added new GraphQL fragments for payment method details (Card and Other types) |
| src/graphql/hooks.generated.ts | Generated TypeScript types and hooks for the new fragments |
| src/orders/fixtures/TransactionFixture.ts | Updated transaction fixture to include createdBy and paymentMethodDetails fields |
| src/orders/fixtures.ts | Added comprehensive payment method details to all transaction fixtures |
| src/orders/components/OrderTransactionPayment/OrderTransactionPayment.tsx | Added null values for new fields in fake transaction |
| src/orders/components/OrderTransactionGiftCard/OrderTransactionGiftCard.tsx | Added null values for new fields in fake transaction |
| src/orders/components/OrderTransaction/components/TransactionEvents/components/PaymentMethodDetails.tsx | New component to render payment method details based on type |
| src/orders/components/OrderTransaction/components/TransactionEvents/components/EventAvatar.tsx | Enhanced to display app brand logos |
| src/orders/components/OrderTransaction/components/OtherPaymentMethod.tsx | New component to display non-card payment methods with logos |
| src/orders/components/OrderTransaction/components/CardTitle/CardTitle.tsx | Updated to display payment method details in transaction card title |
| src/orders/components/OrderTransaction/components/CardPaymentMethod.tsx | New component to display card payment details with brand logos |
| src/orders/components/OrderTransaction/OrderTransaction.stories.tsx | Added comprehensive Storybook stories for payment method display |
| src/orders/components/OrderSummary/OrderSummary.test.tsx | Updated test transaction to include new required fields |
| src/orders/components/OrderReturnPage/components/TransactionSubmitCard/fixtures.ts | Updated fixture to include new fields |
| assets/images/payment-methods/*.svg | Added brand logo SVG files for various payment methods |
| .changeset/itchy-queens-build.md | Added changeset documenting the new feature |
src/orders/components/OrderTransaction/components/CardPaymentMethod.tsx
Outdated
Show resolved
Hide resolved
src/orders/components/OrderTransaction/components/PaymentMethodDetails.tsx
Show resolved
Hide resolved
src/orders/components/OrderTransaction/components/OtherPaymentMethod.tsx
Show resolved
Hide resolved
src/orders/components/OrderTransaction/components/OtherPaymentMethod.tsx
Show resolved
Hide resolved
src/orders/components/OrderTransaction/components/OtherPaymentMethod.tsx
Outdated
Show resolved
Hide resolved
src/orders/components/OrderTransaction/components/PaymentMethodDetails.tsx
Show resolved
Hide resolved
src/orders/components/OrderTransaction/components/OtherPaymentMethod.tsx
Outdated
Show resolved
Hide resolved
Differences Found✅ No packages or licenses were added. SummaryExpand
|
| "saleor-dashboard": patch | ||
| --- | ||
|
|
||
| Order Transaction will now display payment method details, like card brand or type. |
There was a problem hiding this comment.
The changeset text is a bit ambiguous/grammatically awkward: it uses singular ('Order Transaction') and 'card brand or type' is unclear. Consider updating the sentence to use 'Order Transactions' (plural) and be more specific about what’s displayed (e.g., brand/logo, masked number, expiration for cards; provider name for other methods).
| Order Transaction will now display payment method details, like card brand or type. | |
| Order Transactions will now display payment method details, such as card brand/logo, masked card number and expiration date for cards, or provider name for other payment methods. |
Summary
Details
Extends order transaction UI to show payment method information returned by payment apps:
CardPaymentMethodDetailsandOtherPaymentMethodDetailssaleor/saleor-docs#1749