STPPaymentIntentParams

@interface STPPaymentIntentParams : NSObject <STPFormEncodable>

An object representing parameters used to confirm a PaymentIntent object.

A PaymentIntent must have a Source associated in order to successfully confirm it.

That Source can either be:

  • created during confirmation, by passing in a STPSourceParams object in the sourceParams field
  • a pre-existing Source can be associated by passing its id in the 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

    Objective-C

    - (nonnull instancetype)initWithClientSecret:(nonnull NSString *)clientSecret;

    Swift

    init(clientSecret: String)

    Parameters

    clientSecret

    the client secret for this PaymentIntent

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

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic, nullable) NSString *stripeId;

    Swift

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

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSString *_Nonnull clientSecret;

    Swift

    var clientSecret: String { get set }
  • Provide a supported STPSourceParams object into here, and Stripe will create a Source during PaymentIntent confirmation.

    Note

    alternative to sourceId

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable) STPSourceParams *sourceParams;

    Swift

    var sourceParams: STPSourceParams? { get set }
  • Provide an already created Source’s id, and it will be used to confirm the PaymentIntent.

    Note

    alternative to sourceParams

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *sourceId;

    Swift

    var sourceId: String? { get set }
  • Email address that the receipt for the resulting payment will be sent to.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *receiptEmail;

    Swift

    var receiptEmail: 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

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable)
        NSNumber *saveSourceToCustomer;

    Swift

    var saveSourceToCustomer: NSNumber? { get set }
  • 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

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *returnURL;

    Swift

    var returnURL: String? { get set }
  • Deprecated

    returnUrl has been renamed to returnURL

    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

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *returnUrl;

    Swift

    var returnUrl: String? { get set }