(Classic) How the API works
END-OF-LIFE ANNOUNCEMENT The Classic Online Experience with Payment API version 1 will be decommissioned at the end of 2024. All Payment API integrations should migrate to version 2, the Enhanced Online Experience, by January 2025.
The Payment API is a REST API used to initiate online payment transactions and/or submit recurring payments to the FinDock app in Salesforce. The API abstracts both Salesforce and FinDock configuration details for specific payment processors and methods, instead providing several informational resources to retrieve environment-specific parameters of a particular implementation.
API v1: From payer to collection
Once the Payer has entered the data in the online form:
- Form sends a payment request or
PaymentIntent
to the FinDock Payment API. - FinDock validates the payment request and creates a Payment with the chosen Payment Service Provider (PSP).
- FinDock creates a
Messages
record in Salesforce through an Authorized user to store the request and handles data creation:Create or update Contacts and/or Account records.
Create Installment and/or Recurring records with status
Pending
ALL logic with regards to data creation in the Salesforce environment - like Deduplication rules, Process Builders, Apex code and data creation in Source Connectors like Salesforce NPSP- is triggered at this point, and handled before the API continues! Any (Salesforce) errors in this stage will break the API!
- FinDock builds a response with the created data.
- FinDock sends a response with a
RedirectURL
to the a FinDock VisualForce page back to the form.* - Form redirects the Payer to the FinDock Redirect page based on the
RedirectURL
. - FinDock Redirect page redirects Payer to the PSP payment page.
- Payer either completes or cancels the payment on the PSP Page
- PSP page redirects Payer to Success or Failure Page provided in the initial payment request.
- PSP notifies FinDock VisualForce page through a Salesforce site (with Salesforce Site Guest user of the result of step 7.
- FinDock creates a
Message
record to store the Notification and handles data creation:- Creates a
Payment
record in Salesforce related to theInstallment
created at step 3. - Reduces the amount on the
Installment
with the amount of thePayment
. - Updates the status of the
Installment
toPaid
.
- Creates a
If the Payment was not completed the status of the Installment
is updated to Failed
.
If you use a Source Package like NPSP, FinDock updates the data in this package.
* For certain payment methods like direct debit and acceptgiro, steps 5-9 are not always required since the payment will be handled by sending files to and receiving files from your bank. These files can be generated from the data created through the API with Payment Schedules.
Next steps
Get started with the Payment API