100% found this document useful (1 vote)
317 views

Addon Integration Module

The document summarizes the SAP Digital Payments Add-On integration module for SAP Commerce. It allows adding and deleting payment cards, managing card payments through SAP Digital Payments, and ensuring data privacy. The integration uses REST API calls between SAP Commerce and SAP Digital Payments Add-On for payment processing and is implemented through extensions in SAP Commerce.

Uploaded by

Rajib Bose
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
317 views

Addon Integration Module

The document summarizes the SAP Digital Payments Add-On integration module for SAP Commerce. It allows adding and deleting payment cards, managing card payments through SAP Digital Payments, and ensuring data privacy. The integration uses REST API calls between SAP Commerce and SAP Digital Payments Add-On for payment processing and is implemented through extensions in SAP Commerce.

Uploaded by

Rajib Bose
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

3/5/2020

Integrations and Data Management


Generated on: 2020-03-05

SAP Commerce | 1905

PUBLIC

Original content: https://help.sap.com/viewer/50c996852b32456c96d3161a95544cdb/1905/en-US

Warning

This document has been generated from the SAP Help Portal and is an incomplete version of the official SAP product
documentation. The information included in custom documentation may not re ect the arrangement of topics in the SAP Help
Portal, and may be missing important aspects and/or correlations to other topics. For this reason, it is not for productive use.

For more information, please visit the https://help.sap.com/viewer/disclaimer.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=699f7c158b70473aa86a4c88a4c… 1/19
3/5/2020

SAP Digital Payments Add-On Integration


Module
SAP digital payments add-on integration is an out-of-the-box alternative to current custom payment service provider (PSP)
integrations. This integration uses SAP digital payments add-on with ready-to-use PSP connectivity.

Features Architecture Implementation

Adding and Deleting


Cards SAP Digital Payments Add-On Integration SAP Digital Payments Add-On Integration
Architecture Implementation
Managing Card
Payments

SAP Digital Payments Add-On Integration


Features
SAP digital payments add-on integration is an out-of-the-box alternative to current custom payment service provider (PSP)
integrations. This integration uses SAP digital payments add-on with ready-to-use PSP connectivity.

Overview
During an item checkout, the payment can be made using a credit card. By integrating SAP Commerce with SAP digital payments
add-on, the user will have the option to register a card using SAP digital payments add-on and SAP Commerce will use the
tokenized card information to make the payment during order placement.

The integration is implemented using REST API calls. OAuth authentication is used to authorize the API calls.

The process ow involves the following steps:

1. Customer requests the registration of a new credit card.

2. The request is sent to SAP digital payments add-on which determines the relevant Payment Service Provider (PSP).

3. SAP digital payments add-on sends a session ID and the URL for credit card registration to SAP Commerce.

4. The customer enters the credit card data in the credit card registration screen that is hosted by SAP digital payments add-
on.

5. SAP Commerce receives a tokenized reference to the credit card from the add-on.

6. SAP Commerce uses the tokenized card information to fetch the credit card data from SAP digital payments add-on, and
stores the data.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=699f7c158b70473aa86a4c88a4c… 2/19
3/5/2020
This stored card data can be used to make payment authorization calls. In case if you have a different system to make
payment authorization call, you can bypass SAP digital payments add-on authorization call.

During the order process, SAP Commerce sends a payment capture request to SAP digital payments add-on to capture the
payment. Also for the return process, a refund request is triggered from SAP Commerce to the add-on.

While deleting the card details from the Payment Details page of the customer, it is deleted both from SAP digital payments add-
on and SAP Commerce simultaneously.

For information about the supported payment service providers, refer the documentation for
https://help.sap.com/viewer/p/DIGITALPAYMENTS

The features of SAP Digital Payments integration include:

Adding and Deleting Cards


A customer can register a new credit card during order checkout, and use this registered card information for making
payment. The customer can also delete an existing credit card from SAP Commerce.
Managing Card Payments
During the order process ow, a request is sent to SAP digital payments add-on to capture the payment details.
Data Privacy Management
Data privacy mechanisms for SAP digital payments add-on integration ensure that customers' personal data is handled
appropriately.

Adding and Deleting Cards


A customer can register a new credit card during order checkout, and use this registered card information for making payment.
The customer can also delete an existing credit card from SAP Commerce.

As part of order checkout, when a customer clicks the Add New Card button, the customer is redirected to the SAP digital
payments add-on screen in a new tab, to register the card details. The customer enters the card details in the screen and clicks the
Submit button.

A polling process is triggered at the same time to fetch the registered card details from SAP digital payments add-on. Once the
card details are successfully retrieved, these details are added to customer and cart.

