Updated 29 October 2020
Hyper Pay is a powerful and secure payment gateway which used in MENA (Middle East and North Africa) region. It allows businesses to accept online payments in a more flexible, secure, and easy way. Furthermore, it is also a fully PCI-compliant, that added the higher security to the checkout.
Moreover, it also enables the Advanced Fraud Prevention solution that allows accepting payments from genuine customers with more confidence, security, and reliability.
It also allows customers to track real-time data to analyze more insight into the business. The merchant can use the powerful user-friendly dashboard to monitor the real-time transactions, analyze the revenue tracking, and customer behavior as well.
First you will have to download the sdk
Click here to download sdk
1 2 |
#import <OPPWAMobile/OPPWAMobile.h> #import <CoreMotion/CoreMotion.h> |
1 2 3 4 |
var checkoutProvider: OPPCheckoutProvider? var transaction: OPPTransaction? var isLive = false var checkout_id = "" |
1 |
class CheckoutDataViewController: UIViewController, OPPCheckoutProviderDelegate { |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
func hyperPayCall(data: JSON){ self.checkout_id = data["checkoutId"].stringValue isLive = data["isLive"].boolValue self.checkoutProvider = self.configureCheckoutProvider(checkoutID: checkout_id) self.checkoutProvider?.delegate = self self.checkoutProvider?.presentCheckout(forSubmittingTransactionCompletionHandler: { (transaction, error) in print(error) print(transaction) guard let transaction = transaction else { // Handle invalid transaction, check error return } if transaction.type == .synchronous { } else if transaction.type == .asynchronous { NotificationCenter.default.addObserver(self, selector: #selector(self.didReceiveAsynchronousPaymentCallback), name: Notification.Name(rawValue: Config.asyncPaymentCompletedNotificationKey), object: nil) } else { Utils.showResult(presenter: self, success: false, message: "Invalid transaction") } }, cancelHandler: { Utils.showResult(presenter: self, success: false, message: "Invalid transaction") }) } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
func configureCheckoutProvider(checkoutID: String) -> OPPCheckoutProvider? { let provider = OPPPaymentProvider.init(mode:isLive ? .live : .test) let checkoutSettings = Utils.configureCheckoutSettings()//OPPCheckoutSettings() checkoutSettings.storePaymentDetails = .prompt if UserDefaults.standard.string(forKey: AppLanguageKey) == "ar" { checkoutSettings.language = "ar" } else { checkoutSettings.language = "en" } return OPPCheckoutProvider.init(paymentProvider: provider, checkoutID: checkoutID, settings: checkoutSettings) } @objc func didReceiveAsynchronousPaymentCallback() { NotificationCenter.default.removeObserver(self, name: Notification.Name(rawValue: Config.asyncPaymentCompletedNotificationKey), object: nil) self.checkoutProvider?.dismissCheckout(animated: true) { DispatchQueue.main.async { } } } func checkoutProvider(_ checkoutProvider: OPPCheckoutProvider, continueSubmitting transaction: OPPTransaction, completion: @escaping (String?, Bool) -> Void) { // To continue submitting you should call completion block which expects 2 parameters: // checkoutID - you can create new checkoutID here or pass current one // abort - you can abort transaction here by passing 'true' completion(transaction.paymentParams.checkoutID, false) } |
Please leave a comment if you face any issue in this blog.
For more Blogs please click here
If you have more details or questions, you can reply to the received confirmation email.
Back to Home
* and their documentation is not helpful at all