This sample project is one of the many integrations I designed and developed. It allows customer that uses Dynamics NAV and LS Retail POS System to receive credit card payments and send payment information to Global Payments API in order to process the transactions. If you don’t know what Global Payments API is, check out this link.
Notice that the web service required to send a token with all requests, into the Request Headers. The token we create expires in 24 hours. Therefore, before making each request, we check the Expiration Date of the Token in the Setup Line table and if is expired, we generate a new token and update the Setup Line table. If token is not expired, we use the existing one. Generating the token required also to encrypt some data using SHA512 algorithm, so this was interesting to develop.
The Response is *.zip archived for performance reasons, so I had to unzip it in order to use the information received and then store it into the Log table. This was also interesting to develop (see code samples at the end).
5) Based on another setup, we can either use an MSR Reader that reads the Track data from the card or manually enter the Card No. and Expiration Date. In previous examples you saw data retrieved using an MSR Card Reader. Below is an example of transaction created by manual input of Card No. and Expiration Date:
How the Global Payments API Integration works
6) Now let’s see how it works at the POS. It is very simple, just add items to sell and press a button. Then system asks to Swipe the Card (in case of using an MSR Card Reader) or to enter Card No and Expiration date. See below how it asks for Card Swipe:
7) If the Card Track was read successfully the payment is sent to web service. If response from web service is transaction APPROVED, payment is registered into ERP system. Otherwise, error message (with details about the cause of error) is shown and payment is not registered. Example error invalid card:
12) If card information is correct, Request is sent to web service. Based on the response received (APPROVED or DECLINED), the payment is registered into ERP system or the error received from web service is displayed.
Other Information and Code Samples
The Global Payments API Integration supports also Payment Reversals and Refunds.
Code samples on GitHub (only core codeunits, not complete solution!) :
All Sample Projects posts are examples of apps created by me from beginning to end(of course, using public information and resources when needed). All customer private data is hidden, the aim being to present briefly the app’s features, ideas, methods used etc