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 generates 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
Determines if you have already used this token (you can only use tokens 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. You can use this token with any API method in place of a bank account dictionary.
You can only use this token once. To do so, attach 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
Auto Trait Implementations§
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnwindSafe for Token
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more