refactor(payouts): openAPI schemas and mintlify docs (#5284)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: Narayan Bhat <48803246+Narayanbhat166@users.noreply.github.com>
Co-authored-by: Vrishab Srivatsa <136090360+vsrivatsa-juspay@users.noreply.github.com>
Co-authored-by: Prajjwal Kumar <prajjwal.kumar@juspay.in>
This commit is contained in:
Kashif
2024-08-09 18:18:43 +05:30
committed by GitHub
parent 3183a86ecd
commit 942e63d9cd
31 changed files with 1781 additions and 915 deletions

View File

@ -5,10 +5,7 @@ use api_models::{
webhooks::{self as api},
};
#[cfg(feature = "payouts")]
use common_utils::{
crypto::Encryptable,
pii::{self, Email},
};
use common_utils::pii::{self, Email};
use common_utils::{crypto::SignMessage, date_time, ext_traits::Encode};
use error_stack::ResultExt;
use router_env::logger;
@ -167,16 +164,25 @@ impl From<common_enums::PayoutStatus> for StripePayoutStatus {
#[cfg(feature = "payouts")]
impl From<payout_models::PayoutCreateResponse> for StripePayoutResponse {
fn from(res: payout_models::PayoutCreateResponse) -> Self {
let (name, email, phone, phone_country_code) = match res.customer {
Some(customer) => (
customer.name,
customer.email,
customer.phone,
customer.phone_country_code,
),
None => (None, None, None, None),
};
Self {
id: res.payout_id,
amount: res.amount.get_amount_as_i64(),
currency: res.currency.to_string(),
payout_type: res.payout_type,
status: StripePayoutStatus::from(res.status),
name: res.name.map(Encryptable::into_inner),
email: res.email.map(|inner| inner.into()),
phone: res.phone.map(Encryptable::into_inner),
phone_country_code: res.phone_country_code,
name,
email,
phone,
phone_country_code,
created: res.created.map(|t| t.assume_utc().unix_timestamp()),
metadata: res.metadata,
entity_type: res.entity_type,