Enterprise Resource Planning Blogs by Members
Gain new perspectives and knowledge about enterprise resource planning in blog posts from community members. Share your own comments and ERP insights today!
cancel
Showing results for 
Search instead for 
Did you mean: 
christian_noack
Participant
My client plans to use a variety of digital payment options within a non-SAP e-commerce solution. Some of which will be region specific. SAP Digital Payments Add-On was selected to streamline implementation on both sides: authorization of payments within the e-commerce solution and capturing in S/4HANA.

SAP provides documentation and a library to integrate non SAP ecommerce solutions with DPA, which we will explore.

Overview


SAP Digital Payments Add-On


With SAP Digital Payments Add-On (DPA), SAP offers a SaaS cloud product to securely and efficiently process digital payment transactions. From an integration point of view it serves as a gateway between any consumer application and a variety of participating payment service providers (PSP) without having the hazzle to setup numerous direct integrations in e.g. your e-commerce solution or S/4HANA backend. SAP DPA ensures that transactions are processed PCI compliant.


SAP digital payments add-on context view © help.sap.com


The integration with SAP Commerce Cloud uses other APIs than those recommended for Non-SAP Applications. It is limited to credit card processing and accesses these APIs directly.

Hosted Payment Page


Among the different integration options of PSP and e-commerce, Hosted Payment Pages are often utilized to lower implementation efforts and leave as much complexity to the PSP as possible. DPA comes with a configurable hosted payment page where the user can enter payment details. Note, this is not the payment page of the actual PSP.


Payment Page Context View © by help.sap.com


If you integrate the payment page of your payment service provider, you will still need to submit these payments to DPA separately in order to benefit from e.g. S/4HANA integration. I recommend using the DPA hosted payment page to avoid that.

E-commerce Integration with the Hosted Payment Page


With the hosted payment page, a user typically navigates the storefront during checkout like this:


User flow with only one DPA payment method available


 

In a first step the user chooses if he wants to pay with a DPA or a non DPA payment method. If the user chooses to pay with DPA, I skip the payment selection offered by DPA. I only implemented credit card and automatically select this method for the user. The user will then see a button to pay with credit card.

Payment Details Dialog


When the user clicks that "Payment Card" button, a new window or tab opens. There the user can enter payment details. After the user confirms the details, the window closes and a storefront callback is triggered.


DPA Hosted Payment Page for Card Payment


The hosted payment page is currently not customizable for storefront integration. You can configure the displayed fields, but that only applies when used in a S/4HANA context.

Setting up SAP Digital Payment Add-On


You need to setup the add-on with a stripe configuration and a payment page configuration. For that you will also need a stripe account. I used stripe for all my testing, since the DPA to Magnius Integration was still in the certification phase. My client opted for Magnius as they offer huge amounts of connected PSPs and payment cost reduction features.

Integrating a non SAP e-commerce solution


Base Urls for accessing the APIs


From the setup of the Machine 2 Machine communication, you will receive a json service key containing the required information to authenticate and connect to the DPA APIs.
{
"uri": https://digitalpayments-demo-core.cfapps.eu10.hana.ondemand.com, // API URL
"uaa": {
"credential-type": "instance-secret",
"clientid": "sb-44444444444444444444444444444444444444444444|digitalpayments-demo-m2m!b16",
"clientsecret": "aaaaaaaaaaaaaaaaaaaaaaaaaaa=",
"url": https://<your-namespace>.authentication.eu10.hana.ondemand.com, // OAuth URL
"apiurl": doNotUseThisOne,
}
}

Authenticate first via the uaa.url and then send requests to uri.

Url for Auth request:
https://<your-namespace>.authentication.eu10.hana.ondemand.com/oauth/token

Sample url for an API request:
https://digitalpayments-demo-core.cfapps.eu10.hana.ondemand.com/core/v1/dpjslib/loader

Implementation


System Setup


To initiate a payment session with SAP DPA, you will need to perform several requests to load a JavaScript library provided by SAP DPA called DPJSLIB. Vue.js and Axios are well-suited for meeting these requirements.

Capabilities of DPJSLIB

  • Renders the payment button for the selected payment method into the storefront.

  • Opens the DPA hosted payment page and manages inter window communication between the storefront browser window and the DPA hosted payment page browser window.

  • Triggers your callback when the user enters payment details and completes payment


The request for configuration to load DPJSLIB can only be triggered by a backend, due to the enforced CORS policies. To handle these requests, I opted to use Node.js and Axios

Here's an overview of my setup:


Simplified Communication Sequence


This sequence is simplified, the whole payment process includes quite some steps.

Call Sequence


