import Link from "next/link"; import { useRouter } from "next/navigation"; import { useState } from "react"; import { Toaster } from "react-hot-toast"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { trpc } from "@calcom/trpc"; import { Button, showToast, TextField } from "@calcom/ui"; import { Icon } from "@calcom/ui"; export default function PayPalSetup() { const [newClientId, setNewClientId] = useState(""); const [newSecretKey, setNewSecretKey] = useState(""); const router = useRouter(); const { t } = useLocale(); const integrations = trpc.viewer.integrations.useQuery({ variant: "payment", appId: "paypal" }); const [paypalPaymentAppCredentials] = integrations.data?.items || []; const [credentialId] = paypalPaymentAppCredentials?.userCredentialIds || [-1]; const showContent = !!integrations.data && integrations.isSuccess && !!credentialId; const saveKeysMutation = trpc.viewer.appsRouter.updateAppCredentials.useMutation({ onSuccess: () => { showToast(t("keys_have_been_saved"), "success"); router.push("/event-types"); }, onError: (error) => { showToast(error.message, "error"); }, }); if (integrations.isPending) { return
; } return (
{showContent ? (
Paypal Payment Logo

Paypal

setNewClientId(e.target.value)} role="presentation" /> setNewSecretKey(e.target.value)} /> {/* Button to submit */}

Getting started with Paypal APP

Here in Cal.com we offer Paypal as one of our payment gateway. You can use your own Paypal Business account to receive payments from your customers enabling and setting up price and currency for each of your event types.

Important requirements:

  • Paypal Business account
  • Paypal Developer account

Resources:

Link to Paypal developer API REST Setup Guide: https://developer.paypal.com/api/rest/#link-getclientidandclientsecret

Setup instructions

Remember to only proceed with the following steps if your account has already been upgraded to a business account. Also keep in mind that some of the following steps might be different since Paypal offers different experiences based on your country.

    {/* @TODO: translate */}
  1. Log into your Paypal Developer account and create a new app{" "} {t("here")} .
  2. Choose a name for your application.
  3. Click on the Create App button
  4. Go back to{" "} dashboard , click on new app created.
  5. Copy the Client ID and Secret Key using copy buttons one by one.
  6. Paste them on the required field and save them.
  7. You should be all setup after this.

Reminder:

Our integration creates a specific webhook on your Paypal account that we use to report back transactions to our system. If you delete this webhook, we will not be able to report back and you should Uninstall and Install the app again for this to work again. Uninstalling the app won't delete your current event type price/currency configuration but you would not be able to receive bookings.

) : (
Paypal
)}
); }