TAPP augments the GoCardless subscription and membership functionality by allowing you to make a Microsoft Dynamics 365 invoice as a subscription template and thus trigger the recurring payment schedule at GoCardless. Subsequently, when GoCardless takes subscription payments from your customers’ bank accounts, TAPP will automatically generate and settle invoices in Microsoft Dynamics 365 Sales or Customer Service while sending back the invoice number as metadata back to GoCardless, thus reducing a lot of effort to manually create invoices, ensure maximum traceability and let the data be easily exportable for consumption in other business systems such as ERPs.
Pre-requisites
- The Dataverse environment hosting Microsoft Dynamics 365 Sales and Bluefort TAPP should be linked to a GoCardless merchant.
- Merchant account must be correctly linked on the TAPP onboarding record of type GoCardless.
- Account or Contact must have an active mandate and customer id configured and selected in the GoCardless Mandate field and the GoCardless Customer ID field on the account or contact.
- The Invoice header record must be for the Account or Contract where what is described in point 1 is true
- The invoice must contain one or more line i.e. Total Amount is not equal to zero.

Triggering a GoCardless Subscription from an Invoice
When you want to trigger a payment for a non-zero invoice where the Pay with GoCardless Direct Debit is set to true, you simply toggle the Pay Now flag and save the Invoice record.
For a subscription payment, the following must be configured on the invoice record before toggling the Pay Now flag.

| Field Name | Description |
| Start Date | The date on which the subscription starts, This is mandatory. |
| Interval | The interval of the payment. This is mandatory. |
| Interval unit | The interval unit. The options are either Weekly or Monthly or Yearly. This is mandatory. |
| Count | The number of times to withdraw a payment. This field is optional. If left blank, the subscription will go on forever until manually cancelled. |
| Day of month | The day of the month the payment is withdrawn. This field is optional. |
| Month | The month of year the payment is withdrawn. This field is optional. |

Interdependency between the Interval, Day of Month and Month fields
The Day of month and Month fields are optional but if they are set then the following rules in the table below apply.


Congratulations!
You have finished configuring the GoCardless subscription. Just toggle the Pay Now slider to true and save the Invoice record to trigger the creation of the subscription. Once saving is complete you can toggle the Read Subscription slider to synchronise the subscription details to the Invoice record.

The unique subscription id value generated by GoCardless is saved in the Subscription ID field. It also created a record in the table called GoCardless Subscription Templates. In this table one can view the GoCardless subscriptions linked with the invoice record that triggered the creation of the subscription and other useful information.

The Change Subscription Status field is set to Active by default and can be used the change the status of the subscription.

Set the value to Pause to temporarily pause the subscription.
Set the value back to Active in order to un-pause the subscription.
Set the value to Cancelled if you want to cancel the subscription permanently. If the Count field on the invoice record is not set, the subscription goes on forever until manually cancelled for as long as the mandate remains active.
Finished should not be manually selected. Finished indicates that the subscription has gone through all of its cycles as configured in the Count field on the invoice record, which is optional.

When GoCardless generates payments based on the subscription configuration, Bluefort TAPP automatically generate invoice records linked to these payments. The invoice records are a carbon copy (in terms of invoice header, lines, account/contact, products, prices etc) of the original invoice which triggered the generation of the subscription. A record is also created in the GoCardless Subscription Invoices table.
This also makes the invoices reconcilable with the GoCardless Payouts data which is very useful when export data to your ERP or financial software suite.

The Invoice records and the GoCardless Subscription Invoices records are created during the payment synchronisation process. This saves a lot of effort in having to manually creating invoice and invoice lines in Microsoft Dynamics 365 Sales to settle against the payments received from the subscription..