diff --git a/client/lib/checkout/payment-methods.tsx b/client/lib/checkout/payment-methods.tsx index 8b6a4a40611203..b50d265a718d1a 100644 --- a/client/lib/checkout/payment-methods.tsx +++ b/client/lib/checkout/payment-methods.tsx @@ -12,8 +12,13 @@ import payPalImage from 'calypso/assets/images/upgrades/paypal.svg'; import razorpayImage from 'calypso/assets/images/upgrades/upi.svg'; export const PARTNER_PAYPAL_EXPRESS = 'paypal_express'; +export const PARTNER_PAYPAL_PPCP = 'paypal_ppcp'; export const PARTNER_RAZORPAY = 'razorpay'; -export const PAYMENT_AGREEMENTS_PARTNERS = [ PARTNER_PAYPAL_EXPRESS, PARTNER_RAZORPAY ]; +export const PAYMENT_AGREEMENTS_PARTNERS = [ + PARTNER_PAYPAL_EXPRESS, + PARTNER_PAYPAL_PPCP, + PARTNER_RAZORPAY, +]; export const UPI_PARTNERS = [ PARTNER_RAZORPAY ]; /** @@ -53,7 +58,7 @@ export interface StoredPaymentMethodBase { } export interface StoredPaymentMethodPayPal extends StoredPaymentMethodBase { - payment_partner: 'paypal_express'; + payment_partner: 'paypal_express' | 'paypal_ppcp'; } export interface StoredPaymentMethodRazorpay extends StoredPaymentMethodBase { @@ -125,8 +130,9 @@ const CREDIT_CARD_SELECTED_PATHS: ImagePathsMap = { mastercard: creditCardMasterCardImage, unionpay: creditCardUnionPayImage, visa: creditCardVisaImage, - paypal_express: payPalImage, paypal: payPalImage, + paypal_express: payPalImage, + paypal_ppcp: payPalImage, razorpay: razorpayImage, }; @@ -148,7 +154,7 @@ export const PaymentMethodSummary = ( { email?: string; } ) => { const translate = useTranslate(); - if ( type === PARTNER_PAYPAL_EXPRESS ) { + if ( type === PARTNER_PAYPAL_EXPRESS || type === PARTNER_PAYPAL_PPCP ) { return <>{ email || '' }; } if ( type === PARTNER_RAZORPAY ) { diff --git a/client/me/purchases/billing-history/receipt.tsx b/client/me/purchases/billing-history/receipt.tsx index bda9a807fbf682..1a38a16c7dd742 100644 --- a/client/me/purchases/billing-history/receipt.tsx +++ b/client/me/purchases/billing-history/receipt.tsx @@ -21,7 +21,7 @@ import Main from 'calypso/components/main'; import NavigationHeader from 'calypso/components/navigation-header'; import TextareaAutosize from 'calypso/components/textarea-autosize'; import PageViewTracker from 'calypso/lib/analytics/page-view-tracker'; -import { PARTNER_PAYPAL_EXPRESS } from 'calypso/lib/checkout/payment-methods'; +import { PARTNER_PAYPAL_EXPRESS, PARTNER_PAYPAL_PPCP } from 'calypso/lib/checkout/payment-methods'; import { billingHistory, vatDetails as vatDetailsPath } from 'calypso/me/purchases/paths'; import titles from 'calypso/me/purchases/titles'; import useVatDetails from 'calypso/me/purchases/vat-info/use-vat-details'; @@ -207,7 +207,10 @@ function ReceiptPaymentMethod( { transaction }: { transaction: BillingTransactio const translate = useTranslate(); let text; - if ( transaction.pay_part === PARTNER_PAYPAL_EXPRESS ) { + if ( + transaction.pay_part === PARTNER_PAYPAL_EXPRESS || + transaction.pay_part === PARTNER_PAYPAL_PPCP + ) { text = translate( 'PayPal' ); } else if ( 'XXXX' !== transaction.cc_num ) { text = translate( '%(cardType)s ending in %(cardNum)s', {