cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

feat: redirect after booking: option to forward parameters

Open Amit91848 opened this issue 2 years ago • 9 comments

What does this PR do?

Fixes #14223 /claim #14223

https://github.com/calcom/cal.com/assets/74371312/8939cca9-8570-4577-b081-5399e1ec549c

Type of change

  • New feature (non-breaking change which adds functionality)

Mandatory Tasks

  • [x] Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

Amit91848 avatar Mar 27 '24 17:03 Amit91848

@Amit91848 is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Mar 27 '24 17:03 vercel[bot]

Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link.

github-actions[bot] avatar Mar 27 '24 17:03 github-actions[bot]

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (03/27/24)

1 reviewer was added to this PR based on Keith Williams's automation.

"Add community label" took an action on this PR • (03/27/24)

1 label was added to this PR based on Keith Williams's automation.

graphite-app[bot] avatar Mar 27 '24 18:03 graphite-app[bot]

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

github-actions[bot] avatar Mar 27 '24 18:03 github-actions[bot]

Heads up @Amit91848 when testing with a booking that requires payment, the payment specific params are still being added.

Ex. http://localhost:3001/?payment_intent=pi_*****&payment_intent_client_secret=pi_***8&redirect_status=succeeded

Hmm, will look into it.

Amit91848 avatar Apr 04 '24 17:04 Amit91848

Ex. http://localhost:3001/?payment_intent=pi_*****&payment_intent_client_secret=pi_***8&redirect_status=succeeded

Hey @joeauyeung, those params are being automatically added by Stripe on the return_url. Tried searching but unfortunately stripe does not give any option to not include those.

You can instead choose redirect: "if_required" and not pass return_url and handle state logic after payment on our end.

https://github.com/calcom/cal.com/blob/d59e68de6d2a6476c7f2e0ccbe63c545223e0ff3/packages/features/ee/payments/components/Payment.tsx#L111-L116

Relevant docs: https://docs.stripe.com/js/payment_intents/confirm_payment#confirm_payment_intent-options-confirmParams-return_url

Amit91848 avatar Apr 07 '24 15:04 Amit91848

This should fix stripe passing params.

https://github.com/calcom/cal.com/assets/74371312/b7f4d1a4-a9f7-4c4c-8096-1a5bb5d5f0f0

Amit91848 avatar Apr 07 '24 15:04 Amit91848

Didn't realize we were using those stripe params, all tests are passing now.

Amit91848 avatar Apr 08 '24 06:04 Amit91848

This PR is being marked as stale due to inactivity.

github-actions[bot] avatar May 03 '24 00:05 github-actions[bot]