You can see the newly added card details inSAP Commerce under My Account Payment Details .

Deleting an Existing Credit Card


To delete an existing credit card, go toMy Account Payment Details and choose the credit card that you want to delete. A request
is sent to SAP digital payments add-on to delete the card details. Once the deletion is successful, the card is removed from SAP
Commerce customer account. If the card deletion is unsuccessful, an error message is displayed to the customer and the card
details are retained for the customer account.

Managing Card Payments


During the order process ow, a request is sent to SAP digital payments add-on to capture the payment details.

Once the user places an order, an authorization call is made to SAP digital payments add-on to authorize the card payment.
During the payment capture process, a request is sent to SAP digital payments add-on to capture the payment.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=699f7c158b70473aa86a4c88a4c… 3/19
3/5/2020

Payment Refunds
When the customer places a refund request to trigger the refund process, a request is sent to SAP digital payments add-on to
capture the refund.

Data Privacy Management


Data privacy mechanisms for SAP digital payments add-on integration ensure that customers' personal data is handled
appropriately.

Personal Data Erasure


The tokenized payment card related information is stored in SAP Commerce. Once the user requests to erase the personal data, a
delete API request is sent to SAP digital payments add-on. The cissapdigitalpayment extension contains the erasure
mechanism to delete the payment card details.

Data Type Erasure Mechanism

Credit card Payment Info Created a class which implements ItemCleanUpHook and added
the bean to the itemCleanupHooks of
AbstractExtensibleRemoveCleanupAction

In Backoffice Administration Cockpit, go to System Background Processes CronJobs , and search for
customersWithoutOrdersRetentionCronJob and trigger the same.

If cissapdigitalpayment extension is included in the build, the


CisSapDigitalPaymentCustomerCleanupHook gets enabled.

The cleanupRelatedObjects method creates the delete card request list and sends it to SAP digital payments add-
on via deleteCard method in CisSapDigitalPaymentService.

To send the delete card request even before removing it from the SAP Commerce, the
cisSapDigitalPaymentCustomerCleanupHook bean is placed before
commerceServicesCustomerCleanupHook bean in the itemCleanupHooks of
AbstractExtensibleRemoveCleanupAction.

DefaultSapDigitalPaymentConfigurationStrategy is implemented to select the


SAPDigitalPaymentConfigurationModel required to run the clean up task. This strategy currently selects the rst
SAPDigitalPaymentConfigurationModel returned from the back-end and can be overridden by custom
implementations.

SAP Digital Payments Add-On Integration


Architecture
SAP digital payments add-on integration is an out-of-the-box alternative to current custom payment service provider (PSP)
integrations. This integration uses SAP digital payments add-on with ready-to-use PSP connectivity.

Dependencies
The module structure along with the dependencies looks as follows:

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=699f7c158b70473aa86a4c88a4c… 4/19
3/5/2020

Recipes
The following recipe contains the SAP digital payments add-on integration module:

b2c_b2b_acc_dp

Extensions
The integration with SAP digital payments add-on abstracts the complexity of creating PSP (Payment Service Provider) speci c
request during payment card registration, subscription creation, and payment authorization. This integration uses HOP (Hosted
Order Page) payment integration strategy. SAP digital payments add-on exposes RESTful Web services which are consumed from
SAP Commerce.

The SAP digital payments add-on integration module consists of the following extensions:

sapdigitalpaymentaddon Extension
The sapdigitalpaymentaddon extension is responsible for modifying the checkout ow for SAP Commerce
integration with SAP digital payments add-on.
sapdigitalpaymentb2baddon Extension
The sapdigitalpaymentb2baddon extension is responsible for modifying the B2B checkout ow for SAP Commerce
integration with SAP digital payments add-on.
cissapdigitalpayment Extension
The cissapdigitalpayment extension is responsible for providing the core functionalities for integration between
SAP Commerce and SAP digital payments add-on.
sapdigitalpaymentbackoffice Extension
The sapdigitalpaymentbackoffice extension is responsible for providing the Backoffice con gurations for SAP
Commerce integration with SAP digital payments add-on.
ysapdpordermanagement Extension
The ysapdpordermanagement extension is responsible for modifying the order process and return order process for
SAP Commerce integration with SAP digital payments add-on.

sapdigitalpaymentaddon Extension
The sapdigitalpaymentaddon extension is responsible for modifying the checkout ow for SAP Commerce integration with
SAP digital payments add-on.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=699f7c158b70473aa86a4c88a4c… 5/19
3/5/2020

General
The sapdigitalpaymentaddon extension consists of the controller classes, validators, jsp les and the web-spring.xml
le. This extension overrides some of the beans de ned in the yacceleratorstorefront extension.

