Cybersource
  • 27 May 2024
  • 2 Minutes to read
  • Dark
    Light

Cybersource

  • Dark
    Light

Article summary

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

  1. From the application left navigation area, select Administration.
  2. From Master Data Management, select Setting Boolean.
  3. Select Enable Payment Gateway Integration.
  4. Set the Setting Value Boolean switch to YES.

Configure payment gateway

  1. 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.
  1. 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

Note

To request access, contact your Zilliant representative.

  1. In the Cybersource administration area, go to Secure Acceptance to create a profile.
  2. In Payment Settings, select settings as appropriate.
  3. In Security, create a new key and note the Secret Key. The pop-up expires in 30 seconds.
  4. Note down the Access Key and the Profile ID.
  5. Enter the three keys in Payment Gateway properties in SAP Cloud Platform Cockpit.
  6. Define Customer Response callbacks.
  7. (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.

Direct payment

Tip

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

Was this article helpful?

What's Next
Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.