Initializing the SDK
It is necessary to initialize the SDK at the launch of your application in the didFinishLaunchingWithOptions method of your AppDelegate. This allows you to configure the SDK with your data.
- Import the LyraPaymentSDK into your application
- Call the initialize method with the following parameters:
Parameter Format Description publicKey string Fill in your public key (available in the Settings menu > Shop > REST API keys your Expert Back Office) options [String: Any] Dictionary that allows you to configure the behavior of the SDK. The possible keys in this dictionary are:Keys Format Description Required apiServerName string Expected value: REST API server name (available in the Settings menu > Shop > REST API keys of your Expert Back Office)
Required cardScanningEnabled Bool Enables/Disables the card scan feature (see the iOS integration guide)
Optional applePayMerchantId string Expected value: APPLE_MERCHANT_ID See Configuring the contracts chapter to learn more about your APPLE_MERCHANT_ID which is actually your Apple Pay contract number.
Required Example of a call
<div class="doc-component-wrapper"> <doc-code-block> <div class="doc-code" data-languages="swift, objective_c"> <pre data-language="swift"> //Active Apple Pay functionality configurationOptions[Lyra.applePayMerchantId] = APPLE_MERCHANT_ID </pre> <pre data-language="objective_c"> //Active Apple Pay functionality [configurationOptions setValue:APPLE_MERCHANT_ID forKey:Lyra.applePayMerchantId]; </pre> </div> </doc-code-block> </div>
For more details on the examples according to the calling method (swift,objective_c) see the iOS integration guide.
Optionally, you can configure the text to be displayed as a summary in the payment request. All you need to do is send the text to be displayed as value of the applePaymentSummaryDescription key in the option configuration dictionary when calling the processPayment.