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

fix(payment, stripe) stripe payment cannot be captured #8075

Merged

Conversation

silenaker
Copy link
Contributor

@silenaker silenaker requested a review from a team as a code owner July 11, 2024 03:00
Copy link

changeset-bot bot commented Jul 11, 2024

⚠️ No Changeset found

Latest commit: 788d01d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Jul 11, 2024

@silenaker is attempting to deploy a commit to the medusajs Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Member

@adrien2p adrien2p left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me, might have to fix some tests or add new one to complete the existing set of tests. I ll let @olivermrbl double check that I haven't missed anything here

Copy link
Contributor

@olivermrbl olivermrbl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as well

const providerSessionSession =
await this.paymentProviderService_.createSession(input.provider_id, {
context: input.context ?? {},
context: { ...input.context, resource_id: paymentSession.id },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thought: Should the resource_id be overwritable? In case you want to associate the cart instead of the payment session. The Medusa payment session will always have a direct association with the third-party session through its payment_session.data.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can use a more specific field name to associate the Medusa payment session with the provider session, so as to avoid unintentional overwriting.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

session_id?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

session_id?

it’s ok

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed resource_id and replaced it with session_id. If other resource identifiers like order_id or cart_id are needed, I think they can be added based on future requirements, as currently, only session_id is the most useful.

@silenaker silenaker force-pushed the fix/stripe-payment-capture branch 3 times, most recently from 3a4e142 to d80e30f Compare July 12, 2024 02:49
Copy link
Member

@sradevski sradevski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! @silenaker can you please also update the tests (as you can see, some are failing) so we can have this merged? Thanks!

@silenaker silenaker force-pushed the fix/stripe-payment-capture branch from d80e30f to 90435fb Compare July 13, 2024 08:46
@silenaker
Copy link
Contributor Author

LGTM! @silenaker can you please also update the tests (as you can see, some are failing) so we can have this merged? Thanks!

resolved

@carlos-r-l-rodrigues carlos-r-l-rodrigues merged commit ba58842 into medusajs:develop Jul 13, 2024
15 of 22 checks passed
@carlos-r-l-rodrigues
Copy link
Contributor

Thank you @silenaker

@silenaker silenaker deleted the fix/stripe-payment-capture branch July 16, 2024 13:44
@silenaker silenaker restored the fix/stripe-payment-capture branch July 16, 2024 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants