BTPaymentMethodNonce
Objective-C
@interface BTPaymentMethodNonce : NSObject
Swift
class BTPaymentMethodNonce : NSObject
BTPaymentMethodNonce is for generic tokenized payment information.
For example, if a customer’s vaulted payment methods contains a type that’s not recognized or supported by the Braintree SDK or the client-side integration (e.g. the vault contains a PayPal account but the client-side integration does not include the PayPal component), this type can act as a fallback.
The payment method nonce is a public token that acts as a placeholder for sensitive payments data that has been uploaded to Braintree for subsequent processing. The nonce is safe to access on the client and can be used on your server to reference the data in Braintree operations, such as Transaction.sale.
-
Initialize a new Payment Method Nonce.
Declaration
Objective-C
- (nullable instancetype)initWithNonce:(nonnull NSString *)nonce;
Swift
init?(nonce: String)
Parameters
nonce
A transactable payment method nonce.
Return Value
A Payment Method Nonce, or
nil
if nonce is nil. -
Initialize a new Payment Method Nonce.
Declaration
Objective-C
- (nullable instancetype)initWithNonce:(nonnull NSString *)nonce type:(nonnull NSString *)type;
Swift
init?(nonce: String, type: String)
Parameters
nonce
A transactable payment method nonce.
type
A string identifying the type of the payment method.
Return Value
A Payment Method Nonce, or
nil
if nonce is nil. -
Initialize a new Payment Method Nonce.
Declaration
Objective-C
- (nullable instancetype)initWithNonce:(nonnull NSString *)nonce type:(nonnull NSString *)type isDefault:(BOOL)isDefault;
Swift
init?(nonce: String, type: String, isDefault: Bool)
Parameters
nonce
A transactable payment method nonce.
type
A string identifying the type of the payment method.
isDefault
A boolean indicating whether this is a default payment method.
Return Value
A Payment Method Nonce, or
nil
if nonce is nil. -
The one-time use payment method nonce
Declaration
Objective-C
@property (nonatomic, copy, readonly) NSString *_Nonnull nonce;
Swift
var nonce: String { get }
-
The type of the tokenized data, e.g. PayPal, Venmo, MasterCard, Visa, Amex
Declaration
Objective-C
@property (nonatomic, copy, readonly) NSString *_Nonnull type;
Swift
var type: String { get }
-
True if this nonce is the customer’s default payment method, otherwise false.
Declaration
Objective-C
@property (nonatomic, readonly) BOOL isDefault;
Swift
var isDefault: Bool { get }