Skip to content

Commit

Permalink
address failing ci checks
Browse files Browse the repository at this point in the history
  • Loading branch information
ShankarSinghC committed Oct 19, 2023
1 parent f8c1c2d commit d16fc92
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 4 deletions.
4 changes: 3 additions & 1 deletion crates/api_models/src/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,9 +443,10 @@ pub mod payout_routing_algorithm {
}
}

#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Deserialize, Serialize, ToSchema)]
#[serde(tag = "type", content = "data", rename_all = "snake_case")]
pub enum RoutingAlgorithm {
#[schema(value_type = RoutableConnectors)]
Single(api_enums::RoutableConnectors),
}

Expand All @@ -458,6 +459,7 @@ pub enum RoutingAlgorithm {
into = "StraightThroughAlgorithmSerde"
)]
pub enum StraightThroughAlgorithm {
#[schema(value_type = RoutableConnectors)]
Single(api_enums::RoutableConnectors),
}

Expand Down
1 change: 1 addition & 0 deletions crates/api_models/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ impl Connector {
strum::EnumString,
strum::EnumIter,
strum::EnumVariantNames,
ToSchema
)]
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "snake_case")]
Expand Down
2 changes: 1 addition & 1 deletion crates/api_models/src/payouts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub struct PayoutCreateRequest {
pub currency: Option<api_enums::Currency>,

/// Specifies routing algorithm for selecting a connector
#[schema(value_type = Option<RoutingAlgorithm>, example = json!({
#[schema(value_type = Option<StraightThroughAlgorithm>, example = json!({
"type": "single",
"data": "adyen"
}))]
Expand Down
2 changes: 2 additions & 0 deletions crates/router/src/openapi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ Never share your secret api keys. Keep them guarded and secure.
api_models::enums::AttemptStatus,
api_models::enums::CaptureStatus,
api_models::enums::ReconStatus,
api_models::enums::RoutableConnectors,
api_models::admin::MerchantConnectorCreate,
api_models::admin::MerchantConnectorUpdate,
api_models::admin::PrimaryBusinessDetails,
Expand All @@ -182,6 +183,7 @@ Never share your secret api keys. Keep them guarded and secure.
api_models::admin::MerchantConnectorWebhookDetails,
api_models::admin::PaymentLinkConfig,
api_models::admin::PaymentLinkColorSchema,
api_models::admin::RoutingAlgorithm,
api_models::disputes::DisputeResponse,
api_models::disputes::DisputeResponsePaymentsRetrieve,
api_models::payments::AddressDetails,
Expand Down
86 changes: 84 additions & 2 deletions openapi/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -9973,7 +9973,7 @@
"routing": {
"allOf": [
{
"$ref": "#/components/schemas/RoutingAlgorithm"
"$ref": "#/components/schemas/StraightThroughAlgorithm"
}
],
"nullable": true
Expand Down Expand Up @@ -10946,6 +10946,88 @@
}
}
},
"RoutableConnectors": {
"type": "string",
"enum": [
"phonypay",
"fauxpay",
"pretendpay",
"stripe_test",
"adyen_test",
"checkout_test",
"paypal_test",
"aci",
"adyen",
"airwallex",
"authorizedotnet",
"bitpay",
"bambora",
"bluesnap",
"boku",
"braintree",
"cashtocode",
"checkout",
"coinbase",
"cryptopay",
"cybersource",
"dlocal",
"fiserv",
"forte",
"globalpay",
"globepay",
"gocardless",
"helcim",
"iatapay",
"klarna",
"mollie",
"multisafepay",
"nexinets",
"nmi",
"noon",
"nuvei",
"opennode",
"payme",
"paypal",
"payu",
"powertranz",
"rapyd",
"shift4",
"square",
"stax",
"stripe",
"trustpay",
"tsys",
"wise",
"worldline",
"worldpay",
"zen"
]
},
"RoutingAlgorithm": {
"oneOf": [
{
"type": "object",
"required": [
"type",
"data"
],
"properties": {
"type": {
"type": "string",
"enum": [
"single"
]
},
"data": {
"$ref": "#/components/schemas/RoutableConnectors"
}
}
}
],
"discriminator": {
"propertyName": "type"
}
},
"SamsungPayWalletData": {
"type": "object",
"required": [
Expand Down Expand Up @@ -11216,7 +11298,7 @@
]
},
"data": {
"$ref": "#/components/schemas/api_enums.RoutableConnectors"
"$ref": "#/components/schemas/RoutableConnectors"
}
}
}
Expand Down

0 comments on commit d16fc92

Please sign in to comment.