Transaction Data Mapping

This document details how donation transactions are mapped between WeGive and DonorPerfect, including one-time gifts, recurring donations, and tribute gifts.

DonorPerfect Table Reference

Primary Table: dpgift (Gift Records)
WeGive Model: Transaction
Sync Direction: WeGive → DonorPerfect (Push Only)

Core Transaction Fields

Primary Identifiers

WeGive FieldDonorPerfect FieldTypeNotes
dp_id@gift_idIntegerAuto-generated DonorPerfect gift ID
owner.dp_id@donor_idIntegerLinks to donor record
N/A@record_typeStringAlways set to ‘G’ (Gift)
N/A@user_idStringAlways set to ‘WeGive’
Relationship Mapping:
  • Each WeGive transaction creates one DonorPerfect gift record
  • Donor must exist in DonorPerfect before transaction sync
  • Automatic donor creation if donor doesn’t exist
  • Gift ID stored back in WeGive for future reference

Financial Information

Amount Processing

Critical: WeGive stores amounts in cents (integer), DonorPerfect uses dollars (decimal). Automatic conversion and fee handling applied.
WeGive FieldDonorPerfect FieldCalculationNotes
amount@amount(amount - fee) / 100Net donation amount in dollars
feeNot directly mappedUsed in calculationProcessing fee deducted
destination.currency@currencyDirect mappingCurrency code (e.g., ‘USD’)

Amount Calculation Examples

WeGive Transaction:
  • Amount: $100.00 (10000 cents)
  • Fee: $2.90 (290 cents)
DonorPerfect Gift:
  • Amount: $97.10 ((10000 - 290) / 100)
WeGive Transaction:
  • Amount: $100.00 (10000 cents)
  • Fee: $0.00 (0 cents, donor covered fee)
DonorPerfect Gift:
  • Amount: $100.00 ((10000 - 0) / 100)

Date and Timing

WeGive FieldDonorPerfect FieldFormatNotes
created_at@gift_dateMM/DD/YYYYTransaction processing date
Date Format: DonorPerfect requires MM/DD/YYYY format. Other formats will cause sync failures.

Fund and Campaign Attribution

Fund Designation

WeGive FieldDonorPerfect FieldTypeNotes
fund.dp_gl_code@gl_codeStringDonorPerfect GL code for fund
fund.nameNot directly mappedStringDescription in GL code table
Fund Setup Requirements:
  • WeGive funds must have associated DonorPerfect GL codes
  • GL codes must exist in DonorPerfect before transaction sync
  • Automatic GL code creation for new WeGive funds
  • Fund names sync to GL code descriptions

Gift Types and Classifications

Recurring Donation Handling

WeGive FieldDonorPerfect FieldValueNotes
scheduled_donation_id@pledge_payment’Y’ or ‘N''Y’ if part of recurring gift
Logic:
  • Regular donations: @pledge_payment = 'N'
  • Recurring donations: @pledge_payment = 'Y'
  • Links to pledge record in DonorPerfect
Process Flow:
  1. Scheduled donation creates pledge in DonorPerfect
  2. Individual payments reference pledge record
  3. Payment status tracked in both systems
  4. Pledge modifications sync automatically

Tribute and Memorial Gifts

WeGive FieldDonorPerfect FieldTypeMax LengthNotes
tribute_name@memory_honorString50In honor/memory of name
tribute_typeNot mappedString-Honor vs. memorial not distinguished
Mapping Rules:
  • Only tribute name syncs to DonorPerfect
  • Tribute type (honor vs. memorial) not distinguished
  • Empty tribute fields sync as null
  • Tribute notifications handled separately

Gift Narrative and Notes

Automatic Gift Description

WeGive FieldDonorPerfect FieldValueNotes
Generated@gift_narrative”Online gift through WeGive”Standard description
anonymous@gift_narrative”+ (Anonymous)“Added if anonymous gift
Regular Gift:
"Online gift through WeGive"
Anonymous Gift:
"Online gift through WeGive (Anonymous)"
Tribute Gift:
"Online gift through WeGive - In honor of [Name]"

