STPPaymentIntentParams

public class STPPaymentIntentParams : NSObject
extension STPPaymentIntentParams: STPFormEncodable
extension STPPaymentIntentParams: NSCopying

An object representing parameters used to confirm a PaymentIntent object. A PaymentIntent must have a PaymentMethod or Source associated in order to successfully confirm it. That PaymentMethod or Source can either be:

  • created during confirmation, by passing in a STPPaymentMethodParams or STPSourceParams object in the paymentMethodParams or sourceParams field
  • a pre-existing PaymentMethod or Source can be associated by passing its id in the paymentMethodId or sourceId field
  • or already set via your backend, either when creating or updating the PaymentIntent
  • Initialize this STPPaymentIntentParams with a clientSecret, which is the only required field.

    Declaration

    Swift

    @objc
    public init(clientSecret: String)

    Parameters

    clientSecret

    the client secret for this PaymentIntent

  • Initializes this STPPaymentIntentParams with a clientSecret and paymentMethodType. Use this initializer for PaymentIntents that already have a PaymentMethod attached.

    Declaration

    Swift

    @objc
    public init(clientSecret: String, paymentMethodType: STPPaymentMethodType)

    Parameters

    clientSecret

    the client secret for this PaymentIntent

    paymentMethodType

    the known type of the PaymentIntent’s attached PaymentMethod

  • The Stripe id of the PaymentIntent, extracted from the clientSecret.

    Declaration

    Swift

    @objc
    public var stripeId: String? { get }
  • The client secret of the PaymentIntent. Required

    Declaration

    Swift

    @objc
    public var clientSecret: String
  • Provide a supported STPPaymentMethodParams object, and Stripe will create a PaymentMethod during PaymentIntent confirmation. @note alternative to paymentMethodId

    Declaration

    Swift

    @objc
    public var paymentMethodParams: STPPaymentMethodParams?
  • Provide an already created PaymentMethod’s id, and it will be used to confirm the PaymentIntent. @note alternative to paymentMethodParams

    Declaration

    Swift

    @objc
    public var paymentMethodId: String?
  • Provide a supported STPSourceParams object into here, and Stripe will create a Source during PaymentIntent confirmation. @note alternative to sourceId

    Declaration

    Swift

    @objc
    public var sourceParams: STPSourceParams?
  • Provide an already created Source’s id, and it will be used to confirm the PaymentIntent. @note alternative to sourceParams

    Declaration

    Swift

    @objc
    public var sourceId: String?
  • Email address that the receipt for the resulting payment will be sent to.

    Declaration

    Swift

    @objc
    public var receiptEmail: String?
  • @YES to save this PaymentIntent’s PaymentMethod or Source to the associated Customer, if the PaymentMethod/Source is not already attached. This should be a boolean NSNumber, so that it can be nil

    Declaration

    Swift

    @objc
    public var savePaymentMethod: NSNumber?
  • The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method’s app or site. This should probably be a URL that opens your iOS app.

    Declaration

    Swift

    @objc
    public var returnURL: String?
  • When provided, this property indicates how you intend to use the payment method that your customer provides after the current payment completes. If applicable, additional authentication may be performed to comply with regional legislation or network rules required to enable the usage of the same payment method for additional payments.

    Declaration

    Swift

    public var setupFutureUsage: STPPaymentIntentSetupFutureUsage?
  • A boolean number to indicate whether you intend to use the Stripe SDK’s functionality to handle any PaymentIntent next actions. If set to false, STPPaymentIntent.nextAction will only ever contain a redirect url that can be opened in a webview or mobile browser. When set to true, the nextAction may contain information that the Stripe SDK can use to perform native authentication within your app.

    Declaration

    Swift

    @objc
    public var useStripeSDK: NSNumber?
  • Details about the Mandate to create. @note If this value is null and the (self.paymentMethod.type == STPPaymentMethodTypeSEPADebit | | self.paymentMethodParams.type == STPPaymentMethodTypeAUBECSDebit || self.paymentMethodParams.type == STPPaymentMethodTypeBacsDebit) && self.mandate == nil`, the SDK will set this to an internal value indicating that the mandate data should be inferred from the current context.

    Declaration

    Swift

    @objc
    public var mandateData: STPMandateDataParams? { get set }
  • Options to update the associated PaymentMethod during confirmation.

    Seealso

    STPConfirmPaymentMethodOptions

    Declaration

    Swift

    @objc
    public var paymentMethodOptions: STPConfirmPaymentMethodOptions?
  • Shipping information.

    Declaration

    Swift

    @objc
    public var shipping: STPPaymentIntentShippingDetailsParams?
  • The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method’s app or site. This property has been renamed to returnURL and deprecated.

    Declaration

    Swift

    @available(*, deprecated, renamed: "returnURL")
    @objc
    public var returnUrl: String? { get set }
  • @YES to save this PaymentIntent’s Source to the associated Customer, if the Source is not already attached. This should be a boolean NSNumber, so that it can be nil This property has been renamed to savePaymentMethod and deprecated.

    Declaration

    Swift

    @available(*, deprecated, renamed: "savePaymentMethod")
    @objc
    public var saveSourceToCustomer: NSNumber? { get set }
  • Provide an STPPaymentResult from STPPaymentContext, and this will populate the proper field (either paymentMethodId or paymentMethodParams) for your PaymentMethod.

    Declaration

    Swift

    @objc
    public func configure(with paymentResult: STPPaymentResult)

STPFormEncodable