. . . .
Getting started with the Monnify iOS SDK
First off, the Monnify iOS SDK allows you to accept payments from customers in your iOS application via:
- Card Payment
- Bank Transfer (this is what is special:)
Adding the iOS SDK to your project via CocoaPods
MonnifyiOSSDK is available through [CocoaPods](https://cocoapods.org). To install it, simply add the following line to your Podfile:
Access an instance of the Monnify SDK
Set your merchant API key and contract code.
This should be done in your `AppDelegate.swift` file. This should only be done once in the entire application.
This can be a TEST or LIVE. The TEST mode works on a sandbox environment and payment can be simulated [here](https://websim.sdk.monnify.com/#/bankingapp).
Remember to switch to ApplicationMode.live when generating live builds for your application on production.
Specify the transaction parameters as shown below:
Launch the payment gateway, perhaps when the user clicks on a 'Pay' button.
The initializePayment() method requires the following:
* A ViewController instance.
* An instance of TransactionParameters, e.g `parameter` above.
* A completion/callback to be called with the monnify SDK is completing either after a failure or success.
Get the outcome of the payment attempt.
The result is available via the callback registered in `initializePayment()` as described above.
For example, you can access the transaction status from the result as shown below.
Other information in the result includes transaction reference, payment reference, payment method, and the amount paid.
Transaction Status Possible Values!
Possible values for transaction status enum returned from the SDK and their meanings below:
|No payment has been made on this transaction.|
|Payment has been completed on this transaction.|
|Customer overpaid on this transaction and Merchant has configured that overpayment is accepted. This is only possible for account transfer payment method.|
|Customer underpaid on this transaction and Merchant has configured that underpayment is accepted. This is only possible for account transfer payment method.|
|Payment has been made on this transaction but it cannot be accepted because of the merchant configuration or because of some other reasons. This is only possible for account transfer payment method.|
|No payment was made before the allowed time elapsed. Hence transaction has expired and no payment can be made on this transaction.|
|User cancelled and closed the SDK before payment was made.|
|The transaction ended with a failure. This can happen if a transaction has expired or if an incorrect amount was paid and the merchant configured that only the exact amount should be accepted|
Please reach out to the support team for any clarification.
Payment Method Possible Values!
|The Payment method used for payment on this transaction is Card.|
|The payment method used for payment on this transaction is Account Transfer.|