pub struct Token {
pub id: TokenId,
pub bank_account: Option<BankAccount>,
pub card: Option<Card>,
pub client_ip: Option<String>,
pub created: Timestamp,
pub livemode: bool,
pub type_: TokenType,
pub used: bool,
}
Expand description
The resource representing a Stripe “Token”.
For more details see https://stripe.com/docs/api/tokens/object
Fields§
§id: TokenId
Unique identifier for the object.
bank_account: Option<BankAccount>
§card: Option<Card>
§client_ip: Option<String>
IP address of the client that generated the token.
created: Timestamp
Time at which the object was created.
Measured in seconds since the Unix epoch.
livemode: bool
Has the value true
if the object exists in live mode or the value false
if the object exists in test mode.
type_: TokenType
Type of the token: account
, bank_account
, card
, or pii
.
used: bool
Whether this token has already been used (tokens can be used only once).
Implementations§
source§impl Token
impl Token
sourcepub fn create(client: &Client, params: CreateToken<'_>) -> Response<Token>
pub fn create(client: &Client, params: CreateToken<'_>) -> Response<Token>
Creates a single-use token that represents a bank account’s details. This token can be used with any API method in place of a bank account dictionary.
This token can be used only once, by attaching it to a Custom account.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Token
impl<'de> Deserialize<'de> for Token
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more