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

PayPal App

Open PeerRich opened this issue 4 years ago β€’ 16 comments

collect payments for event-types with PayPal (similar to the existing Stripe Integration)

PeerRich avatar Jan 18 '22 16:01 PeerRich

if anyone wants to pick this up, here's how to make an app: https://docs.cal.com/how-to-guides/how-to-build-an-app

PeerRich avatar Feb 22 '23 19:02 PeerRich

we now have a new payment adaptor which makes it easier, too

PeerRich avatar Feb 22 '23 19:02 PeerRich

πŸ’Ž $200 bounty created by cal πŸ‘‰ No need to comment asking to work on it. Just open a PR and claim the bounty with /claim #1546 inside the PR πŸ“ Before proceeding, please make sure you can receive payouts in your country πŸ’΅ Payment arrives in your account 2-5 days after the bounty is rewarded πŸ’― You keep 100% of the bounty award πŸ™ Thank you for contributing to calcom/cal.com!

algora-pbc[bot] avatar Apr 14 '23 22:04 algora-pbc[bot]

I did a quick search but did not dive deep, here are few links for my findings:

here is the stripe app: https://github.com/calcom/cal.com/blob/main/packages/app-store/stripepayment And here is the PayPal API: https://developer.paypal.com/docs/api/payments/v1/

a0m0rajab avatar Apr 16 '23 00:04 a0m0rajab

Would this app also be ee only, like how the Stripe payment is?

AbleLincoln avatar May 01 '23 20:05 AbleLincoln

I've started diving into this, and some interesting things are coming up.

For example: how do we reconcile if the user has both Stripe and PayPal enabled? Is this something we even allow? Does one take precedence?

Pricing is currently set through the Stripe app gui. Adding another payment app will essentially add another field to set the price, which could cause event-types to have 2 different prices. Could get messy. (Unless we want distinct prices bc the fee structure is different for each platform?)

It looks like price used to just be a column on EventType, but I think it was deprecated in favor of getting that from app metadata. Maybe we switch it back now that we're implementing multiple payment options?

AbleLincoln avatar May 02 '23 05:05 AbleLincoln

how do we reconcile if the user has both Stripe and PayPal enabled? Is this something we even allow? Does one take precedence?

Ok I guess I answered my own question here https://github.com/calcom/cal.com/blob/ea676907b21966597021dd45621701f478e19be9/packages/lib/getPaymentAppData.ts#L24

But if this is the case, then how should we indicate to the user that only one of their payment options is going to actually work? As I'm messing around with it now, I'm able to have 2 payment apps running in a single event type. On the booking side, it's handled properly (Stripe gets booted for PayPal). But it's not clear when making the event type that only one is going to work. I think we will need some kind of UI that disables other payment apps when one is turned on.

AbleLincoln avatar May 02 '23 05:05 AbleLincoln

@PeerRich is it possible to assign this to me? I've got some parts working already

AbleLincoln avatar May 03 '23 07:05 AbleLincoln

@AbleLincoln wow that's great.

Didn't see this so I got to work on it and got the integration page for onboarding and callback working, but the PayPal REST api requires that your app is registered with PayPal as partner before you can test the URL referral portal. Have you looked into this?

Do you wanna share your progress and work together on this?

cnhhoang850 avatar May 04 '23 06:05 cnhhoang850

Yeah I'm talking to the PayPal people right now, so we'll see what they say about getting us access.

I kind of did things out of order, so I've got the payment page working but need to slot in the onboarding. I'll push what I have. Want to link your branch and we can collab?

AbleLincoln avatar May 04 '23 08:05 AbleLincoln

https://github.com/AbleLincoln/cal.com/tree/feat/paypal-app you can see what I've got so far

AbleLincoln avatar May 04 '23 09:05 AbleLincoln

@AbleLincoln Will definitely take a look on your code. Sharing mine as well https://github.com/calcom/cal.com/pull/8797 I've take the route to use a custom button at payment page and use Paypal api on the server just like we do with stripe.

alannnc avatar May 10 '23 01:05 alannnc

The solution I have allows the user to enable the payment app just by signing into their PayPal account. No developer account or API credentials required. I feel like this is an easier user experience. You can check out the flow below.

paypal wee

The solution is nearly finished, and I'm already in contact with the PayPal rep that will give us access to move into production. Is this a path we would like to pursue?

AbleLincoln avatar May 10 '23 10:05 AbleLincoln

It looks great! Definitely we are always aiming for better user experience. Although we should keep in mind that the app should be available for self hosted users. What is the way to go for self hosted users? Can you share with me the docs from paypal you used for this integration? @AbleLincoln

alannnc avatar May 11 '23 15:05 alannnc

Ah that's interesting, I hadn't thought about the self-hosted element. These are the docs I've been referencing. In the case of self-hosting, the user would need to apply for their own marketplace app account on PayPal, which is a bit complicated. In that case then I think using developer api keys makes more sense.

AbleLincoln avatar May 11 '23 21:05 AbleLincoln

@AbleLincoln I just got back home from our retreat, one of my priorities this week it's the Paypal app. Did you manage to have a working PR? I'm thinking we could probably have our 2 approaches and the user decide what they wanna use.

alannnc avatar May 15 '23 23:05 alannnc

@AbleLincoln We are still reviewing Paypal implementation for Cal.com, were you able to have a working example for OAuth implementation? CC: @joeauyeung

alannnc avatar Jun 21 '23 19:06 alannnc

Seems issue is already shipped in v3.2.0.

ubinatus avatar Oct 10 '23 16:10 ubinatus

Is this issue already resolved?

H9660 avatar Dec 17 '23 11:12 H9660