feat(router): implement PaymentMethodInterface for MockDB (#1535)

This commit is contained in:
Panagiotis Ganelis
2023-06-26 20:30:46 +02:00
committed by GitHub
parent 0bc1e043fe
commit 772fc84577
3 changed files with 114 additions and 21 deletions

View File

@ -105,6 +105,14 @@ pub struct PaymentMethodUpdateInternal {
metadata: Option<serde_json::Value>,
}
impl PaymentMethodUpdateInternal {
pub fn create_payment_method(self, source: PaymentMethod) -> PaymentMethod {
let metadata = self.metadata.map(Secret::new);
PaymentMethod { metadata, ..source }
}
}
impl From<PaymentMethodUpdate> for PaymentMethodUpdateInternal {
fn from(payment_method_update: PaymentMethodUpdate) -> Self {
match payment_method_update {