iOS – SDK Configuration

This integration allows you to accept payments in your iOS app very quickly.

Prerequisites

Build settings

The iOS target version is 9.0, which means that the SDK won’t build on applications targeting a lower version of iOS.

Credentials

You need to generate API credentials in order for the SDK to send requests to the HiPay Enterprise platform.

Warning: credentials included in the iOS SDK must have a public accessibility, NOT a private accessibility.

To be sure that your credentials have the proper accessibility:

Go to the “Integration” section of your HiPay Enterprise back office.

Then, click on “Security Settings”.

Scroll down to “Api credentials”.

Click on the edit icon next to the credentials you want to use.

Finally, make sure that the credentials are set up.

Credentials accessibility

Your credentials must be granted to:

Tokenize a card

Get transaction details

Process an order

Create a payment page

Workflow

Authentication

In order for our iOS SDK to process transactions with users’ payment details on the HiPay Enterprise platform, you must provide the SDK with credentials (Configuration section).

Also, for each order processed by the iOS SDK, the HiPay Enterprise platform must authenticate the call and validate that the merchant has allowed it. To do so, HiPay Enterprise leverages a signature mechanism. Once your app needs to process a payment, it must contact your own server in order to get a signature, specific to the order to be processed. (Signature section)

Order processing

Order information should not be generated on the client side. Most of the time, orders are generated on the server side (on your servers), following actions performed by your users on your mobile app. The HiPay Enterprise SDK for iOS allows you to present a payment page to your users and process transactions directly on your mobile app.

Thus, your mobile app will receive a confirmation with a transaction status indicating that the payment was successfully completed. You may display a confirmation screen upon this confirmation, but you must not process order on the server side following this confirmation. For security reasons, orders must always be confirmed on your systems following the server-to-server notification.

Signature calculation

The signature has to be generated beforehand on the server side in order not to show the secret passphrase in client code. This is the reason why the code examples below are executed in PHP/Python on your servers and not embedded in the iOS app directly.

Please find below some code examples for signature generation. Note that we chose the SHA-1, you need to adapt your server side code accordingly to the hashing algorithm you selected.

PSD2 & SCA

Thanks to our iOS SDK we handle most of the data without you having to code anything. You can see all the new parameters on our explorer API.

Adding or overriding PSD2 data

The accuracy of the information sent is key for making sure that your customers have a frictionless payment process. That’s why we provide you the possibility to add or override all the information related to the PSD2.

We added 3 new variables in HPFPaymentPageRequest object :

merchantRiskStatement

previousAuthInfo

accountInfo

Each variables is a string type corresponding to a JSON Object. Your server send user informations to your Android application, so you just have to retrieve these JSON data and convert them in string format and set the specific variable. If you don’t set accountInfo variable, we automatically generate the associated NSDictionary with 3 values (name_indicator / enrollment_date / card_stored_24h).