Changeup Cartridge for Salesforce B2C Commerce
News & UpdatesCompany
  • Welcome to ChangeUp
  • Salesforce B2C Commerce
    • Cartridge Overview
    • Cartridge Installation
      • Data Import
      • Code Integration
      • Cartridge Paths and Permissions
      • Staging to Production
    • Setup and Configuration
      • Site Preferences
        • API Key
        • Enable ChangeUp
        • Supersize Options
        • Product Page Donations
      • Configuration Dashboard
        • Donate-at-Checkout
          • Donation Types
          • Charity Search
          • Cart Settings
          • Supersize Donation
          • Customize Checkout Text
        • Product Page Donations
          • Charity Selection
          • Logo Hover State
          • Display Logos
          • Percentage of Product
          • Customize Text
        • Thank You Page
      • Donation Reporting
    • Testing
    • Other Notes
      • Failover
      • Dashboard Migration
      • Release Notes
  • RESOURCES
    • Security Practices
    • APIs
Powered by GitBook
On this page
  1. Salesforce B2C Commerce
  2. Setup and Configuration

Donation Reporting

ChangeUp requires donation data reporting after the order payment has been captured. For that, we have developed a job that will send order data to our API; below is an example of that job definition:

    <job job-id="ChangeUp" priority="0">
        <description>Calls the ChangeUp donation api and flags the order as imported into ChangeUp.</description>
        <parameters/>
        <flow>
            <context site-id="ChangeUp"/>
            <step step-id="ChangeUpExportOrders" type="ExecuteScriptModule" enforce-restart="false">
                <description/>
                <parameters>
                    <parameter name="ExecuteScriptModule.Module">bm_changeup/cartridge/controllers/ChangeUp.js</parameter>
                    <parameter name="ExecuteScriptModule.FunctionName">SendDonations</parameter>
                    <parameter name="ExecuteScriptModule.Transactional">true</parameter>
                </parameters>
            </step>
        </flow>
        <rules>
            <on-running runtime-threshold="60m" enabled="false">
                <mark-job-as-hanging/>
            </on-running>
        </rules>
        <triggers>
            <run-recurring enabled="false">
                <recurrence>
                    <date-from>2023-01-19Z</date-from>
                    <start-time>14:36:53.000Z</start-time>
                    <interval>12M</interval>
                    <day-of-week/>
                </recurrence>
            </run-recurring>
        </triggers>
    </job>

</jobs>

Commerce Cloud Injection

The merchant should point you to where they capture order payments in their code base. Within this code, you will need to construct an Object resembling the request example above from the orders being processed. To make the process more efficient, you could pre-flight a check on each order’s custom attribute changeupAgreedToDonate to see if it should be sent to the donation reporting code. After you have constructed the object, inject this line of code and pass the object to the constructor (data is the object in the example). The result can be used to throw errors or ensure the capture reporting is successful.

var result=require('~/cartridge/scripts/changeup/services/captureReporting')(data);
PreviousThank You PageNextTesting

Last updated 2 years ago