STPPaymentMethodCardParams

@interface STPPaymentMethodCardParams : NSObject <STPFormEncodable>

The user’s card details.

  • A convenience initializer for creating a payment method from a card source. This should be used to help with migrations to Payment Methods from Sources.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithCardSourceParams:
        (nonnull STPCardParams *)cardSourceParams;

    Swift

    init(cardSourceParams: STPCardParams)
  • The card number, as a string without any separators. Ex. @4242424242424242

    Declaration

    Objective-C

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

    Swift

    var number: String? { get set }
  • Number representing the card’s expiration month. Ex. @1

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic, nullable) NSNumber *expMonth;

    Swift

    var expMonth: NSNumber? { get set }
  • Two- or four-digit number representing the card’s expiration year.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic, nullable) NSNumber *expYear;

    Swift

    var expYear: NSNumber? { get set }
  • For backwards compatibility, you can alternatively set this as a Stripe token (e.g., for apple pay)

    Declaration

    Objective-C

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

    Swift

    var token: String? { get set }
  • cvc

    Card security code. It is highly recommended to always include this value.

    Declaration

    Objective-C

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

    Swift

    var cvc: String? { get set }
  • The last 4 digits of the card.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) NSString *last4;

    Swift

    var last4: String? { get }