How to Set Up PayPal Integration
- Getting Started
- Bot Building
- Smart Agent Chat
- Conversation Design
-
Developer Guides
Code Step Integration Static Step Integration Shopify Integration SETU Integration Exotel Integration CIBIL integration Freshdesk KMS Integration PayU Integration Zendesk Guide Integration Twilio Integration Razorpay Integration LeadSquared Integration USU(Unymira) Integration Helo(VivaConnect) Integration Salesforce KMS Integration Stripe Integration PayPal Integration CleverTap Integration Fynd Integration HubSpot Integration Magento Integration WooCommerce Integration Microsoft Dynamics 365 Integration
- Deployment
- External Agent Tool Setup
- Analytics & Reporting
- Notifications
- Commerce Plus
- Troubleshooting Guides
- Release Notes
Table of Contents
What is PayPal?
PayPal is a payment solution that allows businesses to accept, process, and disburse payments.
Haptik has come up with PayPal Integration using which you can add payment solutions to your bot. Once this integration is set up on your bot, you can collect payments from your users by providing them a PayPal Invoice over conversations, generated using PayPal Invoice APIs. It is a highly convenient way to accept payments from users.
Prerequisites for using PayPal Integration
- A registered account on PayPal. You can read more about it here.
- A bot on Haptik. You can read this article to build your own bot.
- APIs for fetching necessary information from your CRM system. You can read more about PayPal APIs here.
- Also Note: Eligibility - Invoicing is available in multiple countries.
How to set up?
We have packaged PayPal Integration in the form of a Smart Skill for faster deployment.
The available Smart Skill for PayPal is "paypal invoice". You can make use of this Smart Skill as per your requirement.
How to use the Skill
You can plug this Skill at a point of the bot flow where you would want to collect payments from the user.
For Example: During the cart checkout process. For testing purposes, you can type the intent “PayPal payment flow” for generating a payment link for a sample amount that has been preconfigured.
How to make changes to the Skill
Since this Smart Skill is for payment purposes specifically, which is why we focus on generating a payment link.
Step 1: We have tried to make the Smart Skill platform agnostic and have incorporated necessary variations for WebSDK and WhatsApp platforms. The flow starts with the user getting a prompt to enter their mobile number on WebSDK, whereas on WhatsApp this prompt gets skipped as we are using the completion_phone_number system entity (captures phone number automatically on WhatsApp).
Step 2: Once the phone number is captured, the flow reaches the ‘paypal invoice’ Code Step wherein we call a dummy API to create a draft invoice and further generate the invoice link
The following are the functions being used in this Code Step:
Sr. No. |
Function |
Description |
---|---|---|
1 |
get_auth_key(): |
This function generates the authentication key required to use in the generation of the access token. The authentication key is nothing but the base64 encoded value of 'username:password'. For the demo, we have used some credentials. The business can replace this with its own creds. |
2 |
generate_token(conversation_details): |
This function generates the access token required to call the PayPal payment link generation. The authentication key created in the above function is used here. |
3 |
create_draft_invoice(conversation_details): |
This function generates the draft invoice by using the access token that we generated from the earlier function.
You can read more about it here.
|
4 |
send_invoice(conversation_details): |
This function sends the invoice and generates the payment link. we use the digit variable that we created from the earlier function. Also, you can add an array of one or more CC: emails to which notifications are sent in "additional_recipients". If you omit this parameter, a notification is sent to all CC: email addresses that are part of the invoice. You can read more about it here. |
Step 3: Next, you need to add the 'Client ID' and 'Secret' from your Sandbox API Credentials as 'username' and 'password' variables in the get_auth_key(): function as shown in the image below.
You can read more about Sandbox API Credentials here.
Finally, after you have made the necessary changes, you can test the flow end-to-end.
Beyond this available predefined Skill, you can also build custom use cases by editing this Skill. Whatever changes and updations are required will be done to the Code Steps of this Smart Skill depending on your requirements.