diff --git a/crates/router/src/openapi.rs b/crates/router/src/openapi.rs index 69ac4e2594b..eca21ba8042 100644 --- a/crates/router/src/openapi.rs +++ b/crates/router/src/openapi.rs @@ -234,6 +234,7 @@ Never share your secret api keys. Keep them guarded and secure. api_models::payments::BankTransferInstructions, api_models::payments::ReceiverDetails, api_models::payments::AchTransfer, + api_models::payments::ApplePayRedirectData, api_models::payments::SepaBankTransferInstructions, api_models::payments::BacsBankTransferInstructions, api_models::payments::RedirectResponse, diff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.json index 8b813817436..9ad5ee7f488 100644 --- a/openapi/openapi_spec.json +++ b/openapi/openapi_spec.json @@ -1797,7 +1797,6 @@ "type": "object", "required": [ "label", - "type", "amount" ], "properties": { @@ -1807,7 +1806,8 @@ }, "type": { "type": "string", - "description": "A value that indicates whether the line item(Ex: total, tax, discount, or grand total) is final or pending." + "description": "A value that indicates whether the line item(Ex: total, tax, discount, or grand total) is final or pending.", + "nullable": true }, "amount": { "type": "string", @@ -1836,8 +1836,7 @@ "currency_code", "total", "merchant_capabilities", - "supported_networks", - "merchant_identifier" + "supported_networks" ], "properties": { "country_code": { @@ -1865,77 +1864,33 @@ "description": "The list of supported networks" }, "merchant_identifier": { - "type": "string" + "type": "string", + "nullable": true } } }, + "ApplePayRedirectData": { + "type": "object" + }, "ApplePaySessionResponse": { - "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", - "minimum": 0.0 - }, - "expires_at": { - "type": "integer", - "format": "int64", - "description": "Timestamp at which session expires", - "minimum": 0.0 - }, - "merchant_session_identifier": { - "type": "string", - "description": "The identifier for the merchant session" - }, - "nonce": { - "type": "string", - "description": "Apple pay generated 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" + "oneOf": [ + { + "$ref": "#/components/schemas/ThirdPartySdkSessionResponse" }, - "retries": { - "type": "integer", - "format": "int32", - "description": "The number of retries to get the session response", - "minimum": 0.0 + { + "allOf": [ + { + "$ref": "#/components/schemas/NoThirdPartySdkSessionResponse" + } + ], + "nullable": true }, - "psp_id": { - "type": "string", - "description": "The identifier for the connector transaction" + { + "type": "object", + "default": null, + "nullable": true } - } + ] }, "ApplePayWalletData": { "type": "object", @@ -1984,18 +1939,32 @@ "type": "object", "required": [ "session_token_data", - "payment_request_data", - "connector" + "connector", + "delayed_session_token", + "sdk_next_action" ], "properties": { "session_token_data": { "$ref": "#/components/schemas/ApplePaySessionResponse" }, "payment_request_data": { - "$ref": "#/components/schemas/ApplePayPaymentRequest" + "allOf": [ + { + "$ref": "#/components/schemas/ApplePayPaymentRequest" + } + ], + "nullable": true }, "connector": { - "type": "string" + "type": "string", + "description": "The session token is w.r.t this connector" + }, + "delayed_session_token": { + "type": "boolean", + "description": "Identifier for the delayed session response" + }, + "sdk_next_action": { + "$ref": "#/components/schemas/SdkNextAction" } } }, @@ -3581,9 +3550,6 @@ "CustomerRequest": { "type": "object", "description": "The customer details", - "required": [ - "name" - ], "properties": { "customer_id": { "type": "string", @@ -3595,6 +3561,7 @@ "type": "string", "description": "The customer's name", "example": "Jon Test", + "nullable": true, "maxLength": 255 }, "email": { @@ -5301,6 +5268,11 @@ }, "nullable": true }, + "order_category": { + "type": "string", + "description": "Information about the order category that merchant wants to specify at connector level. (e.g. In Noon Payments it can take values like \"pay\", \"food\", or any other custom string set by the merchant in Noon's Dashboard)", + "nullable": true + }, "redirect_response": { "allOf": [ { @@ -5324,6 +5296,14 @@ "MobilePayRedirection": { "type": "object" }, + "NextActionCall": { + "type": "string", + "enum": [ + "confirm", + "sync", + "session_token" + ] + }, "NextActionData": { "oneOf": [ { @@ -5379,6 +5359,74 @@ "display_bank_transfer_information" ] }, + "NoThirdPartySdkSessionResponse": { + "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", + "minimum": 0.0 + }, + "expires_at": { + "type": "integer", + "format": "int64", + "description": "Timestamp at which session expires", + "minimum": 0.0 + }, + "merchant_session_identifier": { + "type": "string", + "description": "The identifier for the merchant session" + }, + "nonce": { + "type": "string", + "description": "Apple pay generated 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", + "minimum": 0.0 + }, + "psp_id": { + "type": "string", + "description": "The identifier for the connector transaction" + } + } + }, "OnlineMandate": { "type": "object", "required": [ @@ -6182,54 +6230,116 @@ "type": "object", "required": [ "currency", - "amount", - "manual_retry" + "manual_retry", + "amount" ], "properties": { - "mandate_id": { + "currency": { + "allOf": [ + { + "$ref": "#/components/schemas/Currency" + } + ], + "nullable": true + }, + "description": { "type": "string", - "description": "A unique identifier to link the payment to a mandate, can be use instead of payment_method_data", - "example": "mandate_iwer89rnjef349dni3", + "description": "A description of the payment", + "example": "It's my first payment request", + "nullable": true + }, + "capture_method": { + "allOf": [ + { + "$ref": "#/components/schemas/CaptureMethod" + } + ], + "nullable": true + }, + "statement_descriptor_suffix": { + "type": "string", + "description": "Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.", + "example": "Payment for shoes purchase", "nullable": true, "maxLength": 255 }, - "routing": { + "metadata": { "allOf": [ { - "$ref": "#/components/schemas/RoutingAlgorithm" + "$ref": "#/components/schemas/Metadata" } ], "nullable": true }, - "payment_token": { + "payment_method": { + "allOf": [ + { + "$ref": "#/components/schemas/PaymentMethod" + } + ], + "nullable": true + }, + "email": { "type": "string", - "description": "Provide a reference to a stored payment method", - "example": "187282ab-40ef-47a9-9206-5099ba31e432", + "description": "description: The customer's email address", + "example": "johntest@test.com", + "nullable": true, + "maxLength": 255 + }, + "customer_id": { + "type": "string", + "description": "The identifier for the customer object. If not provided the customer ID will be autogenerated.", + "example": "cus_y3oqhf46pyzuxjbcn2giaqnb44", + "nullable": true, + "maxLength": 255 + }, + "card_cvc": { + "type": "string", + "description": "This is used when payment is to be confirmed and the card is not saved", "nullable": true }, - "currency": { + "business_country": { "allOf": [ { - "$ref": "#/components/schemas/Currency" + "$ref": "#/components/schemas/CountryAlpha2" } ], "nullable": true }, - "phone_country_code": { + "browser_info": { + "type": "object", + "description": "Additional details required by 3DS 2.0", + "nullable": true + }, + "routing": { + "allOf": [ + { + "$ref": "#/components/schemas/RoutingAlgorithm" + } + ], + "nullable": true + }, + "merchant_id": { "type": "string", - "description": "The country code for the customer phone number", - "example": "+1", + "description": "This is an identifier for the merchant account. This is inferred from the API key\nprovided during the request", + "example": "merchant_1668273825", "nullable": true, "maxLength": 255 }, - "payment_method_type": { + "shipping": { "allOf": [ { - "$ref": "#/components/schemas/PaymentMethodType" + "$ref": "#/components/schemas/Address" } ], "nullable": true }, + "payment_token": { + "type": "string", + "description": "Provide a reference to a stored payment method", + "example": "187282ab-40ef-47a9-9206-5099ba31e432", + "nullable": true + }, "allowed_payment_method_types": { "type": "array", "items": { @@ -6238,26 +6348,21 @@ "description": "Allowed Payment Method Types for a given PaymentIntent", "nullable": true }, - "confirm": { + "manual_retry": { "type": "boolean", - "description": "Whether to confirm the payment (if applicable)", - "default": false, - "example": true, - "nullable": true + "description": "If enabled payment can be retried from the client side until the payment is successful or payment expires or the attempts(configured by the merchant) for payment are exhausted." }, - "metadata": { - "allOf": [ - { - "$ref": "#/components/schemas/Metadata" - } - ], - "nullable": true + "payment_id": { + "type": "string", + "description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant. This field is auto generated and is returned in the API response.", + "example": "pay_mbabizu24mvu3mela5njyhpit4", + "nullable": true, + "maxLength": 30, + "minLength": 30 }, - "amount_to_capture": { - "type": "integer", - "format": "int64", - "description": "The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\nIf not provided, the default amount_to_capture will be the payment amount.", - "example": 6540, + "business_sub_label": { + "type": "string", + "description": "Business sub label for the payment", "nullable": true }, "amount": { @@ -6268,20 +6373,22 @@ "nullable": true, "minimum": 0.0 }, - "merchant_id": { + "statement_descriptor_name": { "type": "string", - "description": "This is an identifier for the merchant account. This is inferred from the API key\nprovided during the request", - "example": "merchant_1668273825", + "description": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.", + "example": "Hyperswitch Router", "nullable": true, "maxLength": 255 }, - "off_session": { - "type": "boolean", - "description": "Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with `confirm: true`.", - "example": true, + "merchant_connector_details": { + "allOf": [ + { + "$ref": "#/components/schemas/MerchantConnectorDetailsWrap" + } + ], "nullable": true }, - "shipping": { + "billing": { "allOf": [ { "$ref": "#/components/schemas/Address" @@ -6289,12 +6396,19 @@ ], "nullable": true }, - "phone": { + "capture_on": { "type": "string", - "description": "The customer's phone number", - "example": "3141592653", - "nullable": true, - "maxLength": 255 + "format": "date-time", + "description": "A timestamp (ISO 8601 code) that determines when the payment should be captured.\nProviding this field will automatically set `capture` to true", + "example": "2022-09-10T10:11:12Z", + "nullable": true + }, + "confirm": { + "type": "boolean", + "description": "Whether to confirm the payment (if applicable)", + "default": false, + "example": true, + "nullable": true }, "client_secret": { "type": "string", @@ -6302,21 +6416,20 @@ "example": "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo", "nullable": true }, - "authentication_type": { + "mandate_data": { "allOf": [ { - "$ref": "#/components/schemas/AuthenticationType" + "$ref": "#/components/schemas/MandateData" } ], "nullable": true }, - "capture_method": { - "allOf": [ - { - "$ref": "#/components/schemas/CaptureMethod" - } - ], - "nullable": true + "mandate_id": { + "type": "string", + "description": "A unique identifier to link the payment to a mandate, can be use instead of payment_method_data", + "example": "mandate_iwer89rnjef349dni3", + "nullable": true, + "maxLength": 255 }, "business_label": { "type": "string", @@ -6324,13 +6437,6 @@ "example": "food", "nullable": true }, - "statement_descriptor_suffix": { - "type": "string", - "description": "Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.", - "example": "Payment for shoes purchase", - "nullable": true, - "maxLength": 255 - }, "name": { "type": "string", "description": "description: The customer's name", @@ -6338,14 +6444,6 @@ "nullable": true, "maxLength": 255 }, - "setup_future_usage": { - "allOf": [ - { - "$ref": "#/components/schemas/FutureUsage" - } - ], - "nullable": true - }, "connector": { "type": "array", "items": { @@ -6358,58 +6456,26 @@ ], "nullable": true }, - "statement_descriptor_name": { - "type": "string", - "description": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.", - "example": "Hyperswitch Router", - "nullable": true, - "maxLength": 255 - }, - "card_cvc": { - "type": "string", - "description": "This is used when payment is to be confirmed and the card is not saved", - "nullable": true - }, - "payment_method": { - "allOf": [ - { - "$ref": "#/components/schemas/PaymentMethod" - } - ], - "nullable": true - }, - "description": { - "type": "string", - "description": "A description of the payment", - "example": "It's my first payment request", - "nullable": true - }, - "mandate_data": { - "allOf": [ - { - "$ref": "#/components/schemas/MandateData" - } - ], - "nullable": true - }, - "business_country": { + "authentication_type": { "allOf": [ { - "$ref": "#/components/schemas/CountryAlpha2" + "$ref": "#/components/schemas/AuthenticationType" } ], "nullable": true }, - "business_sub_label": { + "phone": { "type": "string", - "description": "Business sub label for the payment", - "nullable": true + "description": "The customer's phone number", + "example": "3141592653", + "nullable": true, + "maxLength": 255 }, - "capture_on": { - "type": "string", - "format": "date-time", - "description": "A timestamp (ISO 8601 code) that determines when the payment should be captured.\nProviding this field will automatically set `capture` to true", - "example": "2022-09-10T10:11:12Z", + "amount_to_capture": { + "type": "integer", + "format": "int64", + "description": "The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,\nIf not provided, the default amount_to_capture will be the payment amount.", + "example": 6540, "nullable": true }, "return_url": { @@ -6418,68 +6484,50 @@ "example": "https://hyperswitch.io", "nullable": true }, - "payment_experience": { + "setup_future_usage": { "allOf": [ { - "$ref": "#/components/schemas/PaymentExperience" + "$ref": "#/components/schemas/FutureUsage" } ], "nullable": true }, - "billing": { + "payment_method_data": { "allOf": [ { - "$ref": "#/components/schemas/Address" + "$ref": "#/components/schemas/PaymentMethodData" } ], "nullable": true }, - "customer_id": { + "phone_country_code": { "type": "string", - "description": "The identifier for the customer object. If not provided the customer ID will be autogenerated.", - "example": "cus_y3oqhf46pyzuxjbcn2giaqnb44", + "description": "The country code for the customer phone number", + "example": "+1", "nullable": true, "maxLength": 255 }, - "payment_id": { - "type": "string", - "description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant. This field is auto generated and is returned in the API response.", - "example": "pay_mbabizu24mvu3mela5njyhpit4", - "nullable": true, - "maxLength": 30, - "minLength": 30 - }, - "merchant_connector_details": { + "payment_experience": { "allOf": [ { - "$ref": "#/components/schemas/MerchantConnectorDetailsWrap" + "$ref": "#/components/schemas/PaymentExperience" } ], "nullable": true }, - "browser_info": { - "type": "object", - "description": "Additional details required by 3DS 2.0", - "nullable": true - }, - "payment_method_data": { + "payment_method_type": { "allOf": [ { - "$ref": "#/components/schemas/PaymentMethodData" + "$ref": "#/components/schemas/PaymentMethodType" } ], "nullable": true }, - "email": { - "type": "string", - "description": "description: The customer's email address", - "example": "johntest@test.com", - "nullable": true, - "maxLength": 255 - }, - "manual_retry": { + "off_session": { "type": "boolean", - "description": "If enabled payment can be retried from the client side until the payment is successful or payment expires or the attempts(configured by the merchant) for payment are exhausted." + "description": "Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with `confirm: true`.", + "example": true, + "nullable": true } } }, @@ -7162,6 +7210,11 @@ } ], "nullable": true + }, + "delayed_session_token": { + "type": "boolean", + "description": "Identifier for the delayed session response", + "nullable": true } } }, @@ -7627,6 +7680,32 @@ ], "example": "custom" }, + "SdkNextAction": { + "type": "object", + "required": [ + "next_action" + ], + "properties": { + "next_action": { + "$ref": "#/components/schemas/NextActionCall" + } + } + }, + "SecretInfoToInitiateSdk": { + "type": "object", + "required": [ + "display", + "payment" + ], + "properties": { + "display": { + "type": "string" + }, + "payment": { + "type": "string" + } + } + }, "SepaAndBacsBillingDetails": { "type": "object", "required": [ @@ -7763,6 +7842,17 @@ "propertyName": "wallet_name" } }, + "ThirdPartySdkSessionResponse": { + "type": "object", + "required": [ + "secrets" + ], + "properties": { + "secrets": { + "$ref": "#/components/schemas/SecretInfoToInitiateSdk" + } + } + }, "UpdateApiKeyRequest": { "type": "object", "description": "The request body for updating an API Key.", @@ -7815,6 +7905,17 @@ } } }, + { + "type": "object", + "required": [ + "apple_pay_redirect" + ], + "properties": { + "apple_pay_redirect": { + "$ref": "#/components/schemas/ApplePayRedirectData" + } + } + }, { "type": "object", "required": [