STPPaymentMethodParams
@interface STPPaymentMethodParams : NSObject <STPFormEncodable>
An object representing parameters used to create a PaymentMethod object.
-
The type of payment method. The associated property will contain additional information (e.g.
type == STPPaymentMethodTypeCard
meanscard
should also be populated).Declaration
Objective-C
@property (nonatomic, readonly) STPPaymentMethodType type;
Swift
var type: STPPaymentMethodType { get }
-
The raw underlying type string sent to the server.
Generally you should use
type
instead unless you have a reason not to. You can use this if you want to create a param of a type not yet supported by the current version of the SDK’sSTPPaymentMethodType
enum.Setting this to a value not known by the SDK causes
type
to returnSTPPaymentMethodTypeUnknown
Declaration
Objective-C
@property (nonatomic, copy, readwrite) NSString *_Nonnull rawTypeString;
Swift
var rawTypeString: String { get set }
-
Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
Declaration
Objective-C
@property (nonatomic, strong, readwrite, nullable) STPPaymentMethodBillingDetails *billingDetails;
Swift
var billingDetails: STPPaymentMethodBillingDetails? { get set }
-
If this is a card PaymentMethod, this contains the user’s card details.
Declaration
Objective-C
@property (nonatomic, strong, readwrite, nullable) STPPaymentMethodCardParams *card;
Swift
var card: STPPaymentMethodCardParams? { get set }
-
If this is a iDEAL PaymentMethod, this contains details about user’s bank.
Declaration
Objective-C
@property (nonatomic, assign, unsafe_unretained, readwrite, nullable) STPPaymentMethodiDEALParams *iDEAL;
Swift
var iDEAL: STPPaymentMethodiDEALParams? { get set }
-
Set of key-value pairs that you can attach to the PaymentMethod. This can be useful for storing additional information about the PaymentMethod in a structured format.
Declaration
Objective-C
@property (nonatomic, copy, readwrite, nullable) NSDictionary<NSString *, NSString *> *metadata;
Swift
var metadata: [String : String]? { get set }
-
Creates params for a card PaymentMethod.
Declaration
Objective-C
+ (nonnull STPPaymentMethodParams *) paramsWithCard:(nonnull STPPaymentMethodCardParams *)card billingDetails:(nullable STPPaymentMethodBillingDetails *)billingDetails metadata:(nullable NSDictionary<NSString *, NSString *> *)metadata;
Swift
/*not inherited*/ init(card: STPPaymentMethodCardParams, billingDetails: STPPaymentMethodBillingDetails?, metadata: [String : String]?)
Parameters
card
An object containing the user’s card details.
billingDetails
An object containing the user’s billing details.
metadata
Additional information to attach to the PaymentMethod.
-
Creates params for a card PaymentMethod.
Declaration
Objective-C
+ (nonnull STPPaymentMethodParams *) paramsWithiDEAL:(nonnull STPPaymentMethodiDEALParams *)iDEAL billingDetails:(nullable STPPaymentMethodBillingDetails *)billingDetails metadata:(nullable NSDictionary<NSString *, NSString *> *)metadata;
Swift
/*not inherited*/ init(iDEAL: STPPaymentMethodiDEALParams, billingDetails: STPPaymentMethodBillingDetails?, metadata: [String : String]?)
Parameters
iDEAL
An object containing the user’s iDEAL bank details.
billingDetails
An object containing the user’s billing details.
metadata
Additional information to attach to the PaymentMethod.