Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Api reference docs update for Payments - Create #4955

Merged
merged 25 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2c791f5
docs: openapi changes for Payments-Create
Jun 11, 2024
aedffd7
Payment-create-api-reference changes
Jun 11, 2024
13354fa
docs(openapi): re-generate OpenAPI specification
hyperswitch-bot[bot] Jun 11, 2024
c7aa077
Corrections based on first review
gorakhnathy7 Jun 12, 2024
2458c46
Payments-create and Payments-Response- Final
gorakhnathy7 Jun 12, 2024
e6a72dc
chore: run formatter
hyperswitch-bot[bot] Jun 12, 2024
e186350
docs(openapi): re-generate OpenAPI specification
hyperswitch-bot[bot] Jun 12, 2024
24fcc3d
Final Changes for Payments Module
gorakhnathy7 Jun 13, 2024
0a673ad
docs(openapi): re-generate OpenAPI specification
hyperswitch-bot[bot] Jun 13, 2024
7562637
Removing duplicate the Openapi/spec.json file
gorakhnathy7 Jun 14, 2024
c4f9626
few removals of the outdated fields
gorakhnathy7 Jun 24, 2024
bfcfabc
Updated schema to get custom response
gorakhnathy7 Jun 24, 2024
d6c026a
Updated schema to get custom response
gorakhnathy7 Jun 24, 2024
5a5937d
chore: run formatter
hyperswitch-bot[bot] Jun 24, 2024
8258a70
Update crates/api_models/src/payments.rs
gorakhnathy7 Jun 25, 2024
542fa52
Update crates/api_models/src/payments.rs
gorakhnathy7 Jun 25, 2024
34d623d
Update crates/api_models/src/payments.rs
gorakhnathy7 Jun 25, 2024
9f33045
Update crates/api_models/src/payments.rs
gorakhnathy7 Jun 25, 2024
9d8dec8
Update crates/common_enums/src/enums.rs
gorakhnathy7 Jun 25, 2024
1178905
Update crates/api_models/src/payments.rs
gorakhnathy7 Jun 25, 2024
245913d
docs(openapi): re-generate OpenAPI specification
hyperswitch-bot[bot] Jun 25, 2024
ff2ab6b
Merge branch 'main' into Api-reference-docs-update-payment-create
gorakhnathy7 Jun 27, 2024
5da110d
docs(openapi): re-generate OpenAPI specification
hyperswitch-bot[bot] Jun 27, 2024
0cfe34c
Merge branch 'main' into Api-reference-docs-update-payment-create
gorakhnathy7 Jun 27, 2024
151a1f9
Resolved conflicts.
gorakhnathy7 Jun 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
849 changes: 656 additions & 193 deletions api-reference/openapi_spec.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion crates/api_models/src/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -857,9 +857,11 @@ pub struct ToggleAllKVResponse {
#[schema(example = true)]
pub kv_enabled: bool,
}

/// Merchant connector details used to make payments.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field can be removed in all the three requests from the api ref

#[derive(Debug, Clone, Default, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct MerchantConnectorDetailsWrap {
/// Creds Identifier is to uniquely identify the credentials. Do not send any sensitive info in this field. And do not send the string "null".
/// Creds Identifier is to uniquely identify the credentials. Do not send any sensitive info, like encoded_data in this field. And do not send the string "null".
pub creds_identifier: String,
/// Merchant connector details type type. Base64 Encode the credentials and send it in this type and send as a string.
#[schema(value_type = Option<MerchantConnectorDetails>, example = r#"{
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 @@ -572,6 +572,7 @@ mod test {
}
}

/// Denotes the retry action
#[derive(
Debug,
serde::Deserialize,
Expand Down
1 change: 1 addition & 0 deletions crates/api_models/src/ephemeral_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use common_utils::id_type;
use serde;
use utoipa::ToSchema;

/// ephemeral_key for the customer_id mentioned
#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, Eq, PartialEq, ToSchema)]
pub struct EphemeralKeyCreateResponse {
/// customer_id to which this ephemeral key belongs to
Expand Down
1 change: 1 addition & 0 deletions crates/api_models/src/mandates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ pub struct MandateListConstraints {
pub created_time_gte: Option<PrimitiveDateTime>,
}

/// Details required for recurring payment
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema)]
#[serde(tag = "type", content = "data", rename_all = "snake_case")]
pub enum RecurringDetails {
Expand Down
98 changes: 67 additions & 31 deletions crates/api_models/src/payments.rs

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions crates/common_enums/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub mod diesel_exports {
};
}

