Opportunity & Payment

The Opportunity & Payment mapping between WeGive and Salesforce is a fundamental component of the integration, enabling seamless synchronization of donation transactions and payment information between the two platforms. This mapping ensures that all aspects of donations, from basic transaction details to complex payment processing, are properly tracked and maintained across both systems.

Key Concepts

The integration between WeGive Transactions and Salesforce Opportunities/Payments is designed to provide a comprehensive solution for managing donation transactions. Understanding these key concepts is essential for effective implementation and usage.

Object Mapping

  • WeGive Transactions map to Salesforce Opportunities
  • WeGive Payments map to Salesforce Payments
  • Requires WeGive Managed Package installation
  • Bi-directional sync capabilities
  • Standard object integration

Managed Package Details

  • Standard object names:
    • Opportunity
    • npe01__OppPayment__c
  • Package source: WeGive Managed Package
  • Installation required for functionality
  • Custom fields included
  • Payment processing integration

Sync Behavior

  • Bi-directional synchronization
  • Real-time updates
  • Transaction tracking
  • Payment processing
  • Status monitoring

Dependencies

  • Donor synchronization
  • Campaign tracking
  • Fund allocation
  • Payment processing
  • Soft credit handling

Sync Process Overview

Payment-Level Synchronization

WeGive syncs primarily on the Payment object level in Salesforce, even though it represents WeGive Transactions as Opportunities and pulls data from the Opportunity record. This means that if a single Opportunity in Salesforce has multiple associated Payments, WeGive will pull each of those Payments in and represent them as separate, individual Transaction records in WeGive. WeGive pulls all the relationships like Campaign, Fund, Recurring Donation, Contact, and Account from the Opportunity, but it creates distinct Transaction records in WeGive for each Payment it finds.

Pulling Data from Salesforce

When pulling data from Salesforce, WeGive queries Payments where the npe01__Paid__c field is true and the last modified date on either the Payment itself or the associated Opportunity is within the specified time bounds. WeGive ignores Opportunities that are marked unpaid when pulling. The integration pulls data from both the Payment record (such as the Payment ID and Amount) and the associated Opportunity to get additional context, including the StageName, RecordTypeId, and relationship data.

Upon importing this data, WeGive attempts to find an existing WeGive Transaction record matching the Salesforce Payment ID. If an existing Transaction is found, it’s updated; if not, a new Transaction record is created in WeGive. The relationship data pulled from the Opportunity (like Contact ID, Account ID, Campaign ID, Recurring Donation ID, Pledge ID) is used to associate the WeGive Transaction with the correct donor, campaign, fund, recurring donation, and pledge records in WeGive.

Pushing Data to Salesforce

When a Transaction (donation) originates or is updated in WeGive and needs to be sent to Salesforce, WeGive compiles a payload specifically for the Salesforce Payment object. This payload includes default data as well as data based on user-defined mapping rules. Before pushing the Payment, WeGive ensures that necessary related records like the Donor, Campaign, and Fund exist in Salesforce.

For recurring transactions, WeGive attempts to match recurring donation transactions to open pledged installments in Salesforce to avoid duplicates. The mapping includes logic to hardcode the payment status as ‘true’ and Opportunity lead source as ‘Web’. WeGive will insert a new Payment or update an existing one in Salesforce, saving the Salesforce Payment ID back to WeGive.

Field Mappings

The field mappings between WeGive Transactions and Salesforce Opportunities/Payments are designed to ensure comprehensive data synchronization. These mappings cover all essential transaction and payment information, from basic details to complex processing rules.

Opportunity Field Mappings

