Step 3: Register external services
Learn how to register external services.
Register external services for Tax Calculation and Payment Services. You can run these scripts from the Developer Console in an Execute Anonymous window or by the method you choose when registering other services as part of the site setup before starting the connector setup.
Important: The Digital River connector currently only supports a Tax Type of Net. Ensure the tax type is set to Net BEFORE activating your store, as you cannot change it afterward.
Tax integration service
If you have not registered the external service for tax integration:
Use the following script to insert the Tax Calculation Apex class that comes with the package into
RegisteredExternalService
. To use the script, modify the<<storeName>>
variable before running.Verify that the
Tax Calculation Apex class ID
is registered with thesoql
query below. TheExternalServiceProviderId
should match the Tax Calculation Apex ClassDRB2B_CartTaxCalculations
ID in the org.Link the newly registered tax integration to the storefront. From the store’s Administration menu, select Tax Calculation. Under Integration, link the newly registered
DR_COMPUTE_TAXES
or whatever name you gave the integration in the script in step 2.
If you have already registered the external service for tax integration:
Run the following script to update the Tax Integration service to point to the Tax Calculation integration class from the Salesforce Lightning app.
Verify that the
Tax Calculation Apex class ID
is registered by making the belowsoql
query. TheExternalServiceProviderId
should match the Tax Calculation Apex ClassDRB2B_CartTaxCalculations
ID in the org.Link the newly registered tax integration to the storefront. From the store’s Administration menu, select Tax Calculation. Under Integration, link the newly registered
DR_COMPUTE_TAXES
or whatever name you gave the integration in the script in step 2.
Payment service
Use the following steps to create the Payment Gateway:
Capture the
WebStore Id
. This will be used in the script in step 4.From the Named Credential menu, choose the New Legacy option. Create a Named Credential for Digital River with the following details:
Label: Digital River API
Name: Digital_River_API
URL: https://api.digitalriver.com
Identity Type: Named Principal
Authentication Protocol: No Authentication
Create a Payment Gateway Provider:
Sign in to Workbench from your commerce org.
Go to the Data tab and select Insert.
Go to the Object Type and select PaymentGatewayProvider.
Select Single Record and click Next.
Fill in the fields using your Payment Gateway Adapter information.
Field nameExampleApexAdapterId
ID of Payment Gateway Adapter Apex class
DRB2B_PaymentGatewayAdapter
DeveloperName
DR_PaymentGateway
IdempotencySupported
Yes
MasterLabel
DR Payment Gateway
Comments
Digital River Payment Gateway Provider
Set up Payment Gateway and insert a
StoreIntegratedService
record for payment by executing the below script. Be sure to update theWebstoreID
to the one captured in step 1 of this section.
Last updated