// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** import * as pulumi from "@pulumi/pulumi"; import * as utilities from "./utilities"; /** * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as stripe from "pulumi-stripe"; * * // card for the customer * const cardCard = new stripe.Card("cardCard", { * customer: stripe_customer.customer.id, * number: "4242424242424242", * cvc: 123, * expMonth: 8, * expYear: 2030, * }); * // card for the customer with address * const cardIndex_cardCard = new stripe.Card("cardIndex/cardCard", { * customer: stripe_customer.customer.id, * number: "4242424242424242", * cvc: 123, * expMonth: 8, * expYear: 2030, * address: { * line1: "1 The Best Street", * line2: "Apartment 401", * city: "Sydney", * state: "NSW", * zip: "2000", * country: "Australia", * }, * }); * ``` * * ## Import * * ```sh * $ pulumi import stripe:index/card:Card card * ``` */ export class Card extends pulumi.CustomResource { /** * Get an existing Card resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ public static get(name: string, id: pulumi.Input, state?: CardState, opts?: pulumi.CustomResourceOptions): Card { return new Card(name, state, { ...opts, id: id }); } /** @internal */ public static readonly __pulumiType = 'stripe:index/card:Card'; /** * Returns true if the given object is an instance of Card. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ public static isInstance(obj: any): obj is Card { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === Card.__pulumiType; } /** * Map(String). Address map with fields related to the address: `line1`, `line2`, `city`, `state` * , `zip` and `country`. */ public readonly address!: pulumi.Output<{[key: string]: string} | undefined>; /** * String. If address `line1` was provided, results of the check: `pass`, `fail`, `unavailable`, * or `unchecked`. */ public /*out*/ readonly addressLine1Check!: pulumi.Output; /** * String. If address `zip` was provided, results of the check: `pass`, `fail`, `unavailable`, * or `unchecked`. */ public /*out*/ readonly addressZipCheck!: pulumi.Output; /** * List(String). A set of available payout methods for this card. Only values from this set * should be passed as the method when creating a payout. */ public /*out*/ readonly availablePayoutMethods!: pulumi.Output; /** * String. Card brand. Can be `American Express`, `Diners Club`, `Discover`, `JCB`, `MasterCard`, `UnionPay` * , `Visa`, or `Unknown`. */ public /*out*/ readonly brand!: pulumi.Output; /** * String. Two-letter ISO code representing the country of the card. You could use this attribute to get a * sense of the international breakdown of cards you’ve collected. */ public /*out*/ readonly country!: pulumi.Output; /** * String. The customer that this card belongs to. */ public readonly customer!: pulumi.Output; /** * Int. Card security code. Highly recommended to always include this value, but it's required only * for accounts based in European countries. */ public readonly cvc!: pulumi.Output; /** * String. If a `cvc` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. A * result of `unchecked` indicates that CVC was provided but hasn’t been checked yet */ public /*out*/ readonly cvcCheck!: pulumi.Output; /** * Int. Number representing the card's expiration month. */ public readonly expMonth!: pulumi.Output; /** * Int. Four-digit number representing the card's expiration year. */ public readonly expYear!: pulumi.Output; /** * String. Uniquely identifies this particular card number. You can use this attribute to check whether * two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize * card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card * number. */ public /*out*/ readonly fingerprint!: pulumi.Output; /** * String. Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. */ public /*out*/ readonly funding!: pulumi.Output; /** * String. The last four digits of the card. */ public /*out*/ readonly last4!: pulumi.Output; /** * Map(String). Set of key-value pairs that you can attach to an object. This can be useful for * storing additional information about the object in a structured format. */ public readonly metadata!: pulumi.Output<{[key: string]: string} | undefined>; /** * String. Cardholder name. */ public readonly name!: pulumi.Output; /** * String. The card number, as a string without any separators. */ public readonly number!: pulumi.Output; /** * String. If the card number is tokenized, this is the method that was used. Can * be `androidPay` (includes Google Pay), `applePay`, `masterpass`, `visaCheckout`, or `null`. */ public /*out*/ readonly tokenizationMethod!: pulumi.Output; /** * Create a Card resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: CardArgs, opts?: pulumi.CustomResourceOptions) constructor(name: string, argsOrState?: CardArgs | CardState, opts?: pulumi.CustomResourceOptions) { let resourceInputs: pulumi.Inputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState as CardState | undefined; resourceInputs["address"] = state ? state.address : undefined; resourceInputs["addressLine1Check"] = state ? state.addressLine1Check : undefined; resourceInputs["addressZipCheck"] = state ? state.addressZipCheck : undefined; resourceInputs["availablePayoutMethods"] = state ? state.availablePayoutMethods : undefined; resourceInputs["brand"] = state ? state.brand : undefined; resourceInputs["country"] = state ? state.country : undefined; resourceInputs["customer"] = state ? state.customer : undefined; resourceInputs["cvc"] = state ? state.cvc : undefined; resourceInputs["cvcCheck"] = state ? state.cvcCheck : undefined; resourceInputs["expMonth"] = state ? state.expMonth : undefined; resourceInputs["expYear"] = state ? state.expYear : undefined; resourceInputs["fingerprint"] = state ? state.fingerprint : undefined; resourceInputs["funding"] = state ? state.funding : undefined; resourceInputs["last4"] = state ? state.last4 : undefined; resourceInputs["metadata"] = state ? state.metadata : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["number"] = state ? state.number : undefined; resourceInputs["tokenizationMethod"] = state ? state.tokenizationMethod : undefined; } else { const args = argsOrState as CardArgs | undefined; if ((!args || args.customer === undefined) && !opts.urn) { throw new Error("Missing required property 'customer'"); } if ((!args || args.expMonth === undefined) && !opts.urn) { throw new Error("Missing required property 'expMonth'"); } if ((!args || args.expYear === undefined) && !opts.urn) { throw new Error("Missing required property 'expYear'"); } if ((!args || args.number === undefined) && !opts.urn) { throw new Error("Missing required property 'number'"); } resourceInputs["address"] = args ? args.address : undefined; resourceInputs["customer"] = args ? args.customer : undefined; resourceInputs["cvc"] = args?.cvc ? pulumi.secret(args.cvc) : undefined; resourceInputs["expMonth"] = args ? args.expMonth : undefined; resourceInputs["expYear"] = args ? args.expYear : undefined; resourceInputs["metadata"] = args ? args.metadata : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["number"] = args?.number ? pulumi.secret(args.number) : undefined; resourceInputs["addressLine1Check"] = undefined /*out*/; resourceInputs["addressZipCheck"] = undefined /*out*/; resourceInputs["availablePayoutMethods"] = undefined /*out*/; resourceInputs["brand"] = undefined /*out*/; resourceInputs["country"] = undefined /*out*/; resourceInputs["cvcCheck"] = undefined /*out*/; resourceInputs["fingerprint"] = undefined /*out*/; resourceInputs["funding"] = undefined /*out*/; resourceInputs["last4"] = undefined /*out*/; resourceInputs["tokenizationMethod"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["cvc", "number"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(Card.__pulumiType, name, resourceInputs, opts); } } /** * Input properties used for looking up and filtering Card resources. */ export interface CardState { /** * Map(String). Address map with fields related to the address: `line1`, `line2`, `city`, `state` * , `zip` and `country`. */ address?: pulumi.Input<{[key: string]: pulumi.Input}>; /** * String. If address `line1` was provided, results of the check: `pass`, `fail`, `unavailable`, * or `unchecked`. */ addressLine1Check?: pulumi.Input; /** * String. If address `zip` was provided, results of the check: `pass`, `fail`, `unavailable`, * or `unchecked`. */ addressZipCheck?: pulumi.Input; /** * List(String). A set of available payout methods for this card. Only values from this set * should be passed as the method when creating a payout. */ availablePayoutMethods?: pulumi.Input[]>; /** * String. Card brand. Can be `American Express`, `Diners Club`, `Discover`, `JCB`, `MasterCard`, `UnionPay` * , `Visa`, or `Unknown`. */ brand?: pulumi.Input; /** * String. Two-letter ISO code representing the country of the card. You could use this attribute to get a * sense of the international breakdown of cards you’ve collected. */ country?: pulumi.Input; /** * String. The customer that this card belongs to. */ customer?: pulumi.Input; /** * Int. Card security code. Highly recommended to always include this value, but it's required only * for accounts based in European countries. */ cvc?: pulumi.Input; /** * String. If a `cvc` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. A * result of `unchecked` indicates that CVC was provided but hasn’t been checked yet */ cvcCheck?: pulumi.Input; /** * Int. Number representing the card's expiration month. */ expMonth?: pulumi.Input; /** * Int. Four-digit number representing the card's expiration year. */ expYear?: pulumi.Input; /** * String. Uniquely identifies this particular card number. You can use this attribute to check whether * two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize * card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card * number. */ fingerprint?: pulumi.Input; /** * String. Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. */ funding?: pulumi.Input; /** * String. The last four digits of the card. */ last4?: pulumi.Input; /** * Map(String). Set of key-value pairs that you can attach to an object. This can be useful for * storing additional information about the object in a structured format. */ metadata?: pulumi.Input<{[key: string]: pulumi.Input}>; /** * String. Cardholder name. */ name?: pulumi.Input; /** * String. The card number, as a string without any separators. */ number?: pulumi.Input; /** * String. If the card number is tokenized, this is the method that was used. Can * be `androidPay` (includes Google Pay), `applePay`, `masterpass`, `visaCheckout`, or `null`. */ tokenizationMethod?: pulumi.Input; } /** * The set of arguments for constructing a Card resource. */ export interface CardArgs { /** * Map(String). Address map with fields related to the address: `line1`, `line2`, `city`, `state` * , `zip` and `country`. */ address?: pulumi.Input<{[key: string]: pulumi.Input}>; /** * String. The customer that this card belongs to. */ customer: pulumi.Input; /** * Int. Card security code. Highly recommended to always include this value, but it's required only * for accounts based in European countries. */ cvc?: pulumi.Input; /** * Int. Number representing the card's expiration month. */ expMonth: pulumi.Input; /** * Int. Four-digit number representing the card's expiration year. */ expYear: pulumi.Input; /** * Map(String). Set of key-value pairs that you can attach to an object. This can be useful for * storing additional information about the object in a structured format. */ metadata?: pulumi.Input<{[key: string]: pulumi.Input}>; /** * String. Cardholder name. */ name?: pulumi.Input; /** * String. The card number, as a string without any separators. */ number: pulumi.Input; }