This article describes an integration with the v1 of the API. Ongoing development on this version has stopped. Please use our new and improved API v2!
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
Even though v1 of the Payment API is still supported, we strongly recommend new implementations to use v2, and existing implementations to migrate to v2. The API v2 provides significant improvements in performance, ease-of-integration and functionality. Development of new features on v1 has stopped after the July 2020 release. To find out how to migrate, please visit our Classic to Enhanced Online Experience migration article.
Once the Payer has entered the data in the online form:
- Form sends a payment request or
PaymentIntentto the FinDock Payment API.
- FinDock validates the payment request and creates a Payment with the chosen Payment Service Provider (PSP).
- FinDock creates a
Messagesrecord 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
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
RedirectURLto the a FinDock VisualForce page back to the form.*
- Form redirects the Payer to the FinDock Redirect page based on the
- 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
Messagerecord to store the Notification and handles data creation:
- Creates a
Paymentrecord in Salesforce related to the
Installmentcreated at step 3.
- Reduces the amount on the
Installmentwith the amount of the
- Updates the status of the
- Creates a
If the Payment was not completed the status of the
Installment is updated to
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.