OPPPaymentParams
@objc
public class OPPPaymentParams : NSObject, NSCopying
Class to represent a set of parameters needed for performing an e-commerce transaction.
-
A property that can be set with a value from initial checkout request (mandatory). This value is required in the next steps.
Declaration
Swift
@objc public private(set) var checkoutID: String { get } -
The payment brand of the transaction.
Declaration
Swift
@objc public private(set) var paymentBrand: String { get } -
This URL will receive the result of an asynchronous payment. Must be sent URL encoded.
Declaration
Swift
@objc public var shopperResultURL: String? -
To get or set the mode of payment.
Declaration
Swift
@objc public var mode: OPPProviderMode
-
Creates an object representing a payment transaction.
Throws
Error The error that occurred while validating payment parameters. See code attribute (OPPErrorCode) andNSLocalizedDescriptionto identify the reason of failure.Declaration
Swift
@objc public init(checkoutID: String, paymentBrand: String?) throwsParameters
checkoutIDThe checkout ID of the transaction. Must be not
nilor empty.paymentBrandThe payment brand of the transaction.
Return Value
Returns an object representing a payment transaction, and
nilif parameters are invalid. -
Creates an object representing a payment transaction.
Throws
Error The error that occurred while validating payment parameters. See code attribute (OPPErrorCode) andNSLocalizedDescriptionto identify the reason of failure.Declaration
Swift
@objc public static func paymentParams(checkoutID: String, paymentBrand: String?) throws -> OPPPaymentParamsParameters
checkoutIDThe checkout ID of the transaction. Must be not
nilor empty.paymentBrandThe payment brand of the transaction.
Return Value
Returns an object representing a payment transaction, and
nilif parameters are invalid.
-
Method to add parameter that will be sent to the server.
Declaration
Swift
@discardableResult @objc public func addParam(withName name: String, value: String) -> BoolParameters
nameParameter name, expected string that matches regex [0-9a-zA-Z._\[\]]{3,64}.
valueAny string no longer than 2048 characters.
Return Value
Returns
trueif name and value are valid and parameter is successfully saved, otherwisefalse. -
Method to remove record from the dictionary of parameters.
Declaration
Swift
@objc public func removeParam(withName name: String)Parameters
nameParameter name.
-
Helper method to mask sensitive payment details such as card number, CVV and etc.
Declaration
Swift
@objc public func mask()
OPPPaymentParams Class Reference