Skip to content

Commit

Permalink
add card create
Browse files Browse the repository at this point in the history
  • Loading branch information
montdidier committed Dec 19, 2023
1 parent 33e0a17 commit b32337f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/resources/card.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use crate::client::{Client, Response};
use crate::ids::{CardId};
use crate::params::{unpack_contained};

use serde::{Deserialize, Serialize};

Expand Down Expand Up @@ -35,3 +37,9 @@ pub struct Card {
pub customer_token: Option<String>,
pub primary: Option<bool>,
}

impl Card {
pub fn create(client: &Client, params: CardParams<'_>) -> Response<Card> {
unpack_contained(client.post_form(&format!("/cards"), &params))
}
}

0 comments on commit b32337f

Please sign in to comment.