diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs index a4705057be..a06d642010 100644 --- a/crates/api_models/src/payments.rs +++ b/crates/api_models/src/payments.rs @@ -1096,51 +1096,100 @@ pub struct GpaySessionTokenData { #[serde(rename_all = "lowercase")] pub enum SessionToken { /// The session response structure for Google Pay - Gpay { - /// The merchant info - merchant_info: GpayMerchantInfo, - /// List of the allowed payment meythods - allowed_payment_methods: Vec, - /// The transaction info Google Pay requires - transaction_info: GpayTransactionInfo, - }, + Gpay(Box), /// The session response structure for Klarna - Klarna { - /// The session token for Klarna - session_token: String, - /// The identifier for the session - session_id: String, - }, + Klarna(Box), /// The session response structure for PayPal - Paypal { - /// The session token for PayPal - session_token: String, - }, + Paypal(Box), /// The session response structure for Apple Pay - Applepay { - /// Timestamp at which session is requested - epoch_timestamp: u64, - /// Timestamp at which session expires - expires_at: u64, - /// The identifier for the merchant session - merchant_session_identifier: String, - /// Applepay generates unique ID (UUID) value - nonce: String, - /// The identifier for the merchant - merchant_identifier: String, - /// The domain name of the merchant which is registered in Apple Pay - domain_name: String, - /// The name to be displayed on Apple Pay button - display_name: String, - /// A string which represents the properties of a payment - signature: String, - /// The identifier for the operational analytics - operational_analytics_identifier: String, - /// The number of retries to get the session response - retries: u8, - /// The identifier for the connector transaction - psp_id: String, - }, + Applepay(Box), +} + +#[derive(Debug, Clone, serde::Serialize, ToSchema)] +#[serde(rename_all = "lowercase")] +pub struct GpayData { + /// The merchant info + pub merchant_info: GpayMerchantInfo, + /// List of the allowed payment meythods + pub allowed_payment_methods: Vec, + /// The transaction info Google Pay requires + pub transaction_info: GpayTransactionInfo, +} + +#[derive(Debug, Clone, serde::Serialize, ToSchema)] +#[serde(rename_all = "lowercase")] +pub struct KlarnaData { + /// The session token for Klarna + pub session_token: String, + /// The identifier for the session + pub session_id: String, +} + +#[derive(Debug, Clone, serde::Serialize, ToSchema)] +#[serde(rename_all = "lowercase")] +pub struct PaypalData { + /// The session token for PayPal + pub session_token: String, +} + +#[derive(Debug, Clone, serde::Serialize, ToSchema)] +#[serde(rename_all = "lowercase")] +pub struct ApplepayData { + /// Session object for Apple Pay + pub session_object: ApplePaySessionObject, + /// Payment request object for Apple Pay + pub payment_request_object: ApplePayRequest, +} + +#[derive(Debug, Clone, serde::Serialize, ToSchema, serde::Deserialize)] +pub struct ApplePaySessionObject { + /// Timestamp at which session is requested + pub epoch_timestamp: u64, + /// Timestamp at which session expires + pub expires_at: u64, + /// The identifier for the merchant session + pub merchant_session_identifier: String, + /// Applepay generates unique ID (UUID) value + pub nonce: String, + /// The identifier for the merchant + pub merchant_identifier: String, + /// The domain name of the merchant which is registered in Apple Pay + pub domain_name: String, + /// The name to be displayed on Apple Pay button + pub display_name: String, + /// A string which represents the properties of a payment + pub signature: String, + /// The identifier for the operational analytics + pub operational_analytics_identifier: String, + /// The number of retries to get the session response + pub retries: u8, + /// The identifier for the connector transaction + pub psp_id: String, +} + +#[derive(Debug, Clone, serde::Serialize, ToSchema, serde::Deserialize)] +pub struct ApplePayRequest { + /// The code for country + pub country_code: String, + /// The code for currency + pub currency_code: String, + /// Represents the total for the payment. + pub total: AmountInfo, + /// The list of merchant capabilities(ex: whether capable of 3ds or no-3ds) + pub merchant_capabilities: Vec, + /// The list of supported networks + pub supported_networks: Vec, +} + +#[derive(Debug, Clone, serde::Serialize, ToSchema, serde::Deserialize)] +pub struct AmountInfo { + /// the label must be non-empty to pass validation. + pub label: String, + /// The type of label + #[serde(rename = "type")] + pub label_type: String, + /// The total amount for the payment + pub amount: String, } #[derive(Default, Debug, serde::Serialize, Clone, ToSchema)] diff --git a/crates/router/src/connector/applepay.rs b/crates/router/src/connector/applepay.rs index edcd40127c..3687c3b782 100644 --- a/crates/router/src/connector/applepay.rs +++ b/crates/router/src/connector/applepay.rs @@ -197,11 +197,11 @@ impl .get_required_value("connector_meta_data") .change_context(errors::ConnectorError::NoConnectorMetaData)?; - let session_object: transformers::SessionObject = metadata - .parse_value("SessionObject") + let metadata: transformers::ApplePayMetaData = metadata + .parse_value("ApplePayMetaData") .change_context(errors::ConnectorError::RequestEncodingFailed)?; - Ok(Some(session_object.certificate)) + Ok(Some(metadata.session_object.certificate)) } fn get_certificate_key( @@ -214,11 +214,11 @@ impl .get_required_value("connector_meta_data") .change_context(errors::ConnectorError::NoConnectorMetaData)?; - let session_object: transformers::SessionObject = metadata - .parse_value("SessionObject") + let metadata: transformers::ApplePayMetaData = metadata + .parse_value("ApplePayMetaData") .change_context(errors::ConnectorError::RequestEncodingFailed)?; - Ok(Some(session_object.certificate_keys)) + Ok(Some(metadata.session_object.certificate_keys)) } } diff --git a/crates/router/src/connector/applepay/transformers.rs b/crates/router/src/connector/applepay/transformers.rs index 44379991fc..3488c2126e 100644 --- a/crates/router/src/connector/applepay/transformers.rs +++ b/crates/router/src/connector/applepay/transformers.rs @@ -1,3 +1,4 @@ +use api_models::payments; use common_utils::ext_traits::ValueExt; use error_stack::ResultExt; use masking::{Deserialize, Serialize}; @@ -16,17 +17,17 @@ pub struct ApplepaySessionRequest { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct ApplepaySessionResponse { - epoch_timestamp: u64, - expires_at: u64, - merchant_session_identifier: String, - nonce: String, - merchant_identifier: String, - domain_name: String, - display_name: String, - signature: String, - operational_analytics_identifier: String, - retries: u8, - psp_id: String, + pub epoch_timestamp: u64, + pub expires_at: u64, + pub merchant_session_identifier: String, + pub nonce: String, + pub merchant_identifier: String, + pub domain_name: String, + pub display_name: String, + pub signature: String, + pub operational_analytics_identifier: String, + pub retries: u8, + pub psp_id: String, } #[derive(Debug, Default, Serialize, Deserialize)] @@ -36,6 +37,19 @@ pub struct ErrorResponse { pub status_message: String, } +#[derive(Debug, Default, Serialize, Deserialize)] +pub struct ApplePayMetaData { + pub payment_object: PaymentObjectMetaData, + pub session_object: SessionObject, +} + +#[derive(Debug, Default, Serialize, Deserialize)] +pub struct PaymentObjectMetaData { + pub supported_networks: Vec, + pub merchant_capabilities: Vec, + pub label: String, +} + #[derive(Debug, Default, Serialize, Deserialize)] pub struct SessionObject { pub certificate: String, @@ -46,6 +60,25 @@ pub struct SessionObject { pub initiative_context: String, } +#[derive(Debug, Default, Serialize, Deserialize)] +#[serde(rename_all = "snake_case")] +pub struct PaymentRequest { + pub apple_pay_merchant_id: String, + pub country_code: String, + pub currency_code: String, + pub total: AmountInfo, + pub merchant_capabilities: Vec, + pub supported_networks: Vec, +} + +#[derive(Debug, Default, Serialize, Deserialize)] +pub struct AmountInfo { + pub label: String, + #[serde(rename = "type")] + pub label_type: String, + pub amount: String, +} + impl TryFrom<&types::PaymentsSessionRouterData> for ApplepaySessionRequest { type Error = error_stack::Report; fn try_from(item: &types::PaymentsSessionRouterData) -> Result { @@ -55,48 +88,136 @@ impl TryFrom<&types::PaymentsSessionRouterData> for ApplepaySessionRequest { .get_required_value("connector_meta_data") .change_context(errors::ConnectorError::NoConnectorMetaData)?; - let session_object: SessionObject = metadata - .parse_value("SessionObject") + let metadata: ApplePayMetaData = metadata + .parse_value("ApplePayMetaData") .change_context(errors::ConnectorError::RequestEncodingFailed)?; Ok(Self { - merchant_identifier: session_object.merchant_identifier, - display_name: session_object.display_name, - initiative: session_object.initiative, - initiative_context: session_object.initiative_context, + merchant_identifier: metadata.session_object.merchant_identifier, + display_name: metadata.session_object.display_name, + initiative: metadata.session_object.initiative, + initiative_context: metadata.session_object.initiative_context, }) } } -impl - TryFrom> - for types::RouterData +impl + TryFrom< + types::ResponseRouterData< + F, + ApplepaySessionResponse, + types::PaymentsSessionData, + types::PaymentsResponseData, + >, + > for types::RouterData { type Error = error_stack::Report; fn try_from( - item: types::ResponseRouterData, + item: types::ResponseRouterData< + F, + ApplepaySessionResponse, + types::PaymentsSessionData, + types::PaymentsResponseData, + >, ) -> Result { + let metadata = item + .data + .connector_meta_data + .to_owned() + .get_required_value("connector_meta_data") + .change_context(errors::ConnectorError::NoConnectorMetaData)?; + + let metadata: ApplePayMetaData = metadata + .parse_value("ApplePayMetaData") + .change_context(errors::ConnectorError::RequestEncodingFailed)?; + + let amount_info = AmountInfo { + label: metadata.payment_object.label, + label_type: "final".to_string(), + amount: (item.data.request.amount / 100).to_string(), + }; + + let payment_request = PaymentRequest { + country_code: item + .data + .request + .country + .to_owned() + .get_required_value("country_code") + .change_context(errors::ConnectorError::MissingRequiredField { + field_name: "country_code", + })?, + currency_code: item.data.request.currency.to_string(), + total: amount_info, + merchant_capabilities: metadata.payment_object.merchant_capabilities, + supported_networks: metadata.payment_object.supported_networks, + apple_pay_merchant_id: metadata.session_object.merchant_identifier, + }; + + let applepay_session_object = ApplepaySessionResponse { + epoch_timestamp: item.response.epoch_timestamp, + expires_at: item.response.expires_at, + merchant_session_identifier: item.response.merchant_session_identifier, + nonce: item.response.nonce, + merchant_identifier: item.response.merchant_identifier, + domain_name: item.response.domain_name, + display_name: item.response.display_name, + signature: item.response.signature, + operational_analytics_identifier: item.response.operational_analytics_identifier, + retries: item.response.retries, + psp_id: item.response.psp_id, + }; + Ok(Self { response: Ok(types::PaymentsResponseData::SessionResponse { session_token: { - api_models::payments::SessionToken::Applepay { - epoch_timestamp: item.response.epoch_timestamp, - expires_at: item.response.expires_at, - merchant_session_identifier: item.response.merchant_session_identifier, - nonce: item.response.nonce, - merchant_identifier: item.response.merchant_identifier, - domain_name: item.response.domain_name, - display_name: item.response.display_name, - signature: item.response.signature, - operational_analytics_identifier: item - .response - .operational_analytics_identifier, - retries: item.response.retries, - psp_id: item.response.psp_id, - } + api_models::payments::SessionToken::Applepay(Box::new(payments::ApplepayData { + session_object: applepay_session_object.into(), + payment_request_object: payment_request.into(), + })) }, }), ..item.data }) } } + +impl From for payments::ApplePayRequest { + fn from(value: PaymentRequest) -> Self { + Self { + country_code: value.country_code, + currency_code: value.currency_code, + total: value.total.into(), + merchant_capabilities: value.merchant_capabilities, + supported_networks: value.supported_networks, + } + } +} + +impl From for payments::AmountInfo { + fn from(value: AmountInfo) -> Self { + Self { + label: value.label, + label_type: value.label_type, + amount: value.amount, + } + } +} + +impl From for payments::ApplePaySessionObject { + fn from(value: ApplepaySessionResponse) -> Self { + Self { + epoch_timestamp: value.epoch_timestamp, + expires_at: value.expires_at, + merchant_session_identifier: value.merchant_session_identifier, + nonce: value.nonce, + merchant_identifier: value.merchant_identifier, + domain_name: value.domain_name, + display_name: value.display_name, + signature: value.signature, + operational_analytics_identifier: value.operational_analytics_identifier, + retries: value.retries, + psp_id: value.psp_id, + } + } +} diff --git a/crates/router/src/connector/braintree/transformers.rs b/crates/router/src/connector/braintree/transformers.rs index e2ca6ae93f..09962ecd78 100644 --- a/crates/router/src/connector/braintree/transformers.rs +++ b/crates/router/src/connector/braintree/transformers.rs @@ -1,3 +1,4 @@ +use api_models::payments; use base64::Engine; use error_stack::ResultExt; use serde::{Deserialize, Serialize}; @@ -243,9 +244,9 @@ impl ) -> Result { Ok(Self { response: Ok(types::PaymentsResponseData::SessionResponse { - session_token: types::api::SessionToken::Paypal { + session_token: types::api::SessionToken::Paypal(Box::new(payments::PaypalData { session_token: item.response.client_token.value, - }, + })), }), ..item.data }) diff --git a/crates/router/src/connector/klarna/transformers.rs b/crates/router/src/connector/klarna/transformers.rs index 589eeecf19..2d4a02289b 100644 --- a/crates/router/src/connector/klarna/transformers.rs +++ b/crates/router/src/connector/klarna/transformers.rs @@ -1,3 +1,4 @@ +use api_models::payments; use error_stack::report; use serde::{Deserialize, Serialize}; @@ -71,10 +72,10 @@ impl TryFrom> let response = &item.response; Ok(Self { response: Ok(types::PaymentsResponseData::SessionResponse { - session_token: types::api::SessionToken::Klarna { + session_token: types::api::SessionToken::Klarna(Box::new(payments::KlarnaData { session_token: response.client_token.clone(), session_id: response.session_id.clone(), - }, + })), }), ..item.data }) diff --git a/crates/router/src/core/payments/flows/session_flow.rs b/crates/router/src/core/payments/flows/session_flow.rs index 158edcbc81..b2950004db 100644 --- a/crates/router/src/core/payments/flows/session_flow.rs +++ b/crates/router/src/core/payments/flows/session_flow.rs @@ -91,11 +91,11 @@ fn create_gpay_session_token( let response_router_data = types::PaymentsSessionRouterData { response: Ok(types::PaymentsResponseData::SessionResponse { - session_token: payment_types::SessionToken::Gpay { - transaction_info, + session_token: payment_types::SessionToken::Gpay(Box::new(payment_types::GpayData { merchant_info: gpay_data.data.merchant_info, allowed_payment_methods: gpay_data.data.allowed_payment_methods, - }, + transaction_info, + })), }), ..router_data.clone() }; diff --git a/crates/router/src/openapi.rs b/crates/router/src/openapi.rs index 89032a53ea..9be89d49bf 100644 --- a/crates/router/src/openapi.rs +++ b/crates/router/src/openapi.rs @@ -173,12 +173,19 @@ Never share your secret api keys. Keep them guarded and secure. api_models::payments::PaymentsSessionRequest, api_models::payments::PaymentsSessionResponse, api_models::payments::SessionToken, + api_models::payments::ApplePaySessionObject, + api_models::payments::ApplePayRequest, + api_models::payments::AmountInfo, api_models::payments::GpayMerchantInfo, api_models::payments::GpayAllowedPaymentMethods, api_models::payments::GpayAllowedMethodsParameters, api_models::payments::GpayTokenizationSpecification, api_models::payments::GpayTokenParameters, api_models::payments::GpayTransactionInfo, + api_models::payments::GpayData, + api_models::payments::KlarnaData, + api_models::payments::PaypalData, + api_models::payments::ApplepayData, api_models::payments::PaymentsCancelRequest, api_models::payments::PaymentListConstraints, api_models::payments::PaymentListResponse, diff --git a/openapi/generated.json b/openapi/generated.json index 28273b8b5b..ad3192abbc 100644 --- a/openapi/generated.json +++ b/openapi/generated.json @@ -2,7 +2,7 @@ "openapi": "3.0.3", "info": { "title": "Hyperswitch - API Documentation", - "description": "\n## Get started\n\nHyperswitch provides a collection of APIs that enable you to process and manage payments.\nOur APIs accept and return JSON in the HTTP body, and return standard HTTP response codes.\n\nYou can consume the APIs directly using your favorite HTTP/REST library.\n\nWe have a testing environment referred to \"sandbox\", which you can setup to test API calls without\naffecting production data. Currently, our sandbox environment is live while our production environment is under development and will be available soon. You can sign up on our Dashboard to get API keys to access Hyperswitch API.\n\n### Environment\n\nUse the following base URLs when making requests to the APIs:\n\n| Environment | Base URL |\n|---------------|------------------------------------|\n| Sandbox | |\n| Production | Coming Soon! |\n\n## Authentication\n\nWhen you sign up on our [dashboard](https://app.hyperswitch.io) and create a merchant\naccount, you are given a secret key (also referred as api-key) and a publishable key.\nYou may authenticate all API requests with Hyperswitch server by providing the appropriate key in the\nrequest Authorization header.\n\n| Key | Description |\n|---------------|-----------------------------------------------------------------------------------------------|\n| Sandbox | Private key. Used to authenticate all API requests from your merchant server |\n| Production | Unique identifier for your account. Used to authenticate API requests from your app’s client |\n\nNever share your secret api keys. Keep them guarded and secure.\n", + "description": "\n## Get started\n\nHyperswitch provides a collection of APIs that enable you to process and manage payments.\nOur APIs accept and return JSON in the HTTP body, and return standard HTTP response codes.\n\nYou can consume the APIs directly using your favorite HTTP/REST library.\n\nWe have a testing environment referred to \"sandbox\", which you can setup to test API calls without\naffecting production data.\nCurrently, our sandbox environment is live while our production environment is under development\nand will be available soon.\nYou can sign up on our Dashboard to get API keys to access Hyperswitch API.\n\n### Environment\n\nUse the following base URLs when making requests to the APIs:\n\n| Environment | Base URL |\n|---------------|------------------------------------|\n| Sandbox | |\n| Production | Coming Soon! |\n\n## Authentication\n\nWhen you sign up on our [dashboard](https://app.hyperswitch.io) and create a merchant\naccount, you are given a secret key (also referred as api-key) and a publishable key.\nYou may authenticate all API requests with Hyperswitch server by providing the appropriate key in\nthe request Authorization header.\n\n| Key | Description |\n|---------------|-----------------------------------------------------------------------------------------------|\n| Sandbox | Private key. Used to authenticate all API requests from your merchant server |\n| Production | Unique identifier for your account. Used to authenticate API requests from your app's client |\n\nNever share your secret api keys. Keep them guarded and secure.\n", "contact": { "name": "Hyperswitch Support", "url": "https://hyperswitch.io", @@ -22,7 +22,9 @@ "paths": { "/accounts": { "post": { - "tags": ["Merchant Account"], + "tags": [ + "Merchant Account" + ], "summary": "", "description": "\nCreate a new account for a merchant and the merchant could be a seller or retailer or client who likes to receive and send payments.", "operationId": "Create a Merchant Account", @@ -56,7 +58,9 @@ }, "/accounts/{account_id}": { "get": { - "tags": ["Merchant Account"], + "tags": [ + "Merchant Account" + ], "summary": "", "description": "\nRetrieve a merchant account details.", "operationId": "Retrieve a Merchant Account", @@ -89,7 +93,9 @@ "deprecated": false }, "post": { - "tags": ["Merchant Account"], + "tags": [ + "Merchant Account" + ], "summary": "", "description": "\nTo update an existing merchant account. Helpful in updating merchant details such as email, contact details, or other configuration details like webhook, routing algorithm etc", "operationId": "Update a Merchant Account", @@ -132,7 +138,9 @@ "deprecated": false }, "delete": { - "tags": ["Merchant Account"], + "tags": [ + "Merchant Account" + ], "summary": "", "description": "\nTo delete a merchant account", "operationId": "Delete a Merchant Account", @@ -167,7 +175,9 @@ }, "/accounts/{account_id}/connectors": { "get": { - "tags": ["Merchant Connector Account"], + "tags": [ + "Merchant Connector Account" + ], "summary": "", "description": "\nList Payment Connector Details for the merchant", "operationId": "List all Merchant Connectors", @@ -206,7 +216,9 @@ "deprecated": false }, "post": { - "tags": ["Merchant Connector Account"], + "tags": [ + "Merchant Connector Account" + ], "summary": "", "description": "\nCreate a new Payment Connector for the merchant account. The connector could be a payment processor / facilitator / acquirer or specialized services like Fraud / Accounting etc.\"", "operationId": "Create a Merchant Connector", @@ -240,7 +252,9 @@ }, "/accounts/{account_id}/connectors/{connector_id}": { "get": { - "tags": ["Merchant Connector Account"], + "tags": [ + "Merchant Connector Account" + ], "summary": "", "description": "\nRetrieve Payment Connector Details", "operationId": "Retrieve a Merchant Connector", @@ -286,7 +300,9 @@ "deprecated": false }, "post": { - "tags": ["Merchant Connector Account"], + "tags": [ + "Merchant Connector Account" + ], "summary": "", "description": "\nTo update an existing Payment Connector. Helpful in enabling / disabling different payment methods and other settings for the connector etc.", "operationId": "Update a Merchant Connector", @@ -342,7 +358,9 @@ "deprecated": false }, "delete": { - "tags": ["Merchant Connector Account"], + "tags": [ + "Merchant Connector Account" + ], "summary": "", "description": "\nDelete or Detach a Payment Connector from Merchant Account", "operationId": "Delete a Merchant Connector", @@ -388,7 +406,7 @@ "deprecated": false } }, - "/api_keys": { + "/api_keys/{merchant_id)": { "post": { "tags": [ "API Key" @@ -424,7 +442,44 @@ "deprecated": false } }, - "/api_keys/list": { + "/api_keys/{merchant_id)/{key_id}": { + "delete": { + "tags": [ + "API Key" + ], + "summary": "API Key - Revoke", + "description": "API Key - Revoke\n\nRevoke the specified API Key. Once revoked, the API Key can no longer be used for\nauthenticating with our APIs.", + "operationId": "Revoke an API Key", + "parameters": [ + { + "name": "key_id", + "in": "path", + "description": "The unique identifier for the API Key", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "API Key revoked", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RevokeApiKeyResponse" + } + } + } + }, + "404": { + "description": "API Key not found" + } + }, + "deprecated": false + } + }, + "/api_keys/{merchant_id}/list": { "get": { "tags": [ "API Key" @@ -472,7 +527,7 @@ "deprecated": false } }, - "/api_keys/{key_id}": { + "/api_keys/{merchant_id}/{key_id}": { "get": { "tags": [ "API Key" @@ -552,46 +607,13 @@ } }, "deprecated": false - }, - "delete": { - "tags": [ - "API Key" - ], - "summary": "API Key - Revoke", - "description": "API Key - Revoke\n\nRevoke the specified API Key. Once revoked, the API Key can no longer be used for\nauthenticating with our APIs.", - "operationId": "Revoke an API Key", - "parameters": [ - { - "name": "key_id", - "in": "path", - "description": "The unique identifier for the API Key", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "API Key revoked", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RevokeApiKeyResponse" - } - } - } - }, - "404": { - "description": "API Key not found" - } - }, - "deprecated": false } }, "/customers": { "post": { - "tags": ["Customers"], + "tags": [ + "Customers" + ], "summary": "", "description": "\nCreate a customer object and store the customer details to be reused for future payments. Incase the customer already exists in the system, this API will respond with the customer details.", "operationId": "Create a Customer", @@ -625,7 +647,9 @@ }, "/customers/{customer_id}": { "get": { - "tags": ["Customers"], + "tags": [ + "Customers" + ], "summary": "", "description": "\nRetrieve a customer's details.", "operationId": "Retrieve a Customer", @@ -658,7 +682,9 @@ "deprecated": false }, "post": { - "tags": ["Customers"], + "tags": [ + "Customers" + ], "summary": "", "description": "\nUpdates the customer's details in a customer object.", "operationId": "Update a Customer", @@ -701,7 +727,9 @@ "deprecated": false }, "delete": { - "tags": ["Customers"], + "tags": [ + "Customers" + ], "summary": "", "description": "\nDelete a customer record.", "operationId": "Delete a Customer", @@ -736,7 +764,9 @@ }, "/mandates/revoke/{mandate_id}": { "post": { - "tags": ["Mandates"], + "tags": [ + "Mandates" + ], "summary": "", "description": "\nRevoke a mandate", "operationId": "Revoke a Mandate", @@ -771,7 +801,9 @@ }, "/mandates/{mandate_id}": { "get": { - "tags": ["Mandates"], + "tags": [ + "Mandates" + ], "summary": "", "description": "\nRetrieve a mandate", "operationId": "Retrieve a Mandate", @@ -806,7 +838,9 @@ }, "/payment_methods": { "post": { - "tags": ["Payment Methods"], + "tags": [ + "Payment Methods" + ], "summary": "", "description": "\nTo create a payment method against a customer object. In case of cards, this API could be used only by PCI compliant merchants", "operationId": "Create a Payment Method", @@ -840,7 +874,9 @@ }, "/payment_methods/{account_id}": { "get": { - "tags": ["Payment Methods"], + "tags": [ + "Payment Methods" + ], "summary": "", "description": "\nTo filter and list the applicable payment methods for a particular Merchant ID", "operationId": "List all Payment Methods for a Merchant", @@ -940,7 +976,9 @@ }, "/payment_methods/{customer_id}": { "get": { - "tags": ["Payment Methods"], + "tags": [ + "Payment Methods" + ], "summary": "", "description": "\nTo filter and list the applicable payment methods for a particular Customer ID", "operationId": "List all Payment Methods for a Customer", @@ -1040,7 +1078,9 @@ }, "/payment_methods/{method_id}": { "get": { - "tags": ["Payment Methods"], + "tags": [ + "Payment Methods" + ], "summary": "", "description": "\nTo retrieve a payment method", "operationId": "Retrieve a Payment method", @@ -1073,7 +1113,9 @@ "deprecated": false }, "post": { - "tags": ["Payment Methods"], + "tags": [ + "Payment Methods" + ], "summary": "", "description": "\nTo update an existing payment method attached to a customer object. This API is useful for use cases such as updating the card number for expired cards to prevent discontinuity in recurring payments", "operationId": "Update a Payment method", @@ -1116,7 +1158,9 @@ "deprecated": false }, "delete": { - "tags": ["Payment Methods"], + "tags": [ + "Payment Methods" + ], "summary": "", "description": "\nDelete payment method", "operationId": "Delete a Payment method", @@ -1151,7 +1195,9 @@ }, "/payments": { "post": { - "tags": ["Payments"], + "tags": [ + "Payments" + ], "summary": "", "description": "\nTo process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture", "operationId": "Create a Payment", @@ -1185,7 +1231,9 @@ }, "/payments/list": { "get": { - "tags": ["Payments"], + "tags": [ + "Payments" + ], "summary": "", "description": "\nTo list the payments", "operationId": "List all Payments", @@ -1291,7 +1339,9 @@ }, "/payments/session_tokens": { "post": { - "tags": ["Payments"], + "tags": [ + "Payments" + ], "summary": "", "description": "\nTo create the session object or to get session token for wallets", "operationId": "Create Session tokens for a Payment", @@ -1325,7 +1375,9 @@ }, "/payments/{payment_id}": { "get": { - "tags": ["Payments"], + "tags": [ + "Payments" + ], "summary": "", "description": "\nTo retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment", "operationId": "Retrieve a Payment", @@ -1368,7 +1420,9 @@ "deprecated": false }, "post": { - "tags": ["Payments"], + "tags": [ + "Payments" + ], "summary": "", "description": "\nTo update the properties of a PaymentIntent object. This may include attaching a payment method, or attaching customer object or metadata fields after the Payment is created", "operationId": "Update a Payment", @@ -1413,7 +1467,9 @@ }, "/payments/{payment_id}/cancel": { "post": { - "tags": ["Payments"], + "tags": [ + "Payments" + ], "summary": "", "description": "\nA Payment could can be cancelled when it is in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_customer_action", "operationId": "Cancel a Payment", @@ -1451,7 +1507,9 @@ }, "/payments/{payment_id}/capture": { "post": { - "tags": ["Payments"], + "tags": [ + "Payments" + ], "summary": "", "description": "\nTo capture the funds for an uncaptured payment", "operationId": "Capture a Payment", @@ -1496,7 +1554,9 @@ }, "/payments/{payment_id}/confirm": { "post": { - "tags": ["Payments"], + "tags": [ + "Payments" + ], "summary": "", "description": "\nThis API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments Create API", "operationId": "Confirm a Payment", @@ -1541,7 +1601,9 @@ }, "/refunds": { "post": { - "tags": ["Refunds"], + "tags": [ + "Refunds" + ], "summary": "", "description": "\nTo create a refund against an already processed payment", "operationId": "Create a Refund", @@ -1575,7 +1637,9 @@ }, "/refunds/list": { "get": { - "tags": ["Refunds"], + "tags": [ + "Refunds" + ], "summary": "", "description": "\nTo list the refunds associated with a payment_id or with the merchant, if payment_id is not provided", "operationId": "List all Refunds", @@ -1670,7 +1734,9 @@ }, "/refunds/{refund_id}": { "get": { - "tags": ["Refunds"], + "tags": [ + "Refunds" + ], "summary": "", "description": "\nTo retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment", "operationId": "Retrieve a Refund", @@ -1703,7 +1769,9 @@ "deprecated": false }, "post": { - "tags": ["Refunds"], + "tags": [ + "Refunds" + ], "summary": "", "description": "\nTo update the properties of a Refund object. This may include attaching a reason for the refund or metadata fields", "operationId": "Update a Refund", @@ -1751,7 +1819,10 @@ "schemas": { "AcceptanceType": { "type": "string", - "enum": ["online", "offline"] + "enum": [ + "online", + "offline" + ] }, "Address": { "type": "object", @@ -1825,11 +1896,37 @@ }, "AffirmIssuer": { "type": "string", - "enum": ["affirm"] + "enum": [ + "affirm" + ] }, "AfterpayClearpayIssuer": { "type": "string", - "enum": ["afterpay_clearpay"] + "enum": [ + "afterpay_clearpay" + ] + }, + "AmountInfo": { + "type": "object", + "required": [ + "label", + "type", + "amount" + ], + "properties": { + "label": { + "type": "string", + "description": "the label must be non-empty to pass validation." + }, + "type": { + "type": "string", + "description": "The type of label" + }, + "amount": { + "type": "string", + "description": "The total amount for the payment" + } + } }, "ApiKeyExpiration": { "oneOf": [ @@ -1845,13 +1942,138 @@ } ] }, + "ApplePayRequest": { + "type": "object", + "required": [ + "country_code", + "currency_code", + "total", + "merchant_capabilities", + "supported_networks" + ], + "properties": { + "country_code": { + "type": "string", + "description": "The code for country" + }, + "currency_code": { + "type": "string", + "description": "The code for currency" + }, + "total": { + "$ref": "#/components/schemas/AmountInfo" + }, + "merchant_capabilities": { + "type": "array", + "items": { + "type": "string", + "description": "The list of merchant capabilities(ex: whether capable of 3ds or no-3ds)" + } + }, + "supported_networks": { + "type": "array", + "items": { + "type": "string", + "description": "The list of supported networks" + } + } + } + }, + "ApplePaySessionObject": { + "type": "object", + "required": [ + "epoch_timestamp", + "expires_at", + "merchant_session_identifier", + "nonce", + "merchant_identifier", + "domain_name", + "display_name", + "signature", + "operational_analytics_identifier", + "retries", + "psp_id" + ], + "properties": { + "epoch_timestamp": { + "type": "integer", + "format": "int64", + "description": "Timestamp at which session is requested" + }, + "expires_at": { + "type": "integer", + "format": "int64", + "description": "Timestamp at which session expires" + }, + "merchant_session_identifier": { + "type": "string", + "description": "The identifier for the merchant session" + }, + "nonce": { + "type": "string", + "description": "Applepay generates unique ID (UUID) value" + }, + "merchant_identifier": { + "type": "string", + "description": "The identifier for the merchant" + }, + "domain_name": { + "type": "string", + "description": "The domain name of the merchant which is registered in Apple Pay" + }, + "display_name": { + "type": "string", + "description": "The name to be displayed on Apple Pay button" + }, + "signature": { + "type": "string", + "description": "A string which represents the properties of a payment" + }, + "operational_analytics_identifier": { + "type": "string", + "description": "The identifier for the operational analytics" + }, + "retries": { + "type": "integer", + "format": "int32", + "description": "The number of retries to get the session response" + }, + "psp_id": { + "type": "string", + "description": "The identifier for the connector transaction" + } + } + }, + "ApplepayData": { + "type": "object", + "required": [ + "session_object", + "payment_request_object" + ], + "properties": { + "session_object": { + "$ref": "#/components/schemas/ApplePaySessionObject" + }, + "payment_request_object": { + "$ref": "#/components/schemas/ApplePayRequest" + } + } + }, "AuthenticationType": { "type": "string", - "enum": ["three_ds", "no_three_ds"] + "enum": [ + "three_ds", + "no_three_ds" + ] }, "CaptureMethod": { "type": "string", - "enum": ["automatic", "manual", "manual_multiple", "scheduled"] + "enum": [ + "automatic", + "manual", + "manual_multiple", + "scheduled" + ] }, "Card": { "type": "object", @@ -2048,7 +2270,7 @@ "api_key": { "type": "string", "description": "The plaintext API Key used for server-side API access. Ensure you store the API Key\nsecurely as you will not be able to see it again.", - "maxLength": 64 + "maxLength": 128 }, "created": { "type": "string", @@ -2063,7 +2285,9 @@ }, "CreateMerchantAccount": { "type": "object", - "required": ["merchant_id"], + "required": [ + "merchant_id" + ], "properties": { "merchant_id": { "type": "string", @@ -2141,7 +2365,9 @@ }, "CreatePaymentMethod": { "type": "object", - "required": ["payment_method"], + "required": [ + "payment_method" + ], "properties": { "payment_method": { "$ref": "#/components/schemas/PaymentMethodType" @@ -2280,7 +2506,9 @@ }, "CustomerAcceptance": { "type": "object", - "required": ["acceptance_type"], + "required": [ + "acceptance_type" + ], "properties": { "acceptance_type": { "$ref": "#/components/schemas/AcceptanceType" @@ -2377,7 +2605,9 @@ "items": { "$ref": "#/components/schemas/PaymentExperience" }, - "example": ["redirect_to_url"] + "example": [ + "redirect_to_url" + ] }, "card": { "$ref": "#/components/schemas/CardDetailFromLocker" @@ -2443,7 +2673,10 @@ }, "CustomerResponse": { "type": "object", - "required": ["customer_id", "created_at"], + "required": [ + "customer_id", + "created_at" + ], "properties": { "customer_id": { "type": "string", @@ -2497,7 +2730,11 @@ }, "DeleteMcaResponse": { "type": "object", - "required": ["merchant_id", "merchant_connector_id", "deleted"], + "required": [ + "merchant_id", + "merchant_connector_id", + "deleted" + ], "properties": { "merchant_id": { "type": "string", @@ -2519,7 +2756,10 @@ }, "DeleteMerchantAccountResponse": { "type": "object", - "required": ["merchant_id", "deleted"], + "required": [ + "merchant_id", + "deleted" + ], "properties": { "merchant_id": { "type": "string", @@ -2536,7 +2776,10 @@ }, "DeletePaymentMethodResponse": { "type": "object", - "required": ["payment_method_id", "deleted"], + "required": [ + "payment_method_id", + "deleted" + ], "properties": { "payment_method_id": { "type": "string", @@ -2552,11 +2795,17 @@ }, "FutureUsage": { "type": "string", - "enum": ["off_session", "on_session"] + "enum": [ + "off_session", + "on_session" + ] }, "GpayAllowedMethodsParameters": { "type": "object", - "required": ["allowed_auth_methods", "allowed_card_networks"], + "required": [ + "allowed_auth_methods", + "allowed_card_networks" + ], "properties": { "allowed_auth_methods": { "type": "array", @@ -2576,7 +2825,11 @@ }, "GpayAllowedPaymentMethods": { "type": "object", - "required": ["type", "parameters", "tokenization_specification"], + "required": [ + "type", + "parameters", + "tokenization_specification" + ], "properties": { "type": { "type": "string", @@ -2590,9 +2843,33 @@ } } }, + "GpayData": { + "type": "object", + "required": [ + "merchant_info", + "allowed_payment_methods", + "transaction_info" + ], + "properties": { + "merchant_info": { + "$ref": "#/components/schemas/GpayMerchantInfo" + }, + "allowed_payment_methods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GpayAllowedPaymentMethods" + } + }, + "transaction_info": { + "$ref": "#/components/schemas/GpayTransactionInfo" + } + } + }, "GpayMerchantInfo": { "type": "object", - "required": ["merchant_name"], + "required": [ + "merchant_name" + ], "properties": { "merchant_name": { "type": "string", @@ -2602,7 +2879,10 @@ }, "GpayTokenParameters": { "type": "object", - "required": ["gateway", "gateway_merchant_id"], + "required": [ + "gateway", + "gateway_merchant_id" + ], "properties": { "gateway": { "type": "string", @@ -2616,7 +2896,10 @@ }, "GpayTokenizationSpecification": { "type": "object", - "required": ["type", "parameters"], + "required": [ + "type", + "parameters" + ], "properties": { "type": { "type": "string", @@ -2668,13 +2951,35 @@ "requires_capture" ] }, + "KlarnaData": { + "type": "object", + "required": [ + "session_token", + "session_id" + ], + "properties": { + "session_token": { + "type": "string", + "description": "The session token for Klarna" + }, + "session_id": { + "type": "string", + "description": "The identifier for the session" + } + } + }, "KlarnaIssuer": { "type": "string", - "enum": ["klarna"] + "enum": [ + "klarna" + ] }, "ListCustomerPaymentMethodsResponse": { "type": "object", - "required": ["enabled_payment_methods", "customer_payment_methods"], + "required": [ + "enabled_payment_methods", + "customer_payment_methods" + ], "properties": { "enabled_payment_methods": { "type": "array", @@ -2683,9 +2988,12 @@ }, "example": [ { - "payment_method": "wallet", "payment_experience": null, - "payment_method_issuers": ["labore magna ipsum", "aute"] + "payment_method": "wallet", + "payment_method_issuers": [ + "labore magna ipsum", + "aute" + ] } ] }, @@ -2713,7 +3021,9 @@ "items": { "$ref": "#/components/schemas/PaymentMethodSubType" }, - "example": ["credit_card"] + "example": [ + "credit_card" + ] }, "payment_method_issuers": { "type": "array", @@ -2721,14 +3031,18 @@ "type": "string", "description": "The name of the bank/ provider issuing the payment method to the end user" }, - "example": ["Citibank"] + "example": [ + "Citibank" + ] }, "payment_method_issuer_code": { "type": "array", "items": { "$ref": "#/components/schemas/PaymentMethodIssuerCode" }, - "example": ["jp_applepay"] + "example": [ + "jp_applepay" + ] }, "payment_schemes": { "type": "array", @@ -2736,7 +3050,11 @@ "type": "string", "description": "List of payment schemes accepted or has the processing capabilities of the processor" }, - "example": ["MASTER", "VISA", "DINERS"] + "example": [ + "MASTER", + "VISA", + "DINERS" + ] }, "accepted_countries": { "type": "array", @@ -2744,14 +3062,21 @@ "type": "string", "description": "List of Countries accepted or has the processing capabilities of the processor" }, - "example": ["US", "UK", "IN"] + "example": [ + "US", + "UK", + "IN" + ] }, "accepted_currencies": { "type": "array", "items": { "$ref": "#/components/schemas/Currency" }, - "example": ["USD", "EUR"] + "example": [ + "USD", + "EUR" + ] }, "minimum_amount": { "type": "integer", @@ -2780,13 +3105,17 @@ "items": { "$ref": "#/components/schemas/PaymentExperience" }, - "example": ["redirect_to_url"] + "example": [ + "redirect_to_url" + ] } } }, "ListPaymentMethodResponse": { "type": "object", - "required": ["payment_methods"], + "required": [ + "payment_methods" + ], "properties": { "redirect_url": { "type": "string", @@ -2800,9 +3129,12 @@ }, "example": [ { - "payment_method": "wallet", "payment_experience": null, - "payment_method_issuers": ["labore magna ipsum", "aute"] + "payment_method": "wallet", + "payment_method_issuers": [ + "labore magna ipsum", + "aute" + ] } ] } @@ -2810,7 +3142,10 @@ }, "MandateAmountData": { "type": "object", - "required": ["amount", "currency"], + "required": [ + "amount", + "currency" + ], "properties": { "amount": { "type": "integer", @@ -2862,7 +3197,10 @@ }, "MandateData": { "type": "object", - "required": ["customer_acceptance", "mandate_type"], + "required": [ + "customer_acceptance", + "mandate_type" + ], "properties": { "customer_acceptance": { "$ref": "#/components/schemas/CustomerAcceptance" @@ -2906,7 +3244,10 @@ }, "MandateRevokedResponse": { "type": "object", - "required": ["mandate_id", "status"], + "required": [ + "mandate_id", + "status" + ], "properties": { "mandate_id": { "type": "string", @@ -2920,13 +3261,20 @@ "MandateStatus": { "type": "string", "description": "The status of the mandate, which indicates whether it can be used to initiate a payment", - "enum": ["active", "inactive", "pending", "revoked"] + "enum": [ + "active", + "inactive", + "pending", + "revoked" + ] }, "MandateType": { "oneOf": [ { "type": "object", - "required": ["single_use"], + "required": [ + "single_use" + ], "properties": { "single_use": { "$ref": "#/components/schemas/MandateAmountData" @@ -2935,7 +3283,9 @@ }, { "type": "object", - "required": ["multi_use"], + "required": [ + "multi_use" + ], "properties": { "multi_use": { "$ref": "#/components/schemas/MandateAmountData" @@ -3030,7 +3380,10 @@ }, "MerchantConnectorId": { "type": "object", - "required": ["merchant_id", "merchant_connector_id"], + "required": [ + "merchant_id", + "merchant_connector_id" + ], "properties": { "merchant_id": { "type": "string" @@ -3113,7 +3466,9 @@ }, "NextAction": { "type": "object", - "required": ["type"], + "required": [ + "type" + ], "properties": { "type": { "$ref": "#/components/schemas/NextActionType" @@ -3136,7 +3491,10 @@ }, "OnlineMandate": { "type": "object", - "required": ["ip_address", "user_agent"], + "required": [ + "ip_address", + "user_agent" + ], "properties": { "ip_address": { "type": "string", @@ -3151,7 +3509,10 @@ }, "OrderDetails": { "type": "object", - "required": ["product_name", "quantity"], + "required": [ + "product_name", + "quantity" + ], "properties": { "product_name": { "type": "string", @@ -3171,12 +3532,17 @@ "oneOf": [ { "type": "object", - "required": ["klarna_redirect"], + "required": [ + "klarna_redirect" + ], "properties": { "klarna_redirect": { "type": "object", "description": "For KlarnaRedirect as PayLater Option", - "required": ["billing_email", "billing_country"], + "required": [ + "billing_email", + "billing_country" + ], "properties": { "billing_email": { "type": "string", @@ -3191,12 +3557,16 @@ }, { "type": "object", - "required": ["klarna_sdk"], + "required": [ + "klarna_sdk" + ], "properties": { "klarna_sdk": { "type": "object", "description": "For Klarna Sdk as PayLater Option", - "required": ["token"], + "required": [ + "token" + ], "properties": { "token": { "type": "string", @@ -3208,7 +3578,9 @@ }, { "type": "object", - "required": ["affirm_redirect"], + "required": [ + "affirm_redirect" + ], "properties": { "affirm_redirect": { "type": "object", @@ -3218,12 +3590,17 @@ }, { "type": "object", - "required": ["afterpay_clearpay_redirect"], + "required": [ + "afterpay_clearpay_redirect" + ], "properties": { "afterpay_clearpay_redirect": { "type": "object", "description": "For AfterpayClearpay redirect as PayLater Option", - "required": ["billing_email", "billing_name"], + "required": [ + "billing_email", + "billing_name" + ], "properties": { "billing_email": { "type": "string", @@ -3242,7 +3619,10 @@ "PaymentConnectorCreate": { "type": "object", "description": "Create a new Payment Connector for the merchant account. The connector could be a payment processor / facilitator / acquirer or specialized services like Fraud / Accounting etc.\"", - "required": ["connector_type", "connector_name"], + "required": [ + "connector_type", + "connector_name" + ], "properties": { "connector_type": { "$ref": "#/components/schemas/ConnectorType" @@ -3279,16 +3659,31 @@ }, "example": [ { - "payment_method": "wallet", - "payment_method_types": ["upi_collect", "upi_intent"], - "payment_method_issuers": ["labore magna ipsum", "aute"], - "payment_schemes": ["Discover", "Discover"], - "accepted_currencies": ["AED", "AED"], - "accepted_countries": ["in", "us"], - "minimum_amount": 1, + "accepted_countries": [ + "in", + "us" + ], + "accepted_currencies": [ + "AED", + "AED" + ], + "installment_payment_enabled": true, "maximum_amount": 68607706, - "recurring_enabled": true, - "installment_payment_enabled": true + "minimum_amount": 1, + "payment_method": "wallet", + "payment_method_issuers": [ + "labore magna ipsum", + "aute" + ], + "payment_method_types": [ + "upi_collect", + "upi_intent" + ], + "payment_schemes": [ + "Discover", + "Discover" + ], + "recurring_enabled": true } ] }, @@ -3312,7 +3707,9 @@ "oneOf": [ { "type": "object", - "required": ["PaymentIntentId"], + "required": [ + "PaymentIntentId" + ], "properties": { "PaymentIntentId": { "type": "string", @@ -3322,7 +3719,9 @@ }, { "type": "object", - "required": ["ConnectorTransactionId"], + "required": [ + "ConnectorTransactionId" + ], "properties": { "ConnectorTransactionId": { "type": "string", @@ -3332,7 +3731,9 @@ }, { "type": "object", - "required": ["PaymentAttemptId"], + "required": [ + "PaymentAttemptId" + ], "properties": { "PaymentAttemptId": { "type": "string", @@ -3410,7 +3811,10 @@ }, "PaymentListResponse": { "type": "object", - "required": ["size", "data"], + "required": [ + "size", + "data" + ], "properties": { "size": { "type": "integer", @@ -3428,7 +3832,9 @@ "oneOf": [ { "type": "object", - "required": ["card"], + "required": [ + "card" + ], "properties": { "card": { "$ref": "#/components/schemas/Card" @@ -3437,11 +3843,15 @@ }, { "type": "string", - "enum": ["bank_transfer"] + "enum": [ + "bank_transfer" + ] }, { "type": "object", - "required": ["wallet"], + "required": [ + "wallet" + ], "properties": { "wallet": { "$ref": "#/components/schemas/WalletData" @@ -3450,7 +3860,9 @@ }, { "type": "object", - "required": ["pay_later"], + "required": [ + "pay_later" + ], "properties": { "pay_later": { "$ref": "#/components/schemas/PayLaterData" @@ -3459,7 +3871,9 @@ }, { "type": "string", - "enum": ["paypal"] + "enum": [ + "paypal" + ] } ] }, @@ -3535,7 +3949,9 @@ "items": { "$ref": "#/components/schemas/PaymentExperience" }, - "example": ["redirect_to_url"] + "example": [ + "redirect_to_url" + ] }, "metadata": { "type": "object" @@ -3593,7 +4009,9 @@ "items": { "$ref": "#/components/schemas/PaymentMethodSubType" }, - "example": ["credit"] + "example": [ + "credit" + ] }, "payment_method_issuers": { "type": "array", @@ -3601,7 +4019,9 @@ "type": "string", "description": "List of payment method issuers to be enabled for this payment method" }, - "example": ["HDFC"] + "example": [ + "HDFC" + ] }, "payment_schemes": { "type": "array", @@ -3609,14 +4029,22 @@ "type": "string", "description": "List of payment schemes accepted or has the processing capabilities of the processor" }, - "example": ["MASTER", "VISA", "DINERS"] + "example": [ + "MASTER", + "VISA", + "DINERS" + ] }, "accepted_currencies": { "type": "array", "items": { "$ref": "#/components/schemas/Currency" }, - "example": ["USD", "EUR", "AED"] + "example": [ + "USD", + "EUR", + "AED" + ] }, "accepted_countries": { "type": "array", @@ -3624,7 +4052,10 @@ "type": "string", "description": "List of Countries accepted or has the processing capabilities of the processor" }, - "example": ["US", "IN"] + "example": [ + "US", + "IN" + ] }, "minimum_amount": { "type": "integer", @@ -3655,7 +4086,9 @@ "items": { "$ref": "#/components/schemas/PaymentExperience" }, - "example": ["redirect_to_url"] + "example": [ + "redirect_to_url" + ] } } }, @@ -3874,7 +4307,12 @@ }, "PaymentsResponse": { "type": "object", - "required": ["status", "amount", "currency", "payment_method"], + "required": [ + "status", + "amount", + "currency", + "payment_method" + ], "properties": { "payment_id": { "type": "string", @@ -4053,7 +4491,10 @@ }, "PaymentsRetrieveRequest": { "type": "object", - "required": ["resource_id", "force_sync"], + "required": [ + "resource_id", + "force_sync" + ], "properties": { "resource_id": { "$ref": "#/components/schemas/PaymentIdType" @@ -4078,7 +4519,11 @@ }, "PaymentsSessionRequest": { "type": "object", - "required": ["payment_id", "client_secret", "wallets"], + "required": [ + "payment_id", + "client_secret", + "wallets" + ], "properties": { "payment_id": { "type": "string", @@ -4098,7 +4543,11 @@ }, "PaymentsSessionResponse": { "type": "object", - "required": ["payment_id", "client_secret", "session_token"], + "required": [ + "payment_id", + "client_secret", + "session_token" + ], "properties": { "payment_id": { "type": "string", @@ -4118,7 +4567,11 @@ }, "PaymentsStartRequest": { "type": "object", - "required": ["payment_id", "merchant_id", "attempt_id"], + "required": [ + "payment_id", + "merchant_id", + "attempt_id" + ], "properties": { "payment_id": { "type": "string", @@ -4134,6 +4587,18 @@ } } }, + "PaypalData": { + "type": "object", + "required": [ + "session_token" + ], + "properties": { + "session_token": { + "type": "string", + "description": "The session token for PayPal" + } + } + }, "PhoneDetails": { "type": "object", "properties": { @@ -4190,7 +4655,9 @@ }, "RefundListResponse": { "type": "object", - "required": ["data"], + "required": [ + "data" + ], "properties": { "data": { "type": "array", @@ -4202,7 +4669,9 @@ }, "RefundRequest": { "type": "object", - "required": ["payment_id"], + "required": [ + "payment_id" + ], "properties": { "refund_id": { "type": "string", @@ -4247,7 +4716,13 @@ }, "RefundResponse": { "type": "object", - "required": ["refund_id", "payment_id", "amount", "currency", "status"], + "required": [ + "refund_id", + "payment_id", + "amount", + "currency", + "status" + ], "properties": { "refund_id": { "type": "string", @@ -4299,11 +4774,19 @@ "RefundStatus": { "type": "string", "description": "The status for refunds", - "enum": ["succeeded", "failed", "pending", "review"] + "enum": [ + "succeeded", + "failed", + "pending", + "review" + ] }, "RefundType": { "type": "string", - "enum": ["scheduled", "instant"] + "enum": [ + "scheduled", + "instant" + ] }, "RefundUpdateRequest": { "type": "object", @@ -4358,7 +4841,7 @@ "prefix": { "type": "string", "description": "The first few characters of the plaintext API Key to help you identify it.", - "maxLength": 16 + "maxLength": 64 }, "created": { "type": "string", @@ -4395,143 +4878,99 @@ "RoutingAlgorithm": { "type": "string", "description": "The routing algorithm to be used to process the incoming request from merchant to outgoing payment processor or payment method. The default is 'Custom'", - "enum": ["round_robin", "max_conversion", "min_cost", "custom"], + "enum": [ + "round_robin", + "max_conversion", + "min_cost", + "custom" + ], "example": "custom" }, "SessionToken": { "oneOf": [ { - "type": "object", - "description": "The session response structure for Google Pay", - "required": [ - "merchant_info", - "allowed_payment_methods", - "transaction_info", - "wallet_name" - ], - "properties": { - "merchant_info": { - "$ref": "#/components/schemas/GpayMerchantInfo" + "allOf": [ + { + "$ref": "#/components/schemas/GpayData" }, - "allowed_payment_methods": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GpayAllowedPaymentMethods" + { + "type": "object", + "required": [ + "wallet_name" + ], + "properties": { + "wallet_name": { + "type": "string", + "enum": [ + "gpay" + ] + } } - }, - "transaction_info": { - "$ref": "#/components/schemas/GpayTransactionInfo" - }, - "wallet_name": { - "type": "string", - "enum": ["gpay"] } - } + ] }, { - "type": "object", - "description": "The session response structure for Klarna", - "required": ["session_token", "session_id", "wallet_name"], - "properties": { - "session_token": { - "type": "string", - "description": "The session token for Klarna" + "allOf": [ + { + "$ref": "#/components/schemas/KlarnaData" }, - "session_id": { - "type": "string", - "description": "The identifier for the session" - }, - "wallet_name": { - "type": "string", - "enum": ["klarna"] + { + "type": "object", + "required": [ + "wallet_name" + ], + "properties": { + "wallet_name": { + "type": "string", + "enum": [ + "klarna" + ] + } + } } - } + ] }, { - "type": "object", - "description": "The session response structure for PayPal", - "required": ["session_token", "wallet_name"], - "properties": { - "session_token": { - "type": "string", - "description": "The session token for PayPal" + "allOf": [ + { + "$ref": "#/components/schemas/PaypalData" }, - "wallet_name": { - "type": "string", - "enum": ["paypal"] + { + "type": "object", + "required": [ + "wallet_name" + ], + "properties": { + "wallet_name": { + "type": "string", + "enum": [ + "paypal" + ] + } + } } - } + ] }, { - "type": "object", - "description": "The session response structure for Apple Pay", - "required": [ - "epoch_timestamp", - "expires_at", - "merchant_session_identifier", - "nonce", - "merchant_identifier", - "domain_name", - "display_name", - "signature", - "operational_analytics_identifier", - "retries", - "psp_id", - "wallet_name" - ], - "properties": { - "epoch_timestamp": { - "type": "integer", - "format": "int64", - "description": "Timestamp at which session is requested" + "allOf": [ + { + "$ref": "#/components/schemas/ApplepayData" }, - "expires_at": { - "type": "integer", - "format": "int64", - "description": "Timestamp at which session expires" - }, - "merchant_session_identifier": { - "type": "string", - "description": "The identifier for the merchant session" - }, - "nonce": { - "type": "string", - "description": "Applepay generates unique ID (UUID) value" - }, - "merchant_identifier": { - "type": "string", - "description": "The identifier for the merchant" - }, - "domain_name": { - "type": "string", - "description": "The domain name of the merchant which is registered in Apple Pay" - }, - "display_name": { - "type": "string", - "description": "The name to be displayed on Apple Pay button" - }, - "signature": { - "type": "string", - "description": "A string which represents the properties of a payment" - }, - "operational_analytics_identifier": { - "type": "string", - "description": "The identifier for the operational analytics" - }, - "retries": { - "type": "integer", - "format": "int32", - "description": "The number of retries to get the session response" - }, - "psp_id": { - "type": "string", - "description": "The identifier for the connector transaction" - }, - "wallet_name": { - "type": "string", - "enum": ["applepay"] + { + "type": "object", + "required": [ + "wallet_name" + ], + "properties": { + "wallet_name": { + "type": "string", + "enum": [ + "applepay" + ] + } + } } - } + ] } ], "discriminator": { @@ -4541,7 +4980,12 @@ "SupportedWallets": { "type": "string", "description": "Wallets which support obtaining session object", - "enum": ["paypal", "apple_pay", "klarna", "gpay"] + "enum": [ + "paypal", + "apple_pay", + "klarna", + "gpay" + ] }, "UpdateApiKeyRequest": { "type": "object", @@ -4577,7 +5021,9 @@ }, "WalletData": { "type": "object", - "required": ["issuer_name"], + "required": [ + "issuer_name" + ], "properties": { "issuer_name": { "$ref": "#/components/schemas/WalletIssuer" @@ -4590,7 +5036,11 @@ }, "WalletIssuer": { "type": "string", - "enum": ["googlepay", "applepay", "paypal"] + "enum": [ + "googlepay", + "applepay", + "paypal" + ] }, "WebhookDetails": { "type": "object", @@ -4671,4 +5121,4 @@ "description": "Create and manage API Keys" } ] -} +} \ No newline at end of file