Struct square_api_client::api::CardsApi
source · pub struct CardsApi { /* private fields */ }
Expand description
Use the Cards API to save a credit or debit card on file.
Implementations§
source§impl CardsApi
impl CardsApi
sourcepub fn new(config: Configuration, client: HttpClient) -> Self
pub fn new(config: Configuration, client: HttpClient) -> Self
Instantiates a new CardsApi
sourcepub async fn create_card(
&self,
body: &CreateCardRequest
) -> Result<CreateCardResponse, ApiError>
pub async fn create_card(
&self,
body: &CreateCardRequest
) -> Result<CreateCardResponse, ApiError>
Adds a card on file to an existing merchant.
sourcepub async fn disable_card(
&self,
card_id: &str
) -> Result<DisableCardResponse, ApiError>
pub async fn disable_card(
&self,
card_id: &str
) -> Result<DisableCardResponse, ApiError>
Disables the card, preventing any further updates or charges.
Disabling an already disabled card is allowed but has no effect.
sourcepub async fn list_cards(
&self,
params: &ListCardsParameters
) -> Result<ListCardsResponse, ApiError>
pub async fn list_cards(
&self,
params: &ListCardsParameters
) -> Result<ListCardsResponse, ApiError>
Retrieves a list of cards owned by the account making the request.
A max of 25 cards will be returned.
sourcepub async fn retrieve_card(
&self,
card_id: &str
) -> Result<RetrieveCardResponse, ApiError>
pub async fn retrieve_card(
&self,
card_id: &str
) -> Result<RetrieveCardResponse, ApiError>
Retrieves details for a specific Card.