From b32337fdb2f4bbf74717cf2acdcb3e8f3f28db5f Mon Sep 17 00:00:00 2001 From: Chris Kruger Date: Wed, 20 Dec 2023 07:33:40 +0800 Subject: [PATCH] add card create --- src/resources/card.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/resources/card.rs b/src/resources/card.rs index 1488b50..f784a69 100644 --- a/src/resources/card.rs +++ b/src/resources/card.rs @@ -1,4 +1,6 @@ +use crate::client::{Client, Response}; use crate::ids::{CardId}; +use crate::params::{unpack_contained}; use serde::{Deserialize, Serialize}; @@ -35,3 +37,9 @@ pub struct Card { pub customer_token: Option, pub primary: Option, } + +impl Card { + pub fn create(client: &Client, params: CardParams<'_>) -> Response { + unpack_contained(client.post_form(&format!("/cards"), ¶ms)) + } +}