Modify Checkout Flow


The defaultCheckoutGroup and responsiveCheckoutGroup beans are aliased and are overridden in this extension. In
the checkoutStepMap property, a new entry has been made.

<entry key="payment-billing-method" value-ref="responsivePaymentBillingMethodCheckoutStep"/>


<alias name="defaultSapDigitalPaymentResponsivePaymentBillingMethodCheckoutStep" alias="responsivePaym
<bean id="defaultSapDigitalPaymentResponsivePaymentBillingMethodCheckoutStep" parent="checkou
<property name="checkoutGroup" ref="responsiveCheckoutGroup"/>
<property name="checkoutStepValidator" ref="defaultSapDigitalResponsivePaymentBillingM
<property name="transitions">
<map merge="true">
<entry key="previous" value-ref="REDIRECT_TO_DELIVERY_METHOD"/>
<entry key="current" value-ref="REDIRECT_TO_PAYMENT_BILLING_METHOD"/>
<entry key="next" value-ref="REDIRECT_TO_SUMMARY"/>
</map>
</property>
<property name="progressBarId" value="paymentBillingMethod"/>
</bean>

Corresponding entries have been made in the validationResultsMap property as well.

<entry key="REDIRECT_TO_PAYMENT_BILLING_METHOD" value-ref="REDIRECT_TO_PAYMENT_BILLING_METHOD"/>


<bean id="REDIRECT_TO_PAYMENT_BILLING_METHOD" class="java.lang.String">
<constructor-arg value="redirect:/checkout/multi/sap-digital-payment/billing-address/a
</bean>

Once the checkout ow is modi ed, the Payment and Billing Address screen will have the modi ed UI.

Registering a New Credit Card


A customer can register a new credit card during order checkout, and use this registered card information for making payment.

SAP Commerce integration with SAP digital payments add-on uses HOP (Hosted Order Page) PCI payment strategy. Override the
following property in the local.properties le.

site.pci.strategy=HOP

Related Information
yacceleratorstorefront Extension

sapdigitalpaymentb2baddon Extension
The sapdigitalpaymentb2baddon extension is responsible for modifying the B2B checkout ow for SAP Commerce
integration with SAP digital payments add-on.

General

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=699f7c158b70473aa86a4c88a4c… 6/19
3/5/2020
The sapdigitalpaymentb2baddon extension consists of the controller classes, validators, jsp les and the web-
spring.xml le. This extension overrides some of the beans de ned in the b2bacceleratoraddon extension and is
dependent on sapdigitalpaymentaddon extension for all B2C and B2B common functionalities.

Modify Checkout Flow


The b2bCheckoutGroup and b2bPaymentMethodCheckoutStep beans are aliased and are overridden in this extension. In
the checkoutStepMap property, a new entry has been made.

<entry key="payment-billing-method" value-ref="b2bPaymentMethodCheckoutStep"/>

<alias name="defaultB2bPaymentMethodCheckoutStep" alias="b2bPaymentMethodCheckoutStep" />


<bean id="defaultB2bPaymentMethodCheckoutStep" class="de.hybris.platform.b2bacceleratoraddon.c
<property name="checkoutGroup" ref="b2bCheckoutGroup"/>
<property name="checkoutStepValidator" ref="defaultSapDigitalPaymentBillingMethodCheck
<property name="checkoutFacade" ref="b2bCheckoutFacade" />
<property name="transitions">
<map merge="true">
<entry key="previous" value-ref="REDIRECT_TO_DELIVERY_METHOD"/>
<entry key="current" value-ref="REDIRECT_TO_PAYMENT_BILLING_METHOD"/>
<entry key="next" value-ref="REDIRECT_TO_SUMMARY"/>
</map>
</property>
<property name="progressBarId" value="paymentMethod"/>
</bean>

Related Information
yacceleratorstorefront Extension

cissapdigitalpayment Extension
The cissapdigitalpayment extension is responsible for providing the core functionalities for integration between SAP
Commerce and SAP digital payments add-on.

General
The cissapdigitalpayment extension consists of facades, services, strategies, clients and so on to connect to SAP digital
payments add-on. This extension has dependencies on the following:

cispayment AddOn

cisclient Extension

commerceservices Extension

acceleratorfacades Extension

commercefacades Extension

payment Extension

Prerequisites
A valid subscription to SAP digital payments add-on

SAP digital payments add-on client and con gurations set up in Backoffice

