Using the Payment Request Generator

You can manually run the Payment Request Generator to create references, or you can set up an automatic run. If you have not done so already, please read What is the Payment Request Generator? before continuing.

Create a manual run

To create a manual Payment Request Generator Run:

  1. Launch the FinDock app and click the Payment Request Generator Run tab.
  2. Click the New button to define a manual run.
  3. Give the run a name, leave the status as New, and click Save. new_payment_requestgenerator_run
  4. Further specify the generation run as described below:
    • Select Reference & Generator Type: Select the type of reference and generator. Note that the list of payment request types includes the specific processor in parentheses. For most types, there is only one processor option, but for ESR, for example, there are two processors because the reference for LSV+ is not identical to CH-DD.
      Payment request type options
    • Select Source & Mapping: Specifiy the source type and corresponding field mapping.
  5. Click Save & Start Generating to start the reference generation.
  6. Track progress in the Payment Request Generator progress view. paymentrequestgenerator_progress

If there are issues, you will find an error message in this view which can help with troubleshooting. When you have solved the root cause, you can put the status back to New and click Save & Start Generating again to retry.

Our payment reference generator algorithms are designed to never generate the same payment reference twice. FinDock explicitly checks for uniqueness within the scope of a given Payment Reference Generator Run (Batch Apex). However, some types of payment references are relatively short.

   When you generate large volumes of references, it is possible, though rare, to end up with duplicates. To catch duplicates, marking the chosen Reference Field as unique. Salesforce then enforces uniqueness and prevents duplicate values from being stored in that field.

Create an automatic run

If you insert a Payment Request Generator Run record with status ‘Generated,’ the run starts automatically. All possible ways in Salesforce to create a record (Apex, Flow, Quick Action, etc.) are available for automation. However, automatic runs can only be done with source type Campaign or Campaign Member.

Here are a couple of automation examples. To get values for other methods (Reference Type, Generator Type, etc.), first do a manual generator run. Then you can check the resulting run record to get the correct values.

Automation example: Standard ESR (QR-bill)

    cpm__Reference_Generator_Run__c run = new cpm__Reference_Generator_Run__c(
        Name = 'ESR - Standard',
        cpm__Reference_Type__c = 'ESR',
        cpm__Generator_Type__c = 'ESRSFDCRecordIdReferenceGenerator',
        cpm__Processor__c = 'PaymentHub-CH-DD',
        cpm__Source_Type__c = 'campaign',
        cpm__Campaign__c = c.Id,
        cpm__Other_Input_fields__c = '{}',
        cpm__Other_Output_Fields__c = '{\"reference-value\":\"My_Custom_Reference__c\"}',
    );
    insert run;

Example: Custom ESR (QR-bill)

    cpm__Reference_Generator_Run__c run = new cpm__Reference_Generator_Run__c(
        Name = 'ESR - Bring Your Own Base Reference',
        cpm__Reference_Type__c = 'ESR',
        cpm__Generator_Type__c = 'ESRBaseReferenceReferenceGenerator',
        cpm__Processor__c = 'PaymentHub-CH-DD',
        cpm__Source_Type__c = 'campaign',
        cpm__Campaign__c = c.Id,
        cpm__Other_Input_fields__c = '{\"base-reference\":\"My_Custom_Base_Reference__c\"}',
        cpm__Other_Output_Fields__c = '{\"reference-value\":\"My_Custom_Reference__c\"}',
        cpm__Status__c = 'Generating'
    );
    insert run;

Was this page helpful?