Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PayPal payment session not being updated after cart is updated #8455

Closed
Arsenalist opened this issue Aug 5, 2024 · 5 comments
Closed

PayPal payment session not being updated after cart is updated #8455

Arsenalist opened this issue Aug 5, 2024 · 5 comments

Comments

@Arsenalist
Copy link
Contributor

Arsenalist commented Aug 5, 2024

Node: 18
Medusa 1.20.9,
PayPal plugin: 6.0.4
OS: MacOS

Steps to reproduce:

  • Add 1 item to cart for $10
  • Create PayPal payment session, it will be for $10
  • Click PayPal button to see popup prompt to pay for $10
  • Close popup
  • Change quantity of item in cart to 2, so total is $20
  • Click PayPal button again, it will still say $10 when it should say $20

The call to PayPal API is happening OK in PayPalProvider.updatePayment() but the PayPal order ID does not reflect the new value.

In PayPal console, the PATCH request which is supposed to update the amount to $20 has no data associated with it:

image

This makes sense as it's calling patch order in the paypal-sdk file and that doesn't send any data (even though data is passed into it):

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

Perhaps the fix is to actually pass the data into the call?

@Arsenalist
Copy link
Contributor Author

Arsenalist commented Aug 5, 2024

PR which fixes this: #8456

@srindom
Copy link
Collaborator

srindom commented Aug 7, 2024

Thanks for the fix! 💪

@srindom srindom closed this as completed Aug 7, 2024
@ximenadev
Copy link

Hi @srindom @carlos-r-l-rodrigues , having a similar bug, but instead of editing the quantity for the item I get it after adding another item or a shipping method

looking into the code I think this update wasn't published

@carlos-r-l-rodrigues
Copy link
Contributor

@olivermrbl #8455 is missing a changeset and wasn't included in the release.

Thanks @ximenadev for the heads up

@olivermrbl
Copy link
Contributor

olivermrbl commented Aug 26, 2024

Nice catch, will publish a new release later today.

Correction: We haven't published these changes yet. Will do that today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants