OPPPaymentProvider
@objc
public final class OPPPaymentProvider : NSObject
extension OPPPaymentProvider: OPPSThreeDSManagerDelegate
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
Swift
@objc public var mode: OPPProviderMode -
Delegate for processing the 3-D Secure transaction.
Declaration
Swift
@objc public weak var threeDSEventListener: OPPThreeDSEventListener?
-
Instance method to obtain a new provider.
Declaration
Swift
@objc public 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. -
Factory method to obtain a new provider.
Declaration
Swift
@objc public static func paymentProviderWithMode(_ mode: OPPProviderMode) -> OPPPaymentProviderParameters
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
Swift
@objc(sendTransaction:toEndpoint:completionHandler:) public func send(_ transaction: OPPTransaction, toEndpoint endpoint: String, completionHandler: @escaping (OPPTransaction, (any Error)?) -> Void)Parameters
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 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
Swift
public 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
"/".Return Value
The transaction with its response applied.
-
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
Swift
@objc public func submitTransaction(_ transaction: OPPTransaction, completionHandler: @escaping (OPPTransaction, (any Error)?) -> Void)Parameters
transactionThe transaction to be submitted.
completionHandlerA block executed when the transaction is submitted.
-
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
Swift
public func submitTransaction(_ transaction: OPPTransaction) async throws -> OPPTransactionParameters
transactionThe transaction to be submitted.
Return Value
The transaction with its response applied.
-
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
Swift
@objc(registerTransaction:completionHandler:) public func register(_ transaction: OPPTransaction, completionHandler: @escaping (OPPTransaction, (any Error)?) -> Void)Parameters
transactionThe transaction to be registered.
completionHandlerA block executed when the transaction is registered.
-
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
Swift
public func register(_ transaction: OPPTransaction) async throws -> OPPTransactionParameters
transactionThe transaction to be registered.
Return Value
The transaction with its response applied.
-
Requests checkout details such as amount, currency and tokens from the Server by checkout ID. Request is performed asynchronously using an
NSURLSession.Declaration
Swift
@objc public func requestCheckoutInfo(withCheckoutID checkoutID: String, completionHandler: @escaping (OPPCheckoutInfo?, (any Error)?) -> Void)Parameters
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 checkout details such as amount, currency and tokens from the Server by checkout ID. Request is performed asynchronously using an
NSURLSession.Declaration
Swift
public func requestCheckoutInfo(withCheckoutID checkoutID: String) async throws -> OPPCheckoutInfoParameters
checkoutIDThe checkout ID of a transaction.
Return Value
An instance of
OPPCheckoutInfo.
-
Requests logo URLs for specified payment brands. Request is performed asynchronously using an
NSURLSession.Declaration
Swift
@objc public func requestLogoURLs(forPaymentBrands paymentBrands: [String], completionHandler: @escaping ([String : URL]?, (any Error)?) -> Void)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. -
Requests logo URLs for specified payment brands. Request is performed asynchronously using an
NSURLSession.Declaration
Swift
public func requestLogoURLs(forPaymentBrands paymentBrands: [String]) async throws -> [String : URL]Parameters
paymentBrandsThe list of payment brands to get logos from the Server.
Return Value
A dictionary with URLs in format
<paymentBrand: URL>.
-
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
Swift
@objc public func requestBinInfo(withCheckoutID checkoutID: String, bin: String, completionHandler: @escaping (OPPBinInfo?, (any Error)?) -> Void)Parameters
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. -
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
Swift
public 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.
Return Value
An instance of
OPPBinInfo.
-
Requests a list of iDeal banks.
This method is deprecated.
Declaration
Swift
@available(*, deprecated) @objc public func requestIdealBanks(withCheckoutID checkoutID: String, completionHandler: @escaping ([[AnyHashable : Any]]?, (any Error)?) -> Void)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
Swift
@objc public func securityWarnings(completionHandler: @escaping ([Warning]?, (any Error)?) -> Void)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. -
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
Swift
public func securityWarnings() async throws -> [Warning]Return Value
An instance of
Warning.
-
Requests a Apple’s recurring payments tokenId.
Declaration
Swift
@objc public func requestApplesTokenId(withCheckoutID checkoutID: String, completionHandler: @escaping (String?, (any Error)?) -> Void)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 tokenId, and on failure an error is received.
-
Requests a Apple’s recurring payments tokenId.
Declaration
Swift
public func requestApplesTokenId(withCheckoutID checkoutID: String) async throws -> StringParameters
checkoutIDThe checkout ID of a transaction.
Return Value
A tokenId.
-
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
Swift
@objc public static 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, or ifpaymentSummaryItemsis empty or its last item’s amount is not positive. -
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
Swift
@objc public static 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
Swift
@objc(paymentRequestWithMerchantIdentifier:countryCode:) public static 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
Swift
@objc public static 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
Swift
@objc public static 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 Checkout payment data
Declaration
Swift
@objc public func requestCheckoutData(withCheckoutID checkoutID: String, completionHandler: @escaping (OPPCheckoutData?, (any Error)?) -> Void)Parameters
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.
-
Requests a Checkout payment data
Declaration
Swift
public func requestCheckoutData(withCheckoutID checkoutID: String) async throws -> OPPCheckoutDataParameters
checkoutIDThe checkout ID of a transaction.
Return Value
An OPPCheckoutData object with payment data.
-
Requests visa installment plans
Declaration
Swift
@objc public func getVisaInstallmentPlans(_ planParams: OPPInstallmentPlanParams, completionHandler: @escaping (OPPInstallmentPlanResponse?, (any Error)?) -> Void)Parameters
planParamsThe intallment plan parameters of a transaction.
completionHandlerThe completion block which will be invoked once the response is received. On success, you will receive an OPPInstallmentPlanResponse ojbect with installment plans data, and on failure an error is received.
-
Requests visa installment plans
Declaration
Swift
public func getVisaInstallmentPlans(_ planParams: OPPInstallmentPlanParams) async throws -> OPPInstallmentPlanResponseParameters
planParamsThe intallment plan parameters of a transaction.
Return Value
An OPPInstallmentPlanResponse object with installment plans data.
-
Undocumented
Declaration
Swift
public func onThreeDSChallengeRequired(with completion: @escaping (UINavigationController?) -> Void) -
Undocumented
Declaration
Swift
public func onThreeDSConfigRequired(with completion: @escaping (OPPThreeDSConfig?) -> Void) -
Undocumented
Declaration
Swift
public func sendThreeDS2AuthParams(params: String, transaction: OPPTransaction, _ completionHandler: @escaping (OPPTransaction, NSError?) -> Void)
OPPPaymentProvider Class Reference