Data Flow
...
While we want Stripe to do the heavy lifting of the payment processing, you want to know what has happened, and have it recorded in your Salesforce org, so that you can maintain it as your single source of truth. To do this, you will utilise webhooks from Stripe. Every time an event occurs in Stripe, if you have set up the webhooks correctly, you will receive all the necessary data into Salesforce, ready for PosiPay to update your records.
Info |
---|
Please note that to avoid creating duplicate Gateway Events and to ensure successful Gateway Transaction and Gift Transaction processes, there should be only one webhook endpoint per Gateway Account in your org. |
How to set up webhooks in the Stripe Dashboard
Go to Developers > Webhooks > Add endpoint.
...
When the Add endpoint is clicked, the image below will be shown
...
Expected Stripe Objects
Charge
Invoice
...
Payouts
...
You must select what event to listen to for the selected object.
Endpoint URL = Get the Webhook Endpoint URl from your Gateway Account record.
Listen to = Events on you account
Select events to listen to = Refer to the screenshots below for the adding of events.
...
Choose which Stripe Events to listen to
You must select which events to listen to for each Stripe object. There are 3 objects that PosiPay needs to listen to. Each object has different events, so carefully select only what is only needed → as much as possible needed. Wherever possible, do not select all events available.
...
Charge
...
Fundraising Extension uses invoices for gift transaction scheduled payments. PosiPayments needs to have a facility to listen to any invoice events.
The payload is sent out to salesforce from the stripe webhook.
...
Invoice payments can:
Request payment on specific future dates Automatically charge a payment
Enable the following events on the invoice object:
1. invoice.created
...
2. invoice.payment_failed
...
3. invoice.payment_succeeded
...
When an invoice is created
...
When an invoice is updated to paid.
...
When the payment of an invoice is successfully charged.
...
Payouts
After the payment, several things can happen. If the payment succeeds normally, you can focus on payout options from Stripe, sending email receipts, and triggering workflows to fulfill the customer’s order. When it’s more complicated, Stripe provides guidance for things like declined cards, refunds, disputes, and fraud. More about payouts here
How to configure payouts on your dashboard
Go to Balances and click Manage. See the sample screenshot below.
...
When the Manage payout schedule is clicked, a user can select either manual or automatic.
...
Invoice
Please note: If PosiPay version is 92 and above please do not include the invoice.created and invoice.updated event.
...
Payouts
...
Payment
payment_intent.canceled
...
payment_method.attached
payment_method.automatically_updated
payment_method.updated
Customer
customer.created
customer.updated
Next place to go: Step 5 - Schedule an Invoice