feat(router): add straight-through routing connector selection in payments (#153)

This commit is contained in:
ItsMeShashank
2022-12-19 18:43:04 +05:30
committed by GitHub
parent a5f0c98eb7
commit d6a3e508e2
26 changed files with 192 additions and 100 deletions

View File

@ -468,6 +468,34 @@ pub enum MandateStatus {
Revoked,
}
#[derive(
Clone,
Copy,
Debug,
Default,
Eq,
PartialEq,
serde::Deserialize,
serde::Serialize,
strum::Display,
strum::EnumString,
frunk::LabelledGeneric,
)]
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "snake_case")]
pub enum Connector {
Aci,
Adyen,
Applepay,
Authorizedotnet,
Braintree,
Checkout,
#[default]
Dummy,
Klarna,
Stripe,
}
impl From<AttemptStatus> for IntentStatus {
fn from(s: AttemptStatus) -> Self {
match s {

View File

@ -22,6 +22,7 @@ pub struct PaymentsRequest {
pub merchant_id: Option<String>,
#[serde(default, deserialize_with = "amount::deserialize_option")]
pub amount: Option<Amount>,
pub connector: Option<api_enums::Connector>,
pub currency: Option<String>,
pub capture_method: Option<api_enums::CaptureMethod>,
pub amount_to_capture: Option<i64>,