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(payments): add return_url for Alipay PaymentIntent confirmation; fixes #19138 #19153

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

ShivanshKumar760
Copy link

-Fixes #19138

This PR addresses the issue where Cal.com was reporting an error from Stripe when confirming a PaymentIntent using Alipay. Stripe requires that a return_url parameter be provided for Alipay payments so that customers can be redirected back to the application after authentication. With this change, the payment confirmation now includes the return_url parameter (set to https://app.cal.com), ensuring that users are properly redirected to our application after an Alipay payment is processed.

@ShivanshKumar760 ShivanshKumar760 requested review from a team as code owners February 7, 2025 07:58
Copy link

vercel bot commented Feb 7, 2025

@ShivanshKumar760 is attempting to deploy a commit to the cal-staging Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant
Copy link

CLAassistant commented Feb 7, 2025

CLA assistant check
All committers have signed the CLA.

@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Feb 7, 2025
@graphite-app graphite-app bot requested a review from a team February 7, 2025 07:58
@github-actions github-actions bot added billing area: billing, stripe, payments, paypal, get paid 🐛 bug Something isn't working labels Feb 7, 2025
@dosubot dosubot bot added payments Created by Linear-GitHub Sync ❗️ migrations contains migration files labels Feb 7, 2025
Copy link

graphite-app bot commented Feb 7, 2025

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (02/07/25)

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

"Add community label" took an action on this PR • (02/07/25)

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

Copy link
Contributor

@anikdhabal anikdhabal left a comment

Choose a reason for hiding this comment

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

Left comments

Comment on lines 5 to 7
provider = "postgresql"
url = env("DATABASE_URL")
//directUrl = env("DATABASE_DIRECT_URL")
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this change?

Copy link
Author

Choose a reason for hiding this comment

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

Fixed

@@ -178,6 +179,7 @@ const PaymentForm = (props: Props) => {
payload = await stripe.confirmPayment({
elements,
redirect: "if_required",
return_url: "https://app.cal.com", // Redirect users to app.cal.com after payment
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to hardcode the URL. We have a certain constant; instead, use WEBAPP_URL

Copy link
Author

Choose a reason for hiding this comment

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

Fixed

Comment on lines 67 to 68
// return_url: `${window.location.origin}/payment-success`, // adjust this URL as needed
return_url: "https://app.cal.com", // Redirect users to app.cal.com after payment
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove unnecessary comments

Copy link
Author

Choose a reason for hiding this comment

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

Fixed

@@ -1,3 +1,4 @@
/*elint-disable*/
Copy link
Contributor

Choose a reason for hiding this comment

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

??

Copy link
Author

Choose a reason for hiding this comment

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

Removed eslint-disable comment

README.md Outdated
@@ -46,7 +46,7 @@

<img width="100%" alt="booking-screen" src="https://github.com/calcom/cal.com/assets/8019099/407e727e-ff19-4ca4-bcae-049dca05cf02">

# Scheduling infrastructure for absolutely everyone
# Schedulingg infrastructure for absolutely everyone
Copy link
Contributor

Choose a reason for hiding this comment

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

Revert it

Copy link
Author

Choose a reason for hiding this comment

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

Typo in README.md fixed

Comment on lines +181 to +183
confirmParams: {
return_url: WEBAPP_URL,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Also, one thing—shouldn't the return_url be the booking success page?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
billing area: billing, stripe, payments, paypal, get paid 🐛 bug Something isn't working community Created by Linear-GitHub Sync ❗️ migrations contains migration files payments Created by Linear-GitHub Sync
Projects
None yet
3 participants