The following diagram shows the full payment sequence. Starting from the storefront payment selection page and ending with the finalize payment call that the backend has to perform to get transaction details. If you need more details, you can always check out the POC code on github.


Full payment sequence


 

Additional Hints



  • During implementation, I found it very helpful to log all responses from DPA.

  • You will need the API Documentation for DPA Payment Page, which will be publicly available soon. In the meantime, please request it from your SAP Contact.

  • At some point you will require the payment page id, which will be the name of the payment page:

  • There are multiple instances where you'll need to handle potential errors, particularly after each remote call.


 

Exporting authorized orders to S/4HANA


Upon the user submitting payment credentials, I create an order in the shop backend and attach the details of the authorized payment. The finalize payment call provides the relevant details.

Simplified finalize payment response:
{
Authorization: {
AuthorizationByDigitalPaytSrvc: 'ABCDEFGHIJ',
},
Source: {
Card: {
PaytCardByDigitalPaymentSrvc: 'AAAAAAAAAAAAAAAAAAAAAAAA'
},
},
}

Even when I am not notified by the storefront, I will still regularly check via finalize payment to determine if the user has completed the payment process. This check is necessary in case the user closes the browser before the storefront can send the information.

With this information, I can create an order in S/4HANA with payment details on header level 'Electronic Payments'. I transfer two of the fields obtained from finalize payment, namly AuthorizationByDigitalPaytSrvc and EPaytByDigitalPaymentSrvc, as payment plan entity to S/4HANA via the Sales Order (A2X) API.

S/4HANA utilizes these identifiers to load the payment details from DPA, e.g. authorized amount or card validity. Configure the integration incl. destination in S/4HANA. However no implementation is required to finish the process and settle the payment.


Loaded Payment Details in S/4HANA



Outlook & Source Code


Utilizing SAP Digital Payments Add-On as a broker seems to be a promising approach to streamline PSP integrations plus it supports the whole payment process instead of just focusing on payment authorization in e-commerce.

I am eagerly anticipating the deployment of the integration to production. Feel free to leave a comment for clarification or reach out to exchange experiences.

I published the proof of concept code on github.
8 Comments
Pallav
Explorer
0 Kudos
Hi Christian,

Thank you for a very detailed blog on Digital Payment Add On.

I was wondering whether we can build SAP Cloud Application Programming to accomplish the same with S4HANA 2022. ?

 

Best Regards,

Pallav
christian_noack
Participant
0 Kudos

Which part of the things described here would you build in SAP Cloud Application Programming? The proof of concept? I think that would be worth a try.

SAP Published the payment page API Description that I mentioned in the blog post, it can be found at https://api.sap.com/api/DPCoreAPI/resource/Payment_Page.

Arlean
Explorer
0 Kudos

Hi Christian,

we're working on integrate SAP DPA with Cybersource as our PSP. We use Frankfurt data center Europe. We finished active Payment service provider, and payment service provide determination and merchant mapping. However on the payment page configuration, we don't have any Configuration detail to select to create a payment page ID. I want to know where the Configuration detail come from, like in your post, you have Giropay, Klama pay, Payment card,.. Is this list from Stripe or SAP DPA sets this up or any step we missed? btw we didn't run the javascript. 

Thanks very much for any advice. 

 

julianaferreira
Advisor
Advisor
0 Kudos

Hello @christian_noack,

We are working with a Payment cards services customer and we are looking for understanding the scope of the SAP digital payments add-on for Latin America and how we can set up sustainability functionalities in it. Would you by any chance be able to recommend someone who could support us on this? Thank you! Juliana

christian_noack
Participant

@Arlean the payment page id is the name you enter when you first create a payment page. After initial creation, it cannot be changed and no field containing it is displayed. The screenshot I posted is from the ui of SAP Digital Payments Addon.

Payment Page ID during Payment Page CreationPayment Page ID during Payment Page Creation

christian_noack
Participant

@julianaferreira I sent you a pm.

Arlean
Explorer
0 Kudos

@christian_noack Both SAP and Cybersource engineers confirmed there is gap between SAP DPA and Cybersource connection. They need a few months to fully implement this. Do you know if it is possible to skip DPA and make Cybersource call from SAP directly? or you know anyone can support this? Thanks a lot!!!!

christian_noack
Participant

@Arlean our customer also went through the process of integrating a new payment provider. For us it was Magnius. They were implementing components for SAP DPA so that we could use the SAP DPA interfaces in commerce and SAP. That process took several months. Also Magnius was not aware at first, that they would also have to implement payment page logic. In my experience, integrating payment providers is always challenging, so every decision should consider multiple factors like e.g. knowledge present in your development team or future maintenance. I will send you a contact via pm.

Labels in this area