Salesforce FieldWeGive FieldDirectionCreate OnlyDefault MappingNotes
NamenameBothYesYesUsed for naming the Opportunity record. Auto-generated or custom.
AmountamountBothNoYesDonation amount (converted from cents)
AccountIdowner.salesforce_account_idBothYesYesLinks the Opportunity to the Account (Household or Company) in Salesforce.
CloseDatecreated_atBothNoYesDate is formatted for Salesforce date fields and is based on the transaction date in WeGive (date initiated).
CampaignIdcampaign.salesforce_idBothNoYesLinks the Opportunity to the Campaign in Salesforce.
ContactIdowner.salesforce_idBothYesYesLinks the Opportunity to the Contact (Individual) in Salesforce.
npe03__Recurring_Donation__cscheduled_donation.salesforce_idBothYesYesLinks the Opportunity to the Recurring Donation in Salesforce.
StageNamestage_nameExportNoYesImported based on SF StageName. Exported based on WeGive Transaction status, mapped to SF StageName based on integration settings.
npe01__Do_Not_Automatically_Create_Payment__cTRUEExportYesYesHardcoded to true when creating a new Opportunity from WeGive to prevent Salesforce from auto-creating payments.
TypeDerived from WeGive TransactionExportNoNo’Recurring’ if scheduled_donation_id exists, else ‘One-Time’
LeadSource'Web'ExportYesYesHardcoded value applied during insert.
npsp__Tribute_Type__cDerived from WeGive TransactionExportYesNo’Honor’ if tribute exists
npsp__Honoree_Name__ctribute_nameExportYesNoPopulated if the transaction is a tribute gift in WeGive.
is_tax_deductibleis_tax_deductibleBothNoNoPulled during import based on the Salesforce Opportunity RecordTypeId matching configured ‘service revenue’ types.
hiddenhiddenBothNoNoPulled during import based on the Salesforce Opportunity RecordTypeId matching configured ‘hidden’ types.

Payment Field Mappings

Salesforce FieldWeGive FieldDirectionCreate OnlyDefault MappingNotes
npe01__Payment_Date__ccreated_atBothNoYesDate is formatted for Salesforce date fields.
npe01__Payment_Method__csource_typeBothNoYesMapped based on WeGive’s internal payment method type.
npe01__Paid__cTRUEExportNoYesHardcoded to true when pushing payments to Salesforce.
npe01__Payment_Amount__camountBothNoYesDonation amount
npe01__Opportunity__csalesforce_idExportYesYesLinks the Payment to the Opportunity. Omitted during updates.
npsp__Batch_Number__cpayout_idExportNoYesMay be omitted in legacy integrations.
npsp__Gateway_Payment_ID__cidExportYesYesMay be omitted in legacy integrations.
npsp__Total_Transaction_Fees__cfee_amountExportYesYesMay be omitted in legacy integrations.
npsp__Donor_Cover_Amount__cDerived from WeGive TransactionExportNoNoCalculated based on whether the donor covered fees. May be omitted in legacy integrations.

Payment Method Mappings

WeGive TypeSalesforce Value
cardCredit Card
bankACH
paypalPayPal
checkCheck
cashCash

Stage Name Mappings

WeGive StatusSalesforce Stage
SUCCESS/PROCESSINGConfigurable (stage_success)
PENDINGConfigurable (stage_pending)
REFUNDEDConfigurable (stage_refunded)
FAILEDConfigurable (stage_failed)

Important Notes

Understanding these important aspects of the Opportunity & Payment integration is crucial for successful implementation and ongoing management.

Package Requirements

  • WeGive Managed Package must be installed
  • Standard objects must be configured
  • Field-level security must be set
  • User permissions must be configured
  • Payment processing must be enabled

Sync Behavior

  • Real-time synchronization
  • Bi-directional updates
  • Transaction tracking
  • Payment processing
  • Status monitoring

Field Considerations

  • Required fields must be mapped
  • Custom fields can be added
  • Field types must match
  • Validation rules apply
  • Default values supported

Best Practices

Following these best practices will help ensure a smooth and successful Opportunity & Payment integration:

Data Management

  • Regular data validation
  • Monitor sync status
  • Check for duplicates
  • Verify field mappings
  • Review error logs

Integration Configuration

  • Test in sandbox first
  • Verify permissions
  • Check field security
  • Monitor performance
  • Regular maintenance

Troubleshooting

  • Check sync logs
  • Verify connections
  • Review error messages
  • Test field mappings
  • Contact support if needed

Common Scenarios

Understanding these common scenarios will help you effectively manage Opportunities and Payments across both platforms:

New Transaction Creation

  1. Create transaction in WeGive
  2. Sync to Salesforce
  3. Process payment
  4. Update status
  5. Monitor sync status

Payment Processing

  1. Process payment
  2. Update transaction
  3. Track status
  4. Monitor sync
  5. Handle updates

Transaction Updates

  1. Modify transaction details
  2. Update payment info
  3. Change status
  4. Adjust amounts
  5. Sync changes

The Opportunity & Payment integration provides a robust solution for managing donation transactions across both WeGive and Salesforce, ensuring that all transaction-related data is properly synchronized and maintained.