Data Flow Process

Transaction Sync Workflow

1

Transaction Created

New donation processed in WeGive system
2

Donor Validation

Verify donor exists in DonorPerfect (create if needed)
3

Amount Calculation

Calculate net amount after fee deduction
4

Gift Record Creation

Create gift record in DonorPerfect dpgift table
5

ID Assignment

Store DonorPerfect gift ID back in WeGive

Error Handling

Transaction Sync Errors: Failed transactions are automatically retried with exponential backoff.
Error TypeCauseResolution
Invalid DonorDonor doesn’t exist in DonorPerfectAuto-create donor, retry transaction
Invalid GL CodeFund GL code not foundCreate GL code, retry transaction
Amount ValidationNegative or zero amountSkip transaction, log error
Date FormatInvalid date formatCorrect format, retry
API TimeoutDonorPerfect API unavailableRetry with backoff delay

API Operations

DonorPerfect Gift Creation

Required Parameters:
@gift_id (empty for new gifts)
@donor_id (required)
@record_type = 'G'
@gift_date (MM/DD/YYYY format)
@amount (decimal dollars)
@gl_code (must exist)
@user_id = 'WeGive'
Additional Fields:
@pledge_payment ('Y' or 'N')
@memory_honor (tribute name)
@gift_narrative (description)
@currency (currency code)

Query Operations

SQL Query Example:
SELECT gift_id, donor_id, gift_date, amount, gl_code
FROM dpgift 
WHERE user_id = 'WeGive'
  AND gift_date >= 'MM/DD/YYYY'
ORDER BY gift_id DESC

Sync Configuration

Transaction Sync Settings

Automatic Sync Events:
  • New transaction created in WeGive
  • Transaction status changes (completed, failed, refunded)
  • Recurring donation payment processed
  • Fund designation changes
Processing Schedule:
  • Real-time: New donations sync immediately
  • Batch Processing: Failed transactions retry every 15 minutes
  • Manual Sync: Available through dashboard
  • Error Recovery: Exponential backoff for failures

Performance Considerations

High Volume Processing

  • Batch processing for multiple transactions
  • Rate limiting to prevent API overload
  • Queue management for peak periods
  • Automatic retry for failed syncs

Error Recovery

  • Failed transactions automatically retry
  • Exponential backoff prevents system overload
  • Manual retry options in dashboard
  • Comprehensive error logging

Data Quality and Validation

Pre-Sync Validation

Validation Rules:
  • Donor ID must exist in DonorPerfect
  • Transaction amount must be positive
  • Fund GL code must be valid
  • Date must be in correct format
  • Currency code must be recognized
Automatic Corrections:
  • Date format standardization
  • Amount precision correction
  • GL code validation and creation
  • Donor profile auto-creation

Monitoring and Reporting

Dashboard Metrics:
  • Transaction sync success rate
  • Average sync processing time
  • Error rate and common failure types
  • Pending transaction queue status
Accuracy Verification:
  • Total amount comparisons
  • Fee calculation verification
  • Fund distribution accuracy
  • Currency conversion validation

Troubleshooting

Common Transaction Sync Issues

Possible Causes:
  • Transaction sync disabled in configuration
  • Donor missing from DonorPerfect
  • Invalid fund GL code
  • API authentication problems
Solutions:
  • Verify sync configuration enabled
  • Check donor sync status
  • Validate fund GL code setup
  • Test API credentials
Possible Causes:
  • Fee calculation errors
  • Currency conversion issues
  • Rounding precision problems
Solutions:
  • Review fee configuration
  • Check currency settings
  • Verify amount calculation logic
Possible Causes:
  • Tribute name exceeds field length
  • Special characters in tribute name
  • Tribute type not supported
Solutions:
  • Truncate long tribute names
  • Remove special characters
  • Use tribute name field only
For additional help with transaction data mapping, contact our support team at [email protected].