PaddleHQ / paddle-js-wrapper

Wrapper to load Paddle.js as a module and use TypeScript definitions when working with methods.
Apache License 2.0
28 stars 4 forks source link

[Bug]: Property updateCheckout does not exist on type Checkout #36

Closed gorshkovaea closed 1 month ago

gorshkovaea commented 2 months ago

What happened?

I attempted to update a checkout form with new items and reset a discount using the following code paddle.Checkout.updateCheckout({ discountId: null, items: [{ priceId: 'newPriceId', quantity: 1 }], }); However, I encountered a TypeScript error stating "Property updateCheckout does not exist on type". Nonetheless, there is a documentation for this method here, and also I was able to use it successfully by casting to 'any' as follows: (paddle.Checkout as any).updateCheckout({ discountId: null, items: [{ priceId: 'newPriceId', quantity: 1 }], }); .

Why can't I reach updateCheckout in my ts code without an error?

Steps to reproduce

  1. Call paddle.Checkout.updateCheckout in .ts file
  2. Get a ts error "Property updateCheckout does not exist on type"

What did you expect to happen?

paddle.Checkout.updateCheckout() works well without any errors

How are you integrating?

React, TypeScript

Logs

No response

vijayasingam-paddle commented 2 months ago

Hi @gorshkovaea, Thank you for raising this issue. It appears that we have missed to include the type definition for this function.

I will update it shortly.

vijayasingam-paddle commented 1 month ago

Hi @gorshkovaea, I have released a new version with the type definition for updateCheckout function. Please update to the latest version (1.1.1)

Thank you.

gorshkovaea commented 1 month ago

thank you!