STPPaymentMethodParams
Objective-C
@interface STPPaymentMethodParams
: NSObject <STPFormEncodable, STPPaymentOption>
Swift
class STPPaymentMethodParams : NSObject, STPFormEncodable, STPPaymentOption
An object representing parameters used to create a PaymentMethod object.
Note
To create a PaymentMethod from an Apple Pay PKPaymentToken, see STPAPIClient createPaymentMethodWithPayment:completion:
-
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) 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, 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, nullable) STPPaymentMethodCardParams *card;
Swift
var card: STPPaymentMethodCardParams? { get set }
-
If this is an Alipay PaymentMethod, this contains additional details.
Declaration
Objective-C
@property (nonatomic, nullable) STPPaymentMethodAlipayParams *alipay;
Swift
var alipay: STPPaymentMethodAlipayParams? { get set }
-
If this is a iDEAL PaymentMethod, this contains details about user’s bank.
Declaration
Objective-C
@property (nonatomic, nullable) STPPaymentMethodiDEALParams *iDEAL;
Swift
var iDEAL: STPPaymentMethodiDEALParams? { get set }
-
If this is a FPX PaymentMethod, this contains details about user’s bank.
Declaration
Objective-C
@property (nonatomic, nullable) STPPaymentMethodFPXParams *fpx;
Swift
var fpx: STPPaymentMethodFPXParams? { get set }
-
If this is a SEPA Debit PaymentMethod, this contains details about the bank to debit.
Declaration
Objective-C
@property (nonatomic, nullable) STPPaymentMethodSEPADebitParams *sepaDebit;
Swift
var sepaDebit: STPPaymentMethodSEPADebitParams? { get set }
-
If this is a Bacs Debit PaymentMethod, this contains details about the bank account to debit.
Declaration
Objective-C
@property (nonatomic, nullable) STPPaymentMethodBacsDebitParams *bacsDebit;
Swift
var bacsDebit: STPPaymentMethodBacsDebitParams? { get set }
-
If this is an AU BECS Debit PaymentMethod, this contains details about the bank to debit.
Declaration
Objective-C
@property (nonatomic, nullable) STPPaymentMethodAUBECSDebitParams *auBECSDebit;
Swift
var auBECSDebit: STPPaymentMethodAUBECSDebitParams? { get set }
-
If this is a giropay PaymentMethod, this contains additional details.
Declaration
Objective-C
@property (nonatomic, nullable) STPPaymentMethodGiropayParams *giropay;
Swift
var giropay: STPPaymentMethodGiropayParams? { get set }
-
If this is a Przelewy24 PaymentMethod, this contains additional details.
Declaration
Objective-C
@property (nonatomic, nullable) STPPaymentMethodPrzelewy24Params *przelewy24;
Swift
var przelewy24: STPPaymentMethodPrzelewy24Params? { get set }
-
If this is an EPS PaymentMethod, this contains additional details.
Declaration
Objective-C
@property (nonatomic, nullable) STPPaymentMethodEPSParams *eps;
Swift
var eps: STPPaymentMethodEPSParams? { get set }
-
If this is a Bancontact PaymentMethod, this contains additional details.
Declaration
Objective-C
@property (nonatomic, nullable) STPPaymentMethodBancontactParams *bancontact;
Swift
var bancontact: STPPaymentMethodBancontactParams? { 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, 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 an iDEAL 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.
-
Creates params for an FPX PaymentMethod.
Declaration
Objective-C
+ (nonnull STPPaymentMethodParams *) paramsWithFPX:(nonnull STPPaymentMethodFPXParams *)fpx billingDetails:(nullable STPPaymentMethodBillingDetails *)billingDetails metadata:(nullable NSDictionary<NSString *, NSString *> *)metadata;
Swift
/*not inherited*/ init(fpx: STPPaymentMethodFPXParams, billingDetails: STPPaymentMethodBillingDetails?, metadata: [String : String]?)
Parameters
fpx
An object containing the user’s FPX bank details.
billingDetails
An object containing the user’s billing details.
metadata
Additional information to attach to the PaymentMethod.
-
Creates params for a SEPA Debit PaymentMethod;
Declaration
Objective-C
+ (nullable STPPaymentMethodParams *) paramsWithSEPADebit:(nonnull STPPaymentMethodSEPADebitParams *)sepaDebit billingDetails:(nonnull STPPaymentMethodBillingDetails *)billingDetails metadata: (nullable NSDictionary<NSString *, NSString *> *)metadata;
Swift
/*not inherited*/ init?(sepaDebit: STPPaymentMethodSEPADebitParams, billingDetails: STPPaymentMethodBillingDetails, metadata: [String : String]?)
Parameters
sepaDebit
An object containing the SEPA bank debit details.
billingDetails
An object containing the user’s billing details. Note that
billingDetails.name
is required for SEPA Debit PaymentMethods.metadata
Additional information to attach to the PaymentMethod.
-
Creates params for a Bacs Debit PaymentMethod;
Declaration
Objective-C
+ (nullable STPPaymentMethodParams *) paramsWithBacsDebit:(nonnull STPPaymentMethodBacsDebitParams *)bacsDebit billingDetails:(nonnull STPPaymentMethodBillingDetails *)billingDetails metadata: (nullable NSDictionary<NSString *, NSString *> *)metadata;
Swift
/*not inherited*/ init?(bacsDebit: STPPaymentMethodBacsDebitParams, billingDetails: STPPaymentMethodBillingDetails, metadata: [String : String]?)
Parameters
bacsDebit
An object containing the Bacs bank debit details.
billingDetails
An object containing the user’s billing details. Note that name, email, and address are required for Bacs Debit PaymentMethods.
metadata
Additional information to attach to the PaymentMethod.
-
Creates params for an AU BECS Debit PaymentMethod;
Declaration
Objective-C
+ (nullable STPPaymentMethodParams *) paramsWithAUBECSDebit: (nonnull STPPaymentMethodAUBECSDebitParams *)auBECSDebit billingDetails: (nonnull STPPaymentMethodBillingDetails *)billingDetails metadata: (nullable NSDictionary<NSString *, NSString *> *)metadata;
Swift
/*not inherited*/ init?(aubecsDebit auBECSDebit: STPPaymentMethodAUBECSDebitParams, billingDetails: STPPaymentMethodBillingDetails, metadata: [String : String]?)
Parameters
auBECSDebit
An object containing the AU BECS bank debit details.
billingDetails
An object containing the user’s billing details. Note that
billingDetails.name
andbillingDetails.email
are required for AU BECS Debit PaymentMethods.metadata
Additional information to attach to the PaymentMethod.
-
Creates params for a giropay PaymentMethod;
Declaration
Objective-C
+ (nullable STPPaymentMethodParams *) paramsWithGiropay:(nonnull STPPaymentMethodGiropayParams *)giropay billingDetails:(nonnull STPPaymentMethodBillingDetails *)billingDetails metadata:(nullable NSDictionary<NSString *, NSString *> *)metadata;
Swift
/*not inherited*/ init?(giropay: STPPaymentMethodGiropayParams, billingDetails: STPPaymentMethodBillingDetails, metadata: [String : String]?)
Parameters
giropay
An object containing additional giropay details.
billingDetails
An object containing the user’s billing details. Note that
billingDetails.name
is required for giropay PaymentMethods.metadata
Additional information to attach to the PaymentMethod.
-
Creates params for an EPS PaymentMethod;
Declaration
Objective-C
+ (nonnull STPPaymentMethodParams *) paramsWithEPS:(nonnull STPPaymentMethodEPSParams *)eps billingDetails:(nonnull STPPaymentMethodBillingDetails *)billingDetails metadata:(nullable NSDictionary<NSString *, NSString *> *)metadata;
Swift
/*not inherited*/ init(eps: STPPaymentMethodEPSParams, billingDetails: STPPaymentMethodBillingDetails, metadata: [String : String]?)
Parameters
eps
An object containing additional EPS details.
billingDetails
An object containing the user’s billing details. Note that
billingDetails.name
is required for EPS PaymentMethods.metadata
Additional information to attach to the PaymentMethod.
-
Creates params for a Przelewy24 PaymentMethod;
Declaration
Objective-C
+ (nullable STPPaymentMethodParams *) paramsWithPrzelewy24:(nonnull STPPaymentMethodPrzelewy24Params *)przelewy24 billingDetails: (nonnull STPPaymentMethodBillingDetails *)billingDetails metadata: (nullable NSDictionary<NSString *, NSString *> *)metadata;
Swift
/*not inherited*/ init?(przelewy24: STPPaymentMethodPrzelewy24Params, billingDetails: STPPaymentMethodBillingDetails, metadata: [String : String]?)
Parameters
przelewy24
An object containing additional Przelewy24 details.
billingDetails
An object containing the user’s billing details. Note that
billingDetails.email
is required for Przelewy24 PaymentMethods.metadata
Additional information to attach to the PaymentMethod.
-
Creates params for a Bancontact PaymentMethod;
Declaration
Objective-C
+ (nullable STPPaymentMethodParams *) paramsWithBancontact:(nonnull STPPaymentMethodBancontactParams *)bancontact billingDetails: (nonnull STPPaymentMethodBillingDetails *)billingDetails metadata: (nullable NSDictionary<NSString *, NSString *> *)metadata;
Swift
/*not inherited*/ init?(bancontact: STPPaymentMethodBancontactParams, billingDetails: STPPaymentMethodBillingDetails, metadata: [String : String]?)
Parameters
bancontact
An object containing additional Bancontact details.
billingDetails
An object containing the user’s billing details. Note that
billingDetails.name
is required for Bancontact PaymentMethods.metadata
Additional information to attach to the PaymentMethod.
-
Creates params for an Alipay PaymentMethod.
Declaration
Objective-C
+ (nonnull STPPaymentMethodParams *) paramsWithAlipay:(nonnull STPPaymentMethodAlipayParams *)alipay billingDetails:(nullable STPPaymentMethodBillingDetails *)billingDetails metadata:(nullable NSDictionary<NSString *, NSString *> *)metadata;
Swift
/*not inherited*/ init(alipay: STPPaymentMethodAlipayParams, billingDetails: STPPaymentMethodBillingDetails?, metadata: [String : String]?)
Parameters
billingDetails
An object containing the user’s billing details.
metadata
Additional information to attach to the PaymentMethod.
-
Creates params from a single-use PaymentMethod. This is useful for recreating a new payment method with similar settings. It will return nil if used with a reusable PaymentMethod.
Declaration
Objective-C
+ (nullable STPPaymentMethodParams *)paramsWithSingleUsePaymentMethod: (nonnull STPPaymentMethod *)paymentMethod;
Swift
/*not inherited*/ init?(singleUse paymentMethod: STPPaymentMethod)
Parameters
paymentMethod
An object containing the original single-use PaymentMethod.