/
Website Integration: Recurring Donation (Subscription)

Website Integration: Recurring Donation (Subscription)

This is a general scenario of recurring payment when a user submits the website form, creates Subscription on Stripe.

Stripe sends customer.subscription.created webhook handled by npsp+.

Metadata

The metadata attached to Stripe request in JSON format allows passing data for records creation in Salesforce. Please see the supported metadata keys:


Salesforce Flow

Flow Handler should manage the following records:

  • Contact

    • metadata.contact is used to map Contact details (any standard or custom field can be mapped)

    • LastName is mandatory

    • Deduplicate using SF active matching rules (dup rule should bypass sharings)

  • Organisation

    • metadata.organisation is used to map Organisation details (any standard or custom field can be mapped)

    • Name is mandatory. Otherwise, Account creation is skipped.

    • Deduplicate using SF active matching rules (dup rule should bypass sharings)

  • Campaign

    • metadata.campaign is used to map Campaign details. Any standard or custom filed can be mapped.

    • if no metadata.campaign or no metadata.campaign.name provided then Campaign is skipped

    • The flow will be trying to find an existing Campaign by Name (metadata.campaign.name). Otherwise, a new record will be created.

  • Recurring Donation

    • Name: Recurring Donation - should be renamed by NPSP RD naming

    • Status: subscription.status

      • 'active' = 'Active'

      • 'trialling' = 'Active' Paused is much better BUT we’re not able to add picklist options to managed package. The RD.Status field is also restricted.

    • Amount: subscription.items.data[0].price.unit_amount * subscription.items.data[0].quantity

    • npe03__Date_Established__c: subscription.start_date

    • npsp__StartDate__c: subscription.billing_cycle_anchor

    • npsp__EndDate__c: subscription.cancel_at

    • npe03__Next_Payment_Date__c: ??

    • npe03__Installment_Period__c: subscription.items.data[0].price.recurring.interval

      • day => Daily

      • week => Weekly

      • month => Monthly

      • year => Yearly

    • npsp__InstallmentFrequency__c: subscription.items.data[0].price.recurring.interval_count

    • npe03__Contact__c: the contact created from metadata

    • npe03__Organization__c: the organisation created from metadata

    • npe03__Recurring_Donation_Campaign__c: Campaign record provided above OR NULL

    • Stripe_Subscription__c: subscription.id

    • npsp__PaymentMethod__c: Credit Card

    • metadata.recurringDonation is used to map Recurring Donation details. Any standard or custom filed can be mapped excluding the general fields described above populated from Subscription.

Related content

Website Integration: One-Off Payment (Payment Intent)
Website Integration: One-Off Payment (Payment Intent)
More like this
Creating a Stripe Subscription
Creating a Stripe Subscription
More like this