STPPaymentConfiguration
Objective-C
@interface STPPaymentConfiguration : NSObject <NSCopying>
Swift
class STPPaymentConfiguration : NSObject, NSCopying
An STPPaymentConfiguration
represents all the options you can set or change
around a payment.
You provide an STPPaymentConfiguration
object to your STPPaymentContext
when making a charge. The configuration generally has settings that
will not change from payment to payment and thus is reusable, while the context
is specific to a single particular payment instance.
-
This is a convenience singleton configuration that uses the default values for every property
Declaration
Objective-C
+ (nonnull instancetype)sharedConfiguration;
Swift
class func shared() -> Self
-
An enum value representing which payment options you will accept from your user in addition to credit cards.
The default value is
STPPaymentOptionTypeDefault
, which includes only Apple Pay.Declaration
Objective-C
@property (nonatomic) STPPaymentOptionType additionalPaymentOptions;
Swift
var additionalPaymentOptions: STPPaymentOptionType { get set }
-
The billing address fields the user must fill out when prompted for their payment details. These fields will all be present on the returned PaymentMethod from Stripe.
The default value is
STPBillingAddressFieldsPostalCode
.Declaration
Objective-C
@property (nonatomic) STPBillingAddressFields requiredBillingAddressFields;
Swift
var requiredBillingAddressFields: STPBillingAddressFields { get set }
-
The shipping address fields the user must fill out when prompted for their shipping info. Set to nil if shipping address is not required.
The default value is nil.
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSSet<STPContactField> *requiredShippingAddressFields;
Swift
var requiredShippingAddressFields: Set<STPContactField>? { get set }
-
Whether the user should be prompted to verify prefilled shipping information.
The default value is YES.
Declaration
Objective-C
@property (nonatomic) BOOL verifyPrefilledShippingAddress;
Swift
var verifyPrefilledShippingAddress: Bool { get set }
-
The type of shipping for this purchase. This property sets the labels displayed when the user is prompted for shipping info, and whether they should also be asked to select a shipping method.
The default value is STPShippingTypeShipping.
Declaration
Objective-C
@property (nonatomic) STPShippingType shippingType;
Swift
var shippingType: STPShippingType { get set }
-
The set of countries supported when entering an address. This property accepts a set of ISO 2-character country codes.
The default value is all known countries. Setting this property will limit the available countries to your selected set.
Declaration
Objective-C
@property (nonatomic, copy, null_resettable) NSSet<NSString *> *availableCountries;
Swift
var availableCountries: Set<String>! { get set }
-
The name of your company, for displaying to the user during payment flows. For example, when using Apple Pay, the payment sheet’s final line item will read “PAY {companyName}”.
The default value is the name of your iOS application which is derived from the
kCFBundleNameKey
of[NSBundle mainBundle]
.Declaration
Objective-C
@property (nonatomic, copy) NSString *_Nonnull companyName;
Swift
var companyName: String { get set }
-
The Apple Merchant Identifier to use during Apple Pay transactions. To create one of these, see our guide at https://stripe.com/docs/mobile/apple-pay . You must set this to a valid identifier in order to automatically enable Apple Pay.
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSString *appleMerchantIdentifier;
Swift
var appleMerchantIdentifier: String? { get set }
-
Determines whether or not the user is able to delete payment options
This is only relevant to the
STPPaymentOptionsViewController
which, if enabled, will allow the user to delete payment options by tapping the “Edit” button in the navigation bar or by swiping left on a payment option and tapping “Delete”. Currently, the user is not allowed to delete the selected payment option but this may change in the future.Default value is YES but will only work if
STPPaymentOptionsViewController
is initialized with aSTPCustomerContext
either through theSTPPaymentContext
or directly as an init parameter.Declaration
Objective-C
@property (nonatomic) BOOL canDeletePaymentOptions;
Swift
var canDeletePaymentOptions: Bool { get set }
-
Deprecated
If you used [STPPaymentConfiguration sharedConfiguration].publishableKey, use [STPAPIClient sharedClient].publishableKey instead. If you passed a STPPaymentConfiguration instance to an SDK component, create an STPAPIClient, set publishableKey on it, and set the SDK component’s APIClient property.
If you used [STPPaymentConfiguration sharedConfiguration].publishableKey, use [STPAPIClient sharedClient].publishableKey instead. The SDK uses [STPAPIClient sharedClient] to make API requests by default.
Your Stripe publishable key
Declaration
Objective-C
@property (nonatomic, copy) DEPRECATED_MSG_ATTRIBUTE( "If you used [STPPaymentConfiguration sharedConfiguration].publishableKey, " "use [STPAPIClient sharedClient].publishableKey instead. If you passed a " "STPPaymentConfiguration instance to an SDK component, create an " "STPAPIClient, set publishableKey on it, and set the SDK component's " "APIClient property.") NSString *publishableKey;
Swift
var publishableKey: String { get set }
-
Deprecated
If you used [STPPaymentConfiguration sharedConfiguration].stripeAccount, use [STPAPIClient sharedClient].stripeAccount instead. If you passed a STPPaymentConfiguration instance to an SDK component, create an STPAPIClient, set stripeAccount on it, and set the SDK component’s APIClient property.
If you used [STPPaymentConfiguration sharedConfiguration].stripeAccount, use [STPAPIClient sharedClient].stripeAccount instead. The SDK uses [STPAPIClient sharedClient] to make API requests by default.
In order to perform API requests on behalf of a connected account, e.g. to create charges for a connected account, set this property to the ID of the account for which this request is being made.
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSString *stripeAccount;
Swift
var stripeAccount: String? { get set }