Salesforce
Installation
Prerequisites
- Supported SFRA Version: 6.0 ~ 6.3
- Node.js: v12.21.0 is recommended by SFRA. You can use nvm.io to install specific Node version.
Setup SFRA Base Dependency
-
Download SFRA base: Follow the instruction and download the SFRA base repository
-
Unzip the SFRA base package to
../storefront-reference-architecture-master
to match the base path defined inpackage.json
file.
Compile
-
Run
npm install; npm run compile:js; npm run compile:scss
in the SFRA base path. -
Run
npm install; npm run compile:js; npm run compile:scss
in the Smartpay cartridge path.
Upload
Use your preferred tool to upload the compiled cartridge to your SFCC server.
Here's example steps of uploading the cartridge using VSCode & Prophet Debugger Extension.
-
Install Prophet Debugger Extensions: Open VS Code and install the Prophet Debugger from the marketplace.
-
Configuration: Create these files at the
.vscode
folder of your project. Populate it with your sandbox credentials and settings..vscode/launch.json
{ "version": "0.2.0", "configurations": [ { "type": "prophet", "request": "launch", "name": "Attach to Sandbox" } ] }
.vscode/dw.json
-
Upload the Cartridges: Run
Prophet: Clean project/Upload All
.
Business Manager Configurations
For the Smartpay integration to work, the following needs to be configured in the Business manager.
Activating the cartridge in Business Manager
Before Smartpay becomes available for your shoppers, the cartridges have to be added to the cartridge path of the Site. In order to do this, follow the following instructions:
- Log into Business Manager.
- Navigate to
Administration > Sites > Manage Sites
. - Click on the site name and on the next page go to the
Settings
tab. - In the
Cartridges
input field addint_smartpay_sfra:int_smartpay_core:bc_smartpay:
in front of the base cartridge path. - Click on the
Apply
button. - To activate the cartridge for the Sandbox/Development/Production instances repeat steps 4 and 5 after selecting the appropriate instance from the
Instance Type
dropdown menu. - Repeat steps 3 to 6 for each site that is to use Smartpay.
- Go to
Manage the Business Manager site
. - In the
Cartridges
input field prependbm_smartpay:int_smartpay_core:
. - Click on the
Apply
button.
Enable Cartridge Module
To enable the Cartridge module
- Go to
Administration > Organization > Roles & Permissions
. - Click on
Administrator
and click on theBusiness Manager Modules
tab. - In the Select Context dialog, check your site ID checkbox and click the
Apply
button. - Find Smartpay and check the checkbox to enable it.
- Click on the
Update
button.
Importing Metadata
For the Smartpay integration to work, the following object structures (metadata) needs to be imported and configured in the Business manager.
- In the cartridge bundle find
metadata/ smartpay-meta-import/sites/RefArch
folder.
- Rename this
RefArch
folder to the ID of your site. If you have multiple sites to which these meta has to be imported, then copy and paste thisRefArch
folder to replicate for other sites. Renames those folders with ID of corresponding sites. - Modify
context site-id
value of thejobs.xml
file to your site ID. - In the cartridge bundle, inside
metadata
folder, compress smartpay-meta-import folder to generatesmartpay-meta-import.zip
file. - Go to
Business Manager Menu > Administration > Site Development > Site Import & Export
- Under
Import > Upload Archive
ensure that theLocal
radio button is enabled. - Click on the Choose File input field, select the
smartpay-meta-import.zip
file you just created and click on theupload
button. - After finishing the upload, from the Archives list click the radio button corresponding to
smartpay-meta-import.zip
and click on theImport
button. - Click on the
OK
button of the confirmation box asking, Are you sure that you want to import the selected archive?
After the successful metadata import, the following attributes should have been created:
Custom Site Preferences
In Business Manager, navigate to the Merchant Tools > Site Preferences > Custom Preferences. Custom site preference groups with the ID Smartpay Settings
will be available.
Please select it and edit the attributes according to your Smartpay account data.
For each site, set the values for your site preferences.
- Is Smartpay Enabled (ID: isSmartpayEnabled, Type: Boolean) – Enable and disable Smartpay and its functionality in a single point.
- Api Secret (ID: smartpayApiSecret, Type: String) – Api secret of Smartpay.
- Payment Mode (ID: smartpayCaptureMethod, Type: Enum of Strings) – Select transaction type.
- Minimum Checkout Value (ID: smartpayMinPrice, Type: String) – Set minimum amount of order in order to select Smartpay.
- Maximum Checkout Value (ID: smartpayMaxPrice, Type: String) – Set maximum amount of order in order to select Smartpay.
- Orders Created Time(ID: smartpayOrdersCreatedTime, Type: String) – Find the orders behind this given time. Set time in minutes.
Payment Methods
Under Merchant Tools > Ordering > Payment Methods, check that payment method with ID ‘SMARTPAY’ is created.
Payment Processor
Under Merchant Tools > Ordering > Payment Processors, check that payment processors with ID ‘SMARTPAY’ is created.
HTTP Services
Under Administration > Operations > Services, check that service with ID ‘smartpay.http.generic is created.
Jobs
Under Administration > Operations > Jobs, check that job with ID ‘SmartpayPlaceOrder’ is created.
Updated 5 months ago