Introduction
This article describes in details all operations performed between the Perfect Gym system and CrediCare payment provider. CrediCare operates based on e-invoicing method. Go to this article to find more information on e-invoice payments.
Before you start
Read some basic information about the CrediCare integration here.
All results of described operations can be provided and verified in a dedicated CrediCare interface in PGM available under Finance > CrediCare.
Send Invoices from PerfectGym to CrediCare
It is implemented within the Direct Debit feature within the PGM. After generating Direct Debit, in the Invoice module, new invoices connected with UserTransactions will be created. The results can be previewed in a dedicated CrediCare interface, which can be found in the PGM -> Finances -> CrediCare.
Once per month we should generate bookings for all clubs with parameters as below:

- Balance for the date - last date of the month
- For membership fees, we should choose only “Debit transaction” and “Empty” as User transaction type
- For Annual Fees bookings, only “Annual Fee” option should be set.
Receive information about Payments from CrediCare
It is included in DirectDebit process and results can be previewed in dedicated CrediCare inreface in the PGM -> Finances -> CrediCare
How transactions are settled?
After receiving a certain amount in a single payment, system has to distribute this amount on unsettled transactions. For each payment system will create one CrediCareSettlementPaymentFrom record and for each item in the Invoice a corresponding credit UserTransactions with UserTransactionSettlement and CrediCareSettlementPaymentFrom .
There are couple of scenarios that could happen when we receive payment:
-
Amount of payment is the same as the invoice amount.
- Full amount of payment is distributed and debit transactions are completely settled.
-
Amount of payment is bigger than invoice amount and overpayment amount is the same as Invoice Fee amount.
- Full amount of payment is distributed and debit transactions are completely settled. Additionally new credit and debit UserTransaction has been created for Invoice Fee and settled.
- Amount of payment is bigger than invoice amount
- Some part of the payment amount is distributed and debit transactions are completely settled. The overpayment amount could not be settled by the system. This amount is saved in table CrediCarePaymentFrom column AmountToSettle.
-
Amount of payment is smaller than invoice amount
- Full amount of payment is distributed and debit transactions are only partially settled. In the first place system will try to settle debit UserTransactions with the biggest amount left to settle. If the amount is not big enough, only a part of this transaction will be settled (even if smaller transactions could be fully settled). If the payment is sufficient, system will fully settle this transaction and will pick next biggest until full amount of payment is distributed.
Send information about Payments in clubs to CrediCare
After a sale, there is generate ad-hock XML file with payment and is upload to CrediCare. Both Invoice in PG and in CrediCare is settle.
Tdate (payment date) send to CrediCare is equal to a transaction date from user transactions. If user manually add backdated payments to the system it will result in a way that settlement date will be different (today) from payment date send to credicare
Send information about credit note to CrediCare
Manual Corrections
To generate a manual credit note you have to go to a member profile and in the contract transactions view create the manual transaction.
Select operation type ChargeCancellation and select UserTransaction that you want to decrease the value.
If to selected UserTransaction was sent an e-invoice there will be generated credit note and send to CrediCare
Automatic Corrections
If a user adds a freeze, discount or recalculates a contract due to other operations, Credit Notes will be created automatically.
Settle payments from the deviation list
If Perfect Gym received a payment that cannot be settled with any Invoice (due to the mismatch of KID, invoice or user numbers or double payment for one invoice) it will be visible on the deviation list available under PGM -> Finance -> CrediCare >- Payments From CrediCare - filter list based on is settled = no
User can settle such payments manually (make a business decision where this payments should land).
- Find user for which you want to settle the payment (investigate user transactions)
- Paste the chosen user number in the user field and select the assigned contract
- Comment what was the reason for this payment being unsettled and how you handled this case
- Total amount of this payment will be settled with transactions of picked contract as overpayment.
Change payment source from Credit Card to CrediCare for a debt collection
Automatic change
There is a possibility to set up an automation that triggers the change of a payment source. By default, it will run once a day at 0:45 AM, pick up all contracts with 4 consecutive credit card payment failures (recurring payments only) and then add a blank direct debit (paper invoice) payment source so they can be debt collected by the CrediCare.
There are additional settings to customize the behaviour of the task:
- Number of hours after contract creation that it is ignored by the automation - by default 24h
- Number of consecutive CC recurring failures that is needed for the automation to add the blank direct debit payment source for the CrediCare - by default 4
Manual change
You can also assign the blank direct debit payment source (paper invoice) manually (by adding payment source) set:
- name and last name as usual
- account number =
0000000(7 zeros) - bank code =
000000(6 zeros)