Skip to content

[Bug] Incorrect types for subscription application_context #716

@kinetifex

Description

@kinetifex

Library used

paypal-js

🐞 Describe the Bug

TypeScript error for missing return_url and cancel_url which conflicts with guidance from this past issue: #238

🔬 Minimal Reproduction

const myButtons = buttons({
  createSubscription: async (_data, actions) => {
    return await actions.subscription.create({
      application_context: {
        brand_name: 'My Brand',
        shipping_preference: 'NO_SHIPPING',
      },
      plan_id: 'MY_PLAN_ID',
      quantity: 1
    })
  })

😕 Actual Behavior

TS2739: Type `application_context` is missing the following properties: return_url, cancel_url
billing_subscriptions_v1.d.ts(1301, 13): The expected type comes from property application_context which is declared here on type ...

🤔 Expected Behavior

No type errors when return_url and cancel_url are not specified in the application_context.

🌍 Environment

  • Node.js/npm: - 22.21.0/10.9.4
  • OS: - MacOS 15.6.1
  • Browser: - N/A

➕ Additional Context

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions