medusa icon indicating copy to clipboard operation
medusa copied to clipboard

data parameter not passed in patchOrder (medusa-paypal-payment)

Open twietobiii opened this issue 1 year ago • 3 comments

Bug report

Describe the bug

In the medusa-paypal-payment plugin the data parameter of patchOrder (paypal-sdk.ts line 49) is not passed to the HTTP-Client request. Therefore the amount in the paypal checkout flow is not properly updated on any changes of the cart / payment session (e.g. add or remove a discount code).

System information

Medusa version: 1.20.4 medusa-paypal-payment version: 6.0.3

Steps to reproduce the behavior

  1. Add medusa-paypal-payment plugin
  2. Add paypal as payment provider in admin ui
  3. Go to the checkout of your storefront
  4. Add or Remove a discount code
  5. Amount in paypal checkout flow does not match the correct amount of the storefront checkout

Expected behavior

The amount of the paypal checkout flow should equal the amount of the storefront checkout.

Code snippets

Current implementation:

 async patchOrder(orderId: string, data?: PatchOrder[]): Promise<void> {
    const url = PaypalApiPath.PATCH_ORDER.replace("{id}", orderId)
    return await this.httpClient_.request({ url, method: "PATCH" })
  }

Possible solution:

 async patchOrder(orderId: string, data?: PatchOrder[]): Promise<void> {
    const url = PaypalApiPath.PATCH_ORDER.replace("{id}", orderId)
    return await this.httpClient_.request({ url, method: "PATCH", data })
  }

twietobiii avatar Apr 18 '24 14:04 twietobiii

Any updates on this?

twietobiii avatar Jun 07 '24 08:06 twietobiii

any solution im having same issue !!

khalilxg avatar Jun 07 '24 13:06 khalilxg