Recently we had an opportunity to build a prototype for digital payments solution and successfully integrated Digital Currency Hub service platform. Here we would like to share some practical aspects ouf our work.
Configuration steps in the S/4 system
Our S/4 systems are designed to work with traditional currencies(fiat) in treasury and payment operations. To be able to operate with digital currencies via DCH, you will need a new payment method and new house bank account.
Having completed this step, you should be able to use your new payment method while booking an invoice and assign it to business partners.
Configuration steps in the DCH payment platform
In general DCH is a cloud plattform and uses the Fiori Launchpad user interface design, that we know. It is easy to navigate and find an appropriate tile for a specific task
General overview
This is how it all fits together in our test environment.
Technical implementation
Certain configuration steps must be performed by your system engineers. Just like other solutions by SAP, S/4 Systems connect to DCH via cloud connector. Hence somebody needs to take care of cloud connector add-on installation, setting up a logon procedure and network security.
The API integration takes place via REST calls in ABAP. Use function modules of your custom payment medium format as wrappers. All necessary information such as business partner, amount, currency, will be delivered automatically by the interface of the function modules.
Now, lets face the most technical part of our prototype. ABAP Coding would generally consist of handling two tasks:
1) Authentication call and retrieving the access token
The purpose here is to retrieve the access token by an authification call using previuosly retrieved client ID and client secret. We used generic HTTP-Client Class for our purpose.
cl_http_client=>create_by_url(
exporting
url = auth_url,
ssl_id = 'ANONYM'
importing
client = data(mo_token_client)
).
mo_token_client->request->set_method( 'POST' ).
mo_token_client->authenticate(
exporting
username = client_id,
password = client_secret
).
Submit the call and check the http-code by mo_token_client->response->get_status( ) method. If “200” value is returned, read response object and retrieve access token from the JSON Body by mo_token_client->response->get_cdata( ) method.
2) API Call
Create another instance of http-client for api calls and set your access token as a header parameter:
cl_http_client=>create_by_url(
exporting
url = api_url,
ssl_id = 'ANONYM'
importing
client = data(mo_http_client)
).
mo_rest_client->if_rest_client~set_request_header(
iv_name = 'Authorization',
iv_value = |Bearer { lv_access_token }|
).
Prepare payment payload from deep structure in ABAP to a JSON string by calling /ui2/cl_json=>serialize( ).
Finally submit your payments to payment platform
lo_request->set_content_type( iv_media_type = if_rest_media_type=>gc_appl_json ).
lo_request->set_string_data( io_payments ).
mo_rest_client->if_rest_resource~post( lo_request ).
Check the result of API call. This is indicated by the response object. If all went well, you should see a new transaction in DCH. Initially its status would be "In process" and then changed to "Completed".
Conclusion and outlook
This case covers a very basic scenario of payment processing with digital currencies. Its puspose is to trigger a fund transfer from one party to another and ensure correct booking in S/4 . At the end your booked invoice is automatically cleared by F110-payment run and payments are processed in usual manner.
More advanced options are upcoming, when the ongoing DCH-release with Multi Banking Connectivity becomes available.
But no matter, if you run your payments on larger scale using MBC or use simple integration as described here, adding the option of digital payments may turn out highly beneficial. Treasurers might be attracted by optimization af cross-border payments costs, processing speed and becoming independent from banking holidays and working hours
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 |