Relationship Settings give you better control over Lead, Contact, and Account matching and creation. With this feature, you can define which records should be matched and created when a Payment Gateway Customer is created.
Before You Start
The following notes are important to review before you start.
- Matching criteria are based on Matching and Duplication rules specified in Setup. The Account, Contact, and Lead objects are compared to either find a match or create a new record.
- Matching and Duplication rules are required for the Relationship Settings "Create New Record If No Match" and "Only Relate a Matched Record" options.
- We recommend using the Standard Salesforce Matching and Duplication rules for Accounts, Contacts, and Leads. If you do not enable the Standard Salesforce Matching and Duplication rules, the Relationship Settings will not know which items to match when creating a new record.
How Does It Work?
The Relationship Settings field is located on the Payment Gateway object. This field controls how Payment Gateway Customers, Accounts, Contacts, and Leads are created on a Payment Gateway. To allow for a variety of scenarios, the Relationship Settings field can be defined differently for each Payment Gateway your organization uses.
Relationship Settings records define the matching and/or creation preferences for your org.
The logic starts with the Payment Gateway Customer and rolls down to the customer’s Payment Method. The following steps show the order of execution.
- The new Payment Gateway Customer (PGC) record is added to Salesforce via API and webhooks.
- The PGC record is compared to your active duplicate rules in conjunction with your Relationship Settings. (Duplicate rules determine what is or isn’t a match.)
- The Relationship Settings determine how to match existing Accounts, Contacts, and Leads to the PGC record.
- If your settings are configured to do so, a new Account, Contact, and Lead record will be created.
Users upgrading Payments will need to manually deactivate the current “Payment Gateway Customer Dup Rule” matching rule and activate the new Payment_Gateway_Customer_Matching_Rule2 matching rule. The new matching rule will be installed automatically for new installations.
Configure Your Relationship Settings
- Click the App Launcher.
- Type and click “Relationship Settings”.
- Click New in the top-right-hand corner of the page.

- Enter a Name. (required)
- Select a Relationship Rule.
- “Only Relate A Matched Record”: This setting updates existing records. It doesn’t create new records.
- “Create New Record If No Match”: This setting creates a record if a match isn’t detected.
- “Always Create A New Record”: This setting ignores duplication rules and creates a new record even if an existing record already exists.
- “No Matching Or Record Creation”: This setting prevents matching and the creation of new records.
- Define a Create Rule. This field selects the type of related record to be created.
- Select an Account, Contact, or Lead record type, if using.
- Click Save.

Example
- Set Relationship Rule = "Create a record if no match".

- Set Create Rule = "Lead".
- Create a customer in Stripe.
- Wait for webhooks to process. Or manually process webhooks by navigating to your Payment Gateway, clicking Sync with Stripe, and clicking Sync Customers.
Once the sync is finished, your new Lead record and Payment Gateway Customer will be generated in Salesforce.

Additional Fields for Matching Logic Variations
Match Records
Some scenarios do not require matching on all three objects: Accounts, Contacts, and Leads. The Match Records field is a multi-select picklist that allows users to select which object they want to use for matching.
If you leave the Match Records field blank and don't have active duplicate rules for Lead, Contact, and Account, you will receive an error in the Blackthorn Logs. Additionally, if this field is blank your current matching logic will not continue to find matches.
Match All Email Fields
If the Match All Email Fields field is checked, the duplication logic will look for all email fields from the object selected in the Match Records field and execute matching criteria based on the matching rules in Settings.

Use Case
Let's say you want to match the Email field on a new Payment Gateway Customer to a custom field named Work Email on the Contact object.
- Create a matching and duplication rule from Setup for the Work Email field on the Contact object.
- Add your Relationship Settings to your Payment Gateway record.
- Set Match Records so “Contact” is one of the values selected.
- Check the Match All Email Fields checkbox.
- Create a Contact record with Work Email populated.
- Create a Payment Gateway Customer with the same value that was used for the Contact Work Email field.
- After clicking Save, notice the existing Contact record is populated in the Contact lookup on Payment Gateway Customer.