diff --git a/tests/types/src/invalid.ts b/tests/types/src/invalid.ts index b2107e6c..f8ea9275 100644 --- a/tests/types/src/invalid.ts +++ b/tests/types/src/invalid.ts @@ -416,3 +416,18 @@ stripe // @ts-expect-error mandate_data is not a valid parameter result.confirmationToken.mandate_data; }); + +const paymentRequest = stripe.paymentRequest({ + country: 'US', + currency: 'usd', + total: { + label: 'Demo total', + amount: 1000, + }, + // @ts-expect-error Type 'number' is not assignable to type 'string'. + onBehalfOf: 123, +}); +paymentRequest.update({ + // @ts-expect-error Object literal may only specify known properties, and 'onBehalfOf' does not exist in type 'PaymentRequestUpdateOptions'. + onBehalfOf: 'acct_123', +}); diff --git a/tests/types/src/valid.ts b/tests/types/src/valid.ts index 6c5042c8..d474423f 100644 --- a/tests/types/src/valid.ts +++ b/tests/types/src/valid.ts @@ -3184,6 +3184,13 @@ const paymentRequest: PaymentRequest = stripe.paymentRequest({ }, }); +const paymentRequestOBO: PaymentRequest = stripe.paymentRequest({ + country: 'US', + currency: 'usd', + total: {label: 'Demo total', amount: 1000}, + onBehalfOf: 'acct_123', +}); + paymentRequest.canMakePayment().then((result) => { if (result) { const {applePay}: CanMakePaymentResult = result; diff --git a/types/stripe-js/payment-request.d.ts b/types/stripe-js/payment-request.d.ts index 502dd850..f8b01c01 100644 --- a/types/stripe-js/payment-request.d.ts +++ b/types/stripe-js/payment-request.d.ts @@ -237,6 +237,11 @@ export interface PaymentRequestOptions { */ applePay?: ApplePayOption; + /** + * The Stripe account ID which is the business of record. + */ + onBehalfOf?: string; + /** * @deprecated * Use disableWallets instead.