Skip to content

Commit

Permalink
fix: Read Stripe payment_method attribute if options attribute is not…
Browse files Browse the repository at this point in the history
… available
  • Loading branch information
acasazza committed Dec 7, 2021
1 parent f691325 commit 3633657
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/PaymentSource.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ const PaymentSource: FunctionComponent<PaymentSourceProps> = (props) => {
const card =
// @ts-ignorePayment
paymentSource?.options?.card ||
// @ts-ignorePayment
paymentSource?.payment_method?.card ||
// @ts-ignore
paymentSource?.metadata?.card ||
// NOTE: Adyen payment
Expand Down
5 changes: 5 additions & 0 deletions src/components/utils/PaymentCardsTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ export default function PaymentCardsTemplate({
// @ts-ignore
customerPayment?.payment_source?.payment_request_data?.paymentMethod ||
// @ts-ignore
(customerPayment?.payment_source?.payment_method?.card as Record<
string,
any
>) ||
// @ts-ignore
(customerPayment?.payment_source?.metadata?.card as Record<string, any>)
const handleClick = async (e: MouseEvent) => {
e.stopPropagation()
Expand Down

0 comments on commit 3633657

Please sign in to comment.