When a refund is submitted from Salesforce, the following flow of events takes place:
- Salesforce securely sends the refund request through to the Asperato servers.
- Asperato identifies the refund requested, the amount requested, and then instructs the card gateway to process the refund against the original transaction. Depending on the amount, this can either be a full or a partial refund.
- The card gateway will (usually) perform some checks their side - this ensures the refund amount doesn't exceed the value of the original transaction, and sometimes limits the number of individual partial refunds that can be made against the same transaction.
- The card gateway then executes the refund request, and returns the response to Asperato.
- Asperato will parse the response from the card gateway, and create the relevant refund object in Salesforce. This in turn will update the "amount refunded" field on the original payment request, if the refund was successful.