SCPSimulatedCard

Objective-C


@interface SCPSimulatedCard : NSObject

Swift

class SimulatedCard : NSObject

Simulated Card objects can be used with the shared SCPSimulatorConfiguration to simulate different card brand and error cases with a simulated Reader.

Simulated Card objects are backed by one of Stripe’s test card numbers, which are hardcoded to provide certain behavior within Stripe’s backend. The Terminal SDK provides an SCPSimulatedCardType enum that automatically maps to the card numbers for convenience.

  • Create a Simulated Card object with a given simulated card type.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithType:(SCPSimulatedCardType)type;

    Swift

    init(type: SimulatedCardType)
  • Create a Simulated Card object with a raw card number. This initializer is made available in case Stripe creates a new test card number without creating a corresponding SCPSimulatedCardType. The card number entered here must be in the list of test card numbers.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithTestCardNumber:
        (nonnull NSString *)testCardNumber;

    Swift

    init(testCardNumber: String)
  • Unavailable

    You cannot instantiate this class without specifying a type or testcard number.

    Declaration

    Objective-C

    - (nonnull instancetype)init;
  • Returns true if the card is online pin enabled.

    Declaration

    Objective-C

    - (BOOL)isOnlinePin;

    Swift

    func isOnlinePin() -> Bool
  • Returns true if the card is offline pin enabled.

    Declaration

    Objective-C

    - (BOOL)isOfflinePin;

    Swift

    func isOfflinePin() -> Bool
  • Unavailable

    You cannot instantiate this class without specifying a type or testcard number.

    Declaration

    Objective-C

    + (nonnull instancetype)new;