View your PayPal Notifications on discord or Create a custom addon that hooks with this addon!
This addon also servers purpose of a Template Addon for users to learn BrayanBot Development.
How to setup PayPal Notifications
1) Head over to PayPal IPN Settings
2) Edit Settings
3) Enter your Hosting's IP(with port if available) and in end add /paypal-notification to the url
-> Example: https://127.0.0.1/paypal-notification
3) Save the Settings
How to hook PayPal Notification into other addons
1) Create your File with Addon Template
2) Import EventHandler into your file
3) Set an Event to listen on as shown on below code
JavaScript:
const Eventhandler = require("../Modules/Handlers/EventHandler")
Eventhandler.set("paypalNotification", (bot, data) => {
// Your code here
})Whenever an PayPal Payment is received Event will be triggered & your code will run
-> This addon is also an example of this event.
YAML:
# Discord Webhook URL Only
Notification:
- https://discord.com/api/webhooks/xxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxx
Embed:
Embeds:
- AuthorIcon: https://cdn.zorino.in/paypal.png
Author: New PayPal Notification Received
Description: "> Payment Status: **{status}**"
Footer: "{txn-id}"
Fields:
- Name: • General Info
Value: |-
> **Received**: {unix}
> **Sent-To**: {sent-to}
- Name: • Item Info
Value: |-
> **Item**: {item-name}
> **Item-ID**: {item-id}
> **Invoice**: {invoice}
> **Quantity**: {quantity}
> **Gross**: {gross} {paid-in}
> **Fee**: {fee} {paid-in}
> **Tax**: {tax} {paid-in}
- Name: • Customer Info
Value: |-
> **Name**: {first-name} {last-name}
> **Email**: || {email} ||
> **Residence**: {residence}