This extension uses Charon client to make RESTful Web service calls. The API calls are authenticated using OAuth protocol. All
the beans are de ned in cissapdigitalpayment-spring located in cissapdigitalpayment/resources folder. The

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=699f7c158b70473aa86a4c88a4c… 7/19
3/5/2020
sapdigitalpaymentbackoffice extension provides options to con gure the SAP digital payments add-on client and the
add-on con guration objects.

To override the mock payment implementation, set the below property to false.

cis.client.payment.mock=false

Charon API is responsible for fetching bearer tokens and adding to all the requests, to authenticate the request calls.

Integration in Detail
The integration includes the following functionalities:

1. Receive session ID and registration URL from SAP digital payments add-on

2. Poll a registered card

3. Authorize a payment request

4. Capture the payment

5. Refund the payment

6. Delete payment card

Retrieve Token URL for SAP digital payments add-on

To retrive the token URL, make a get call in the format https:
<tenant>.authentication.eu10.hana.ondemand.com/saml/metadata and copy the URI provided in
AssertionConsumerService with Binding="urn:oasis:names:tc:SAML:2.0:bindings:URI".

Receive Session ID and Registration URL from SAP digital payments add-on

Once the user clicks on the Add New Card button in the Billing and Payment Address screen during checkout ow, SAP
Commerce checks if the Site PCI strategy is set as HOP. If yes, a request is made for the registration URL.
paymentFormActionUrlStrategy bean has been overridden to communicate with SapDigitalPaymentClient to
fetch a session ID and registration URL.

SAP digital payments add-on con guration is fetched from the base store and used to populate SapDigitalPaymentClient.

<alias name="cisSapDigitalPaymentFormActionUrlStrategy" alias="paymentFormActionUrlStrategy"/>


<bean id="cisSapDigitalPaymentFormActionUrlStrategy" class="de.hybris.platform.integration.cis
<property name="cisSapDigitalPaymentService" ref="cisSapDigitalPaymentService"/>
<property name="paymentFormActionUrlStrategy" ref="defaultPaymentFormActionUrlStrategy
<property name="sessionService" ref="sessionService"/>
</bean>

While SapDigitalPaymentClient sends a GET request for the registration URL, the following four properties are expected
as request parameters:

CompanyCode

CustomerCountry

PaymentMethod

RoutingCustomParameterValue

All these properties are con gured through Backoffice under SAP digital payments add-on.

Sample request:
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=699f7c158b70473aa86a4c88a4c… 8/19
3/5/2020

https://digitalpayments-core.cfapps.eu10.hana.ondemand.com/core/v1/cards/getregistrationurl?CompanyCod

Sample response:

{
"PaymentCardRegistrationURL": "https://digitalpayments-adapterpaymetric-dev-demo.cfapps.sap.hana.o
"PaymentCardRegistrationSession": "592688f0-8549-4f1d-8cb0-c15afdffa538"
}

The session is saved in SAP Commerce and the application is redirected to the received URL enabling the customer to register the
card with SAP digital payments add-on.

Poll a Registered Card

Before the customer is redirected to the SAP digital payments add-on register card screen, a process in spawned in the
background. This process is responsible for polling the registered card from the add-on using the session ID provided.

While SapDigitalPaymentClient sends the GET request to the add-on, session ID is passed as a path parameter.

Sample request:

https://digitalpayments-core.cfapps.eu10.hana.ondemand.com/core/v1/cards/poll/69e1d65e-49a0-4dd3-ae08-

Sample response:

{
"DigitalPaymentTransaction": {
"DigitalPaymentTransaction": "15d7e8540be77a2894edc2743868e21a8b4061f9f9a",
"DigitalPaymentDateTime": "2017-07-26T10:50:48.382Z",
"DigitalPaytTransResult": "01",
"DigitalPaytTransRsltDesc": "Successful"
},
"PaytCardByDigitalPaymentSrvc": "I2JYJ2SFAA5XZIOSO5VDJ2MQ",
"PaymentCardType": "DPVI",
"PaymentCardExpirationMonth": "02",
"PaymentCardExpirationYear": "2018",
"PaymentCardMaskedNumber": "************1111",
"PaymentCardHolderName": "abcd"
}

There are four possible values for the SAP digital payments add-on transaction result eld.

Value Description

01 SUCCESS

03 PENDING

04 TIMEOUT

05 CANCELLED

If the transaction result is pending, polling process continues considering that the user has not completely entered the card
details in the SAP digital payments add-on register card screen.