/// The status of the attempt
#[derive(
Clone,
Copy,
Expand Down Expand Up @@ -205,6 +206,7 @@ impl AttemptStatus {
}
}

/// Pass this parameter to force 3DS or non 3DS auth for this payment. Some connectors will still force 3DS auth even in case of passing 'no_three_ds' here and vice versa. Default value is 'no_three_ds' if not set
#[derive(
Clone,
Copy,
Expand Down Expand Up @@ -232,6 +234,7 @@ pub enum AuthenticationType {
NoThreeDs,
}

/// The status of the capture
#[derive(
Clone,
Copy,
Expand Down Expand Up @@ -308,6 +311,7 @@ pub enum BlocklistDataKind {
ExtendedCardBin,
}

/// Default value if not passed is set to 'automatic' which results in Auth and Capture in one single API request. Pass 'manual' or 'manual_multiple' in case you want do a separate Auth and Capture by first authorizing and placing a hold on your customer's funds so that you can use the Payments/Capture endpoint later to capture the authorized amount. Pass 'manual' if you want to only capture the amount later once or 'manual_multiple' if you want to capture the funds multiple times later. Both 'manual' and 'manual_multiple' are only supported by a specific list of processors
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can have a macro do this for us. If you want to do this manually then can you create this as a list so that the statuses are much more readable

#[derive(
Clone,
Copy,
Expand Down Expand Up @@ -1164,6 +1168,7 @@ pub enum MerchantStorageScheme {
RedisKv,
}

/// The status of the current payment that was made
#[derive(
Clone,
Copy,
Expand Down Expand Up @@ -1197,6 +1202,7 @@ pub enum IntentStatus {
PartiallyCapturedAndCapturable,
}

/// Indicates that you intend to make future payments with this Payment’s payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.
#[derive(
Clone,
Copy,
Expand Down Expand Up @@ -1251,6 +1257,7 @@ pub enum PaymentMethodIssuerCode {
JpBacs,
}

/// Payment Method Status
#[derive(
Clone,
Copy,
Expand Down Expand Up @@ -1603,6 +1610,7 @@ pub enum CardNetwork {
Maestro,
}

/// Stage of the dispute
#[derive(
Clone,
Copy,
Expand All @@ -1627,6 +1635,7 @@ pub enum DisputeStage {
PreArbitration,
}

/// Status of the dispute
#[derive(
Clone,
Debug,
Expand Down Expand Up @@ -2499,6 +2508,7 @@ pub enum RoleScope {
Organization,
}

/// Indicates the transaction status
#[derive(
Clone,
Default,
Expand Down
1 change: 1 addition & 0 deletions crates/openapi/src/openapi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ Never share your secret api keys. Keep them guarded and secure.
api_models::payments::PaymentsUpdateRequest,
api_models::payments::PaymentsConfirmRequest,
api_models::payments::PaymentsResponse,
api_models::payments::PaymentsCreateResponseOpenApi,
api_models::payments::PaymentsStartRequest,
api_models::payments::PaymentRetrieveBody,
api_models::payments::PaymentsRetrieveRequest,
Expand Down
6 changes: 3 additions & 3 deletions crates/openapi/src/routes/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
),
),
responses(
(status = 200, description = "Payment created", body = PaymentsResponse),
(status = 200, description = "Payment created", body = PaymentsCreateResponseOpenApi),
(status = 400, description = "Missing Mandatory fields")
),
tag = "Payments",
Expand Down Expand Up @@ -268,7 +268,7 @@ pub fn payments_retrieve() {}
)
),
responses(
(status = 200, description = "Payment updated", body = PaymentsResponse),
(status = 200, description = "Payment updated", body = PaymentsCreateResponseOpenApi),
(status = 400, description = "Missing mandatory fields")
),
tag = "Payments",
Expand Down Expand Up @@ -326,7 +326,7 @@ pub fn payments_update() {}
)
),
responses(
(status = 200, description = "Payment confirmed", body = PaymentsResponse),
(status = 200, description = "Payment confirmed", body = PaymentsCreateResponseOpenApi),
(status = 400, description = "Missing mandatory fields")
),
tag = "Payments",
Expand Down
Loading