OPPPaymentProvider
@interface OPPPaymentProvider : NSObject
Defines the methods and properties of the payment provider. Use the factory method +paymentProviderWithMode: to instantiate a new provider.
-
Determines the type of Server to use. Transactions to the LIVE server come with fees attached.
Declaration
Objective-C
@property (nonatomic) OPPProviderMode mode;Swift
var mode: OPPProviderMode { get set } -
Delegate for processing the 3-D Secure transaction.
Declaration
Objective-C
@property (nonatomic, weak, nullable) id<OPPThreeDSEventListener> threeDSEventListener;Swift
weak var threeDSEventListener: (any OPPThreeDSEventListener)? { get set }
-
Factory method to obtain a new provider.
Declaration
Objective-C
+ (nonnull instancetype)paymentProviderWithMode:(OPPProviderMode)mode;Swift
convenience init(mode: OPPProviderMode)Parameters
modeDetermines the type of Server to use. Transactions to the LIVE server come with fees attached.
Return Value
An
OPPPaymentProviderwhich can be used to process transactions.
-
On sending a transaction, it is performed asynchronously using an
NSURLSessionto communicate with the Server. Depending on the endpoint the transaction will be submitted or registered only without making the payment.Declaration
Objective-C
- (void)sendTransaction:(nonnull OPPTransaction *)transaction toEndpoint:(nonnull NSString *)endpoint completionHandler:(nonnull void (^)(OPPTransaction *_Nonnull, NSError *_Nullable))completionHandler;Swift
func send(_ transaction: OPPTransaction, toEndpoint endpoint: String) async throws -> OPPTransactionParameters
transactionThe transaction to be sent.
endpointThe endpoint which will be used for processing transaction. The endpoint must start with a
"/".completionHandlerA block executed when the transaction is sent.
-
On submitting a transaction, it is performed asynchronously using an
NSURLSessionto communicate with the Server. Depending on the concrete type of the transaction, various calls to the server are necessary to ensure proper processing. Submitting means that the transaction is sent to the server, where it will cause a debit of the given amount on the account specified in theOPPTransaction‘sOPPPaymentParams.Declaration
Objective-C
- (void)submitTransaction:(nonnull OPPTransaction *)transaction completionHandler: (nonnull void (^)(OPPTransaction *_Nonnull, NSError *_Nullable))completionHandler;Swift
func submitTransaction(_ transaction: OPPTransaction) async throws -> OPPTransactionParameters
transactionThe transaction to be submitted.
completionHandlerA block executed when the transaction is submitted.
-
On storing a payment data, it is performed asynchronously using an
NSURLSessionto communicate with the Server. The method creates a just registration separate from any later payment.Declaration
Objective-C
- (void)registerTransaction:(nonnull OPPTransaction *)transaction completionHandler: (nonnull void (^)(OPPTransaction *_Nonnull, NSError *_Nullable))completionHandler;Swift
func register(_ transaction: OPPTransaction) async throws -> OPPTransactionParameters
transactionThe transaction to be registered.
completionHandlerA block executed when the transaction is registered.
-
Requests checkout details such as amount, currency and tokens from the Server by checkout ID. Request is performed asynchronously using an
NSURLSession.Declaration
Objective-C
- (void)requestCheckoutInfoWithCheckoutID:(nonnull NSString *)checkoutID completionHandler: (nonnull void (^)(OPPCheckoutInfo *_Nullable, NSError *_Nullable)) completionHandler;Swift
func requestCheckoutInfo(withCheckoutID checkoutID: String) async throws -> OPPCheckoutInfoParameters
checkoutIDThe checkout ID of a transaction.
completionHandlerThe completion block will be invoked once the response in received. On success, you will receive an instance of
OPPCheckoutInfo; on failure, an error.
-
Requests logo URLs for specified payment brands. Request is performed asynchronously using an
NSURLSession.Declaration
Objective-C
- (void)requestLogoURLsForPaymentBrands: (nonnull NSArray<NSString *> *)paymentBrands completionHandler: (nonnull void (^)( NSDictionary<NSString *, NSURL *> *_Nullable, NSError *_Nullable))completionHandler;Swift
func requestLogoURLs(forPaymentBrands paymentBrands: [String]) async throws -> [String : URL]Parameters
paymentBrandsThe list of payment brands to get logos from the Server.
completionHandlerThe completion block will be invoked once the response in received. On success, you will receive a dictionary with URLs in format
<paymentBrand: URL>; on failure, an error.
-
Note
If you are using core SDK, please request checkout info by calling
-[OPPPaymentProvider requestCheckoutInfoWithCheckoutID:completionHandler:]before requestBinInfo call. Checkout info call is essential part of the flow, error will be thrown otherwise.Declaration
Objective-C
- (void)requestBinInfoWithCheckoutID:(nonnull NSString *)checkoutID bin:(nonnull NSString *)bin completionHandler: (nonnull void (^)(OPPBinInfo *_Nullable, NSError *_Nullable))completionHandler;Swift
func requestBinInfo(withCheckoutID checkoutID: String, bin: String) async throws -> OPPBinInfoParameters
checkoutIDThe checkout ID of a transaction.
binFirst 6 or more digits of the card number.
completionHandlerThe completion block will be invoked once the response in received. On success, you will receive an instance of
OPPBinInfo; on failure, an error. -
Requests a list of iDeal banks.
This method is deprecated.
Declaration
Objective-C
- (void)requestIdealBanksWithCheckoutID:(nonnull NSString *)checkoutID completionHandler: (nonnull void (^)(NSArray<NSDictionary *> *_Nullable, NSError *_Nullable)) completionHandler;Swift
func requestIdealBanks(withCheckoutID checkoutID: String) async throws -> [[AnyHashable : Any]]Parameters
checkoutIDThe checkout ID of a transaction.
completionHandlerThe completion block which will be invoked once the response is received. On success, you will receive a list of banks in array, and on failure an error is received.
-
The ipworks3ds SDK performs security checks in order to provide a list of
Warningobjects. These can be checked by the app to determine whether or not to proceed with the checkout process.Declaration
Objective-C
- (void)securityWarningsWithCompletionHandler: (nonnull void (^)(NSArray<Warning *> *_Nullable, NSError *_Nullable))completionHandler;Swift
func securityWarnings() async throws -> [Warning]Parameters
completionHandlerThe completion block will be invoked once the performing of security checks is done . On success, you will receive an instance of
Warning; on failure, an error.
-
Determine whether this device can process Apple Pay payment requests using specific payment request. Your application should confirm that the user can make payments before attempting to authorize a payment. Your application may also want to alter its appearance or behavior when the user is not allowed to make payments.
Declaration
Objective-C
+ (BOOL)canSubmitPaymentRequest:(nonnull PKPaymentRequest *)request;Swift
class func canSubmitPaymentRequest(_ request: PKPaymentRequest) -> BoolParameters
requestThe return value of this method depends on the
supportedNetworksproperty of this payment request.Return Value
YESif the user can authorize payments on this device using the payment request.NOif the user cannot authorize payments on these networks or if the user is restricted from authorizing payments. -
Whether or not this device is capable of using Apple Pay. This checks both whether the user is running an iPhone 6/6+ or later, iPad Air 2 or later, or iPad mini 3 or later, as well as whether or not they have stored any cards in Apple Pay on their device.
Declaration
Objective-C
+ (BOOL)deviceSupportsApplePay;Swift
class func deviceSupportsApplePay() -> BoolReturn Value
Whether or not the user is currently able to pay with Apple Pay.
-
A convenience method to return a
PKPaymentRequestwith sane default values. You will still need to configure thepaymentSummaryItemsproperty to indicate what the user is purchasing.Declaration
Objective-C
+ (nonnull PKPaymentRequest *) paymentRequestWithMerchantIdentifier:(nonnull NSString *)merchantIdentifier countryCode:(nonnull NSString *)countryCode;Swift
class func paymentRequest(withMerchantIdentifier merchantIdentifier: String, countryCode: String) -> PKPaymentRequestParameters
merchantIdentifierYour Apple Merchant ID, as obtained at https://developer.apple.com/account/ios/identifiers/merchant/merchantCreate.action
countryCodeThe merchant’s ISO country code. We suggest using the country where your business is located.
Return Value
A
PKPaymentRequestwith proper default values.
-
A convenience method to check if Touch ID, Face ID or passcode are set on user device.
Declaration
Objective-C
+ (BOOL)isDeviceAuthenticationAvailable;Swift
class func isDeviceAuthenticationAvailable() -> BoolReturn Value
NOif neither Touch ID/Face ID nor passcode are set, otherwiseYES. -
Returns the list of FPX banks as a dictionary. Key from the dictionary will be banks display name and bank name will be value for that key.
Declaration
Objective-C
+ (NSDictionary<NSString *, NSString *> *_Nonnull)getFPXBanks;Swift
class func getFPXBanks() -> [String : String]Return Value
A dictionary of FPX payment bank names where key will be banks display name and its value will be bank name.
-
Requests a Apple’s recurring payments tokenId.
Declaration
Objective-C
- (void)requestApplesTokenIdWithCheckoutID:(nonnull NSString *)checkoutID completionHandler: (nonnull void (^)(NSString *_Nullable, NSError *_Nullable)) completionHandler;Swift
func requestApplesTokenId(withCheckoutID checkoutID: String) async throws -> StringParameters
checkoutIDThe checkout ID of a transaction.
completionHandlerThe completion block which will be invoked once the response is received. On success, you will receive a tokenId, and on failure an error is received.
-
Requests a Checkout payment data
Declaration
Objective-C
- (void)requestCheckoutDataWithCheckoutID:(nonnull NSString *)checkoutID completionHandler: (nonnull void (^)(OPPCheckoutData *_Nullable, NSError *_Nullable)) completionHandler;Swift
func requestCheckoutData(withCheckoutID checkoutID: String) async throws -> OPPCheckoutDataParameters
checkoutIDThe checkout ID of a transaction.
completionHandlerThe completion block which will be invoked once the response is received. On success, you will receive an OPPCheckoutData ojbect with payment data, and on failure an error is received.
OPPPaymentProvider Class Reference