Skip to content

Commit

Permalink
Add support for MOTO in credit card payments extension schema
Browse files Browse the repository at this point in the history
  • Loading branch information
Phatye committed Dec 9, 2024
1 parent 2926cb0 commit 704c99d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const config: CreditCardPaymentsAppExtensionConfigType = {
supported_countries: ['CA'],
supported_payment_methods: ['PAYMENT_METHOD'],
supported_buyer_contexts: [{currency: 'USD'}, {currency: 'CAD'}],
supports_moto: true,
supports_3ds: false,
test_mode_available: true,
supports_deferred_payments: false,
Expand Down Expand Up @@ -194,6 +195,7 @@ describe('creditCardPaymentsAppExtensionDeployConfig', () => {
supported_payment_methods: config.supported_payment_methods,
supported_buyer_contexts: config.supported_buyer_contexts,
test_mode_available: config.test_mode_available,
supports_moto: config.supports_moto,
supports_3ds: config.supports_3ds,
supports_deferred_payments: config.supports_deferred_payments,
supports_installments: config.supports_installments,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const CreditCardPaymentsAppExtensionSchema = BasePaymentsAppExtensionSche
targeting: zod.array(zod.object({target: zod.literal(CREDIT_CARD_TARGET)})).length(1),
verification_session_url: zod.string().url().optional(),
ui_extension_handle: zod.string().optional(),
supports_moto: zod.boolean(),
encryption_certificate_fingerprint: zod
.string()
.min(1, {message: "Encryption certificate fingerprint can't be blank"}),
Expand Down Expand Up @@ -72,6 +73,7 @@ export interface CreditCardPaymentsAppExtensionDeployConfigType extends BasePaym
supports_3ds: boolean

// CreditCard-specific fields
supports_moto: boolean
start_verification_session_url?: string
ui_extension_registration_uuid?: string
ui_extension_handle?: string
Expand Down Expand Up @@ -106,6 +108,7 @@ export function creditCardDeployConfigToCLIConfig(
supported_buyer_contexts: config.supported_buyer_contexts,
test_mode_available: config.test_mode_available,
supports_3ds: config.supports_3ds,
supports_moto: config.supports_moto,
supports_deferred_payments: config.supports_deferred_payments,
supports_installments: config.supports_installments,
verification_session_url: config.start_verification_session_url,
Expand All @@ -132,6 +135,7 @@ export async function creditCardPaymentsAppExtensionDeployConfig(
supported_buyer_contexts: config.supported_buyer_contexts,
test_mode_available: config.test_mode_available,
supports_3ds: config.supports_3ds,
supports_moto: config.supports_moto,
supports_deferred_payments: config.supports_deferred_payments,
encryption_certificate_fingerprint: config.encryption_certificate_fingerprint,
supports_installments: config.supports_installments,
Expand Down

0 comments on commit 704c99d

Please sign in to comment.