/
Website Integration: One-Off Payment (Payment Intent)

Website Integration: One-Off Payment (Payment Intent)

This is a general scenario of one-off payment when a user submits the website form, creates and confirms Payment Intent on Stripe.

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

Salesforce Flow Handler manages 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.

  • Opportunity

    • Name: Donation - should be renamed by NPSP Opportunity naming

    • Record Type: Donation (npsp_plus_dres namespace)

    • StageName: paymentIntent.status == 'succeeded' ? 'Closed Won' : 'Closed Lost'

    • Amount: paymentIntent.amount

    • CloseDate: paymentIntent.created

    • npsp__Primary_Contact__c: the contact created from metadata

    • Account: the organisation created from metadata, otherwise a Contact.Account i.e. Household that managed by NPSP.

    • CampaignId: Campaign record provided above OR NULL

    • metadata.donation is used to map Opportunity details. Any standard or custom filed can be mapped excluding the general fields described above populated from Payment Intent.

    • Any field can be populated on Opportunity passing the API name and value.

  • Payment

    • npe01__Paid__c: Opportunity.StageName == Closed Won

    • npe01__Payment_Date__c: Opportunity.ClosedDate

    • npsp_plus__Gateway_Transaction_ID__c: paymentIntent.id

    • npe01__Payment_Method__c: Credit Card

    • metadata.payment is used to map Payment details. Any standard or custom filed can be mapped excluding the general fields described above that populated from Payment Intent.

 

Example

Example of Stripe Payment Intent creation request (NodeJS):

const paymentIntent = await stripe.paymentIntents.create({ amount: 2000, currency: 'aud', payment_method_types: ['card'], metadata: { 'npsp_plus_contact': '{"FirstName":"Stephen","LastName":"Kent","Email":"developer+sk@vertic.com.au","MailingStreet":"test","MailingCity":"test","Birthdate":"1990-10-22"}' 'npsp_plus_organisation': '{"Name":"Vertic"}', 'npsp_plus_donation': '{"LeadSource":"Web"}', 'npsp_plus_payment': '{}', 'npsp_plus_campaign': '{"Name":"Web Donations"}' } });

 

Related content

Website Integration: Recurring Donation (Subscription)
Website Integration: Recurring Donation (Subscription)
More like this
Technical Website Integration Architecture
Technical Website Integration Architecture
More like this
Creating a Recurring Donation
Creating a Recurring Donation
Read with this
NPSP+ Settings
NPSP+ Settings
More like this
Creating a One-Off Donation
Creating a One-Off Donation
Read with this
Single Donation Payment Processing
Single Donation Payment Processing
More like this