- 27 May 2024
- 2 Minutes to read
- Print
- DarkLight
Cybersource
- Updated on 27 May 2024
- 2 Minutes to read
- Print
- DarkLight
Learn how to enable and configure Cybersource . Cybersource is a single-platform, payment gateway solution.
To set up Cybersource, you must:
Enable the payment gateway
- From the application left navigation area, select Administration.
- From Master Data Management, select Setting Boolean.
- Select Enable Payment Gateway Integration.
- Set the Setting Value Boolean switch to YES.
Configure payment gateway
- Configure a new destination with the following parameters:
- Name—Name of the destination. Used in Commerce Administration Setup.
- Type—HTTP.
- Description—Optional. Leave blank.
- URL—For test purposes, use the following URL: https://sandbox.authorize.net/
- Proxy Type—Internet.
- Authentication—NoAuthentication.
- Enter the following properties:
- active—True or False. Determines whether or not the application is active.
- cybersource.accessKey—Generated value. See below.
- cybersource.algorithm—HmacSHA256
- cybersource.profileId—Generated value. See below.
- cybersource.secretKey—Generated value. See below.
- cybersource.url—https://testsecureacceptance.cybersource.com/pay
- isPaymentGateway—True or False.
Configure Cybersource access key
To request access, contact your Zilliant representative.
- In the Cybersource administration area, go to Secure Acceptance to create a profile.
- In Payment Settings, select settings as appropriate.
- In Security, create a new key and note the Secret Key. The pop-up expires in 30 seconds.
- Note down the Access Key and the Profile ID.
- Enter the three keys in Payment Gateway properties in SAP Cloud Platform Cockpit.
- Define Customer Response callbacks.
- (Optional.) Apply branding.
Passing parameters from Commerce to payment gateway
When the user is re-directed from the Review Order screen to payment gateway, parameters such as user / contact name, billing and shipping addresses, total amount, etc. are passed. For this, a Groovy script Payment Gateway Submission Params is available.
Sample code
import com.imc.iss.groovy.order.Order;
import com.imc.iss.groovy.GroovyCtxUtil;
import com.imc.vocabulary.Schema;
import com.imc.datamodel.BusinessObject;
def params = [:];
GroovyCtxUtil util = (GroovyCtxUtil) groovyCtxUtil;
BusinessObject orderBO = BusinessObject.create(order.getOrderURI());
BusinessObject contactBO = userInfo.getPersonBO();
// user data
params["bill_to_forename"] = util.getDataAttrStr(contactBO, Schema.personFirstName);
params["bill_to_surname"] = util.getDataAttrStr(contactBO, Schema.personLastName);
params["bill_to_email"] = util.getDataAttrStr(contactBO, Schema.personEmail);
params["ship_to_forename"] = util.getDataAttrStr(contactBO, Schema.personFirstName);
params["ship_to_surname"] = util.getDataAttrStr(contactBO, Schema.personLastName);
// billing address
BusinessObject billingAddressBO = util.getRelAttr(orderBO, Schema.orderBillTo);
if(billingAddressBO != null)
{
util.loadBO(billingAddressBO);
params["bill_to_address_line1"] = util.getDataAttrStr(billingAddressBO, Schema.addressStreet) + ' ' + util.getDataAttrStr(billingAddressBO, Schema.addressUnitNo);
params["bill_to_address_city"] = util.getDataAttrStr(billingAddressBO, Schema.addressCity);
BusinessObject billCountryBO = util.getRelAttr(billingAddressBO, Schema.hasCountry);
params["bill_to_address_country"] = util.getDataAttrStr(billCountryBO, Schema.objectExternalId);
}
// shipping address
BusinessObject shippingAddressBO = util.getRelAttr(orderBO, Schema.orderShipTo);
if(shippingAddressBO != null)
{
util.loadBO(shippingAddressBO);
params["ship_to_address_line1"] = util.getDataAttrStr(shippingAddressBO, Schema.addressStreet) + ' ' + util.getDataAttrStr(shippingAddressBO, Schema.addressUnitNo);
params["ship_to_address_city"] = util.getDataAttrStr(shippingAddressBO, Schema.addressCity);
BusinessObject shipCountryBO = util.getRelAttr(shippingAddressBO, Schema.hasCountry);
params["ship_to_address_country"] = util.getDataAttrStr(shipCountryBO, Schema.objectExternalId);
}
// TESTING
params["card_type"] = '002';
params["card_number"] = '5555555555554444';
params["card_expiry_date"] = '01-2030';
params["card_cvn"] = '123';
return params;
User experience when making direct payments
On the checkout and re-order screens, users can choose from two types of payments:
- Purchase order
- Direct payment
Direct payment
The user enters credit card details on the direct payment screen.
For testing purposes, use the following details:
- Card Type—Master Card
- Credit Card Number—5555 5555 5555 4444
- CVN—Any 3 digits
- Expiration Date—Any future date