Skip to content

Commit

Permalink
Billing History: Add display_brand to individual billing receipts (#9…
Browse files Browse the repository at this point in the history
…4255)

* Add cc_display_brand to individual billing receipt

* update schema with new property
  • Loading branch information
jjchrisdiehl authored Sep 6, 2024
1 parent 64274a1 commit ecd26fa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/me/purchases/billing-history/receipt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ function ReceiptPaymentMethod( { transaction }: { transaction: BillingTransactio
} else if ( 'XXXX' !== transaction.cc_num ) {
text = translate( '%(cardType)s ending in %(cardNum)s', {
args: {
cardType: transaction.cc_type.toUpperCase(),
cardType:
transaction.cc_display_brand?.replace( '_', ' ' ).toUpperCase() ??
transaction.cc_type.toUpperCase(),
cardNum: transaction.cc_num,
},
} );
Expand Down
1 change: 1 addition & 0 deletions client/state/billing-transactions/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const billingTransactionsSchema = {
pay_ref: { type: 'string' },
pay_part: { type: 'string' },
cc_type: { type: 'string' },
cc_display_type: { type: [ 'string', 'null' ] },
cc_num: { type: 'string' },
cc_name: { type: 'string' },
cc_email: { type: 'string' },
Expand Down
1 change: 1 addition & 0 deletions client/state/billing-transactions/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export interface BillingTransaction {
cc_name: string;
cc_num: string;
cc_type: string;
cc_display_brand: string | null;
credit: string;
date: string;
desc: string;
Expand Down

0 comments on commit ecd26fa

Please sign in to comment.