etCisSapDigitalPaymentClient(sapDigiPayConfig).pollRegisteredCard(sessionId).map(registeredCard -> {
logSuccess("Successfully poll the registed card");
return registeredCard;
}).doOnError(DefaultCisSapDigitalPaymentService::logError)

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=699f7c158b70473aa86a4c88a4c… 9/19
3/5/2020
.repeatWhen(completed -> completed.delay(configurePollingCardDelay(sap
.takeUntil(DefaultCisSapDigitalPaymentService::checkPollCardTransactio

For the other three statuses, the polling process stops. The value in the PaytCardByDigitalPaymentSrvc eld is
considered as the tokenized card value. This value is saved to the subscription Id in the CreditCardPaymentInfoModel
along with other elds, and is used in further payment authorization calls. The polling interval is con gurable using poll card delay
time from SAP digital payments add-on con guration in Backoffice.

Authorize a Payment Request

Once the user clicks on place order button, an authorization call is made to the add-on. The
commercePaymentAuthorizationStrategy bean has been overriden to make an authorization call to the add-on.

<alias name="defaultSapDigitalCommercePaymentAuthorizationStrategy" alias="commercePaymentAuthorizatio


<bean id="defaultSapDigitalCommercePaymentAuthorizationStrategy" class="de.hybr
<property name="generateMerchantTransactionCodeStrategy" ref="generateMerchantTransact
…………
</bean>

SapDigitalPaymentClient sends a POST request to the add-on to authorize the payment.

Sample request:

{
"Authorizations" : [
{
"Source" : {
"Card" : {
"PaytCardByDigitalPaymentSrvc" : "I2JYJ2SFAA5XZIOSO5VDJ2MQ"
}
},
"AmountInAuthorizationCurrency" : "10",
"AuthorizationCurrency" : "USD"
}
]
}

The tokenized card value is sent in the PaytCardByDigitalPaymentSrvc eld.

Sample response:

{
"Authorizations": [
{
"DigitalPaymentTransaction": {
"DigitalPaymentTransaction": "15dab58be17ca4f5c7efe97425991d8fe53846b4b1b",
"DigitalPaymentDateTime": "2017-08-04T03:45:06.071Z",
"DigitalPaytTransResult": "01",
"DigitalPaytTransRsltDesc": "Message from Paymetric: [XiPay Null] Approved"
},
"Authorization": {
"AuthorizationByPaytSrvcPrvdr": "99600155",
"AuthorizationByAcquirer": "170803224510347",
"AuthorizationByDigitalPaytSrvc": "G5DAVWSMUE",
"AuthorizedAmountInAuthznCrcy": "10.00",
"AuthorizationCurrency": "USD",
"AuthorizationDateTime": "2017-08-04T03:45:10Z",
"AuthorizationStatus": "01",
"AuthorizationStatusName": "Authorized"
},
"Source": {
"Card": {
"PaytCardByDigitalPaymentSrvc": "I2JYJ2SFAA5XZIOSO5VDJ2MV"
}

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=699f7c158b70473aa86a4c88a4… 10/19
3/5/2020
}
}
]
}

The response can be broadly divided into two: DigitalPaymentTransaction details and Authorization details. In the
DigitalPaymentTransaction section, DigitalPaytTransResult can take one of the two possible values. 01 indicating
SUCCESS and 02 indicating FAILURE. Authorization details are considered only if the DigitalPaytTransResult value is 01
(SUCCESS).

Sample error response:

{
"Authorizations": [
{
"DigitalPaymentTransaction": {
"DigitalPaymentTransaction": "15dab78727bd754807908024aea81eb521b635683a4",
"DigitalPaymentDateTime": "2017-08-04T04:19:43.867Z",
"DigitalPaytTransResult": "02",
"DigitalPaytTransRsltDesc": "CURRENCY_UNKNOWN: The currency US1D does not exist @Prope
},
"Source": {
"Card": {
"PaytCardByDigitalPaymentSrvc": "I2JYJ2SFAA5XZIOSO5VDJ2MV"
}
}
}
]
}

AuthorizationByPaytSrvcPrvdr: The authorization token provided by the payment service provider

AuthorizationByAcquirerc: The authorization token provided by the acquirer

AuthorizationByDigitalPaytSrvc: The authorization token provided by SAP digital payments add-on

For the settlement process, at least the value of AuthorizationByDigitalPaytSrvc must be sent to the back-end system,
which completes the settlement with SAP digital payments add-on. AuthorizationByPaytSrvcPrvdr and
AuthorizationByAcquirer eld values are used to track if anything goes wrong in reconciliation and settlement.

If you want SAP Commerce to skip the payment authorization call with SAP digital payments add-on, you can do so by setting the
bypassPaymentAuth eld from SAPDigitalPaymentConfiguration to <true>. In this case, SAP Commerce returns
dummy payment authorization details without making an actual call with the add-on. Then it is the responsibility of the connected
system to make the authorization call using the tokenized payment card details.

Capture the Payment

Once an order is placed, the order process is triggered. During order process ow, in payment capture action, a request is sent to
the add-on to capture the payment. To successfully trigger a payment capture, there sould be at least one payment transaction
entry with type as Authorization and transaction status as Accepted.

Sample request:

{
"Charges" :
[
{
"Source" : {
"Card" : {
"PaytCardByDigitalPaymentSrvc" : "EI3WFVBWA5ZT4B5AJAMS"

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=699f7c158b70473aa86a4c88a4… 11/19
3/5/2020
}
},
"AmountInPaymentCurrency" : "155",
"PaymentCurrency" : "EUR",
"PaymentTransactionDescription" : "CHARGE 55 EUR",
"PaymentIsToBeCaptured" : "false",
"ReferenceDocument": "2222",
"Authorization": {
"AuthorizationByPaytSrvcPrvdr": "10381114"
}
}
]
}

The PaymentIsToBeCaptured is always sent as false, as the payment authorization already happened during placing the
order. AuthorizationByPaytSrvcPrvdr eld value is captured from the payment transaction entry created during payment
authorization call while placing the order. The order number is sent in the ReferenceDocument eld.

Sample response:

{
"Charges": [
{
"DigitalPaymentTransaction": {
"DigitalPaymentTransaction": "15fc3e0275e909844068411055a",
"DigitalPaymentDateTime": "2017-11-16T08:09:28.158Z",
"DigitalPaytTransResult": "01",
"ReferenceDocument": ""
},
"Charge": {
"PaymentByPaymentServicePrvdr": "1059521",
"AmountInPaymentCurrency": "155.00",
"PaymentCurrency": "EUR",
"PaymentDateTime": "2017-11-16T02:09:29",
"PaymentStatus": "01",
"DetailedPaymentStatus": "100",
"PaymentStatusName": "Successful"
},
"Source": {
"Card": {
"PaytCardByDigitalPaymentSrvc": "EI3WFVBWA5AJAMXV4VS"
}
}
}
]
}

The response can be broadly divided into two: DigitalPaymentTransaction details and Charge details.
PaymentByPaymentServicePrvdr value is saved along with other details in a new Payment transaction entry and added to
the payment transaction of the order. PaymentByPaymentServicePrvdr value should be passed for any refund request sent
during refund process ow.

Refund the Payment

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=699f7c158b70473aa86a4c88a4… 12/19
3/5/2020
When the customer places a refund request, the refund process is triggered. During refund process ow, in
captureRefundAction, a request is sent to the add-on to capture the refund. To successfully trigger a refund request, there
should be at least one payment transaction entry with type as Capture and status as Accepted.

Sample request:

{
"Refunds" :
[
{
"Source" : {
"Card" : {
"PaytCardByDigitalPaymentSrvc" : "EI3WF5ZT4B5AJAMXV4VS"
}
},
"AmountInRefundCurrency" : "200",
"RefundCurrency" : "EUR",
"PaymentByPaymentServicePrvdr" : "1053158",
"ReferenceDocument" : ""
}
]
}

PaymentByPaymentServicePrvdr is captured from the payment transaction entry created during capturing the payment
during the order process ow.

Sample response:

{
"Refunds": [
{
"DigitalPaymentTransaction": {
"DigitalPaymentTransaction": "15fc3f41bb92e40ba9401e9a4f61",
"DigitalPaymentDateTime": "2017-11-16T08:31:15.897Z",
"DigitalPaytTransResult": "01",
"ReferenceDocument": ""
},
"Refund": {
"RefundByPaymentServiceProvider": "105733440",
"AmountInRefundCurrency": "200.00",
"RefundCurrency": "EUR",
"RefundDateTime": "2017-11-16T07:31:17Z",
"RefundStatus": "01",
"DetailedRefundStatus": "100",
"RefundStatusName": "Successful"
},
"Source": {
"Card": {
"PaytCardByDigitalPaymentSrvc": "EI3WFVBWA5ZT4MXV4VS"
}
}
}
]
}

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=699f7c158b70473aa86a4c88a4… 13/19
3/5/2020

RefundByPaymentServiceProvider value is saved to new payment transaction entry and attached to the order associated
to the return request.

Delete the Payment Card

When the customer tries to delete the payment card from My Account Payment Details , a synchronous delete card request is
sent to SAP digital payments add-on. If the response is success, the payment information is removed from the customer’s
account.

Sample request:

{
"PaymentCards" : [
{
"PaytCardByDigitalPaymentSrvc": "4VK5SMAJBPHS2V4PPTN3R",
"PaymentCardType": "DPVI",
"PaymentCardExpirationMonth": "06",
"PaymentCardExpirationYear": "2021",
"PaymentCardMaskedNumber": "************1111",
"PaymentCardHolderName": "Demo SAP Digital"
}
]
}

Sample Response:

{
"DeletedPaymentCards": [
{
"DigitalPaymentTransaction": {
"DigitalPaymentTransaction": "15fc44ca164f893ce56d63a440aab244df3ab139ad7",
"DigitalPaymentDateTime": "2017-11-16T10:07:57.284Z",
"DigitalPaytTransResult": "01"
},
"PaytCardByDigitalPaymentSrvc": "4VK5SM27YAJBV4PPTN3R"
}
]
}

sapdigitalpaymentbackoffice Extension
The sapdigitalpaymentbackoffice extension is responsible for providing the Backoffice con gurations for SAP
Commerce integration with SAP digital payments add-on.

General
The sapdigitalpaymentbackoffice extension provides options for Backoffice users to easily con gure the SAP digital
payments add-on con guration and client. Backoffice users can search for both con guration and client details in the top left
search box in con gurations, see Backoffice.

For more information on BackofficeCon guring Backoffice.


https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=699f7c158b70473aa86a4c88a4… 14/19
3/5/2020

ysapdpordermanagement Extension
The ysapdpordermanagement extension is responsible for modifying the order process and return order process for SAP
Commerce integration with SAP digital payments add-on.

General
The ysapdpordermanagement is a template extension that modi es the order process and return process de ned in SAP
Commerce to make calls to SAP digital payments add-on during payment capturing and payment refund. This extension is
dependent on yacceleratorordermanagement extension. The one who creates an extension out of this template extension
is responsible for updating the dependency of yacceleratorordermanagement in the extensioninfo.xml le.

For more information about the required extensions and the functionalities related to order management, refer Order
Management Features.

Order Process
The takePayment action node of the order-process.xml le is modi ed to capture the payment with SAP digital payments
add-on. The takePaymentAction bean is aliased and given a custom implementation.

<alias name="sapDpTakePaymentAction" alias="takePaymentAction" />


<bean id="sapDpTakePaymentAction" class="de.hybris.platform.ysapdpordermanagement.actions.order.pa
<property name="sapDigitalPaymentService" ref="sapDigitalPaymentService"/>
</bean>

Return Process
The captureRefund action node of return-process.xml le is modi ed to capture the refund with SAP digital payments
add-on. The captureRefundAction bean is aliased and given a custom implementation.

<alias name="sapDpCaptureRefundAction" alias="captureRefundAction" />


<bean id="sapDpCaptureRefundAction" class="de.hybris.platform.ysapdpordermanagement.actions.r
<property name="sapDigitalPaymentService" ref="sapDigitalPaymentService" />
<property name="refundAmountCalculationService" ref="refundAmountCalculationService" />
</bean>

SAP Digital Payments Add-On Integration


Implementation
Make the required con gurations in SAP Commerce to connect to SAP digital payments add-on.

Prerequisites
You must have a valid subscription to SAP digital payments add-on

You must obtain the tenant ID, client ID, and the client secret con gured on SAP digital payments add-on

Process
The various tasks in the integration process include:

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=699f7c158b70473aa86a4c88a4… 15/19
3/5/2020
Receive registration URL and session ID from SAP digital payments add-on

Redirect SAP Commerce to SAP digital payments add-on screen to register the card details

Start polling the card in the back-end

Save the card details to the cart and user

Make authorization call when the customer places an order

Capture the payment details during order process

Refund the payment during return process

Getting Started
When integrating with SAP digital payments add-on, you can automate installation and con guration with an installer
recipe, or perform the tasks manually.
Con guring Backoffice
Make necessary con gurations in Backoffice to integrate SAP Commerce with SAP digital payments add-on.

Getting Started
When integrating with SAP digital payments add-on, you can automate installation and con guration with an installer recipe, or
perform the tasks manually.

Installing Using Recipe


Use the b2c_b2b_acc_dp recipe to get started with the SAP digital payments add-on integration quickly.

Context
The b2c_b2b_acc_dp recipe includes the following extension sets:

SAP Commerce B2C Accelerator

SAP Commerce B2B Accelerator

SAP SAP Commerce OMS extensions

SAP digital payments add-on integration extensions

Procedure
1. Perform the steps in Installing SAP Commerce Using Installer Recipes. When you get to the step for installing the recipe,
navigate to <${HYBRIS_HOME}>/hybris/installer.

2. Install the recipe using the following command:./install.sh -r b2c_b2b_acc_dp.

3. Complete the steps in Installing SAP Commerce Using Installer Recipes (initialize and start).

Installing Manually
Install the required extensions and AddOns manually to get started with the integration.

Procedure
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=699f7c158b70473aa86a4c88a4… 16/19
3/5/2020
1. Add the following extensions to the localextension.xml le:

sapdigitalpaymentaddon

sapdigitalpaymentb2baddon

cissapdigitalpayment

sapdigitalpaymentbackoffice

ysapdpordermanagement

2. Install the sapdigitalpaymentaddon to your storefront extension:

ant addoninstall -Daddonnames="sapdigitalpaymentaddon" -DaddonStorefront.yacceleratorstorefront=

3. If you want to modify the B2B checkout ow, install both sapdigitalpaymentaddon and
sapdigitalpaymentb2baddon extensions to your storefront.

Related Information
Installing SAP Commerce Manually
SAP Digital Payments Add-On Integration Architecture

Con guring Backoffice


Make necessary con gurations in Backoffice to integrate SAP Commerce with SAP digital payments add-on.

Creating SAP Digital Payments Add-On Con guration

Procedure
1. Log in to Backoffice as an administrator.

2. Choose SAP Digital Payment SAP Digital Payment Con guration .

This lists all the digital payments con gurations existing in SAP Commerce. There is a one-to-many association between
digital payments con guration and base store. The current base store’s digital payments con guration will be used for card
registration, payment authorization, payment capturing, and so on.

3. To create a new digital payments con guration, do the following:

a. Click the icon.

A wizard to create a new digital payments con guration appears.

b. In the Essentials section, con gure the following:

Field Description Default Value

Name Unique name for digital payments NA


con guration

SAP Digital payment client Client ID of digital payments NA

Base URL The base URL used to https://digitalpayments-


communicate with digital payments core.cfapps.eu10.hana.ondemand.com/core/v1

c. Click Next.

d. In the URL Query Parameters section, con gure the following:

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=699f7c158b70473aa86a4c88a4… 17/19
3/5/2020

Field Description Default Value

Company Code Company code. This is generally a 4 NA


digit code which is inline but not
restricted to company code maintained
in SAP S/4HANA system.

Customer Country The customer country code NA

Payment Method Customer payment method CC

Custom Parameter Custom parameter that could be NA


passed. You can pass the base store
name to determine from which base
store the customer is placing the
request.

e. Click Next.

f. In the SAP Digital Payment Con guration section, con gure the following:

Name Description Default Value

Maximum Retry Maximum number of retries in case the 3


response from digital payments is not
proper

Retry Interval Time interval in milliseconds between 2000


successive retries

Timeout Maximum time for retrying/waiting in 4000


milliseconds before throwing a timeout
exception and exit

Poll Card Delay Time Polling registered card delay time in 1000
milliseconds

g. Click Done.

The new digital payments con guration is created.

After creating the digital payments con gurations, you can update it at any time.

4. To set the payment authentication, choose SAP Digital Payment SAP Digital Payment Con guration Administration
Payment authentication type . Three different con gurations are available:

Default payment authentication: SAP digital payments add-on performs the card tokenisation and payment
authorization.

Bypass payment authentication: SAP digital payments add-on performs card tokenization, but no payment
authorization. This tokenized card information can be used by the target system for payment authorization and
payment capture. This con guration can be used if the order details are sent to systems such as SAP Subscription
Billing.

Split payment authentication: SAP digital payments add-on performs card tokenization and multiple payment
authorization. This con guration can be used if the order details are sent to multiple backend systems such as SAP
Subscription Billing and SAP S/4HANA.

Creating SAP Digital Payments Add-On Client Con guration

Procedure
1. Log in to Backoffice as an administrator.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=699f7c158b70473aa86a4c88a4… 18/19
3/5/2020
2. Choose SAP Digital Payment SAP Digital Payment Client .

This lists all the digital payments clients existing in SAP Commerce.

3. To create a new digital payments client con guration, do the following:

a. Click the icon.

A window to create a new digital payments client con guration appears.

b. Con gure the following:

Field Description Default Value

Client ID Client ID provided by digital payments NA


during customer onboarding

Client Secret Client secret provided by digital NA


payments during customer onboarding

Token URL End point URL to receive oAuth token NA

Scope Resource scopes to be passed with uaa.resource


every API call

Authorized Grant Types Request grant type values to be passed client_credentials


with every API call

c. Click Done.

The new digital payments client con guration is created.

After creating the digital payments client con gurations, you can update it at any time.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=699f7c158b70473aa86a4c88a4… 19/19

You might also like