Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

feat(connector): [Checkout] add Apple Pay wallet payouts via UCS (#15160)

nithin-juspay35ed24332854
diff --git a/Cargo.lock b/Cargo.lock
index d074abb775..f319f5dcc6 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -102,7 +102,7 @@ dependencies = [
"log",
"memchr",
"mime",
- "rand 0.8.5",
+ "rand 0.8.6",
"serde",
"serde_json",
"serde_plain",
@@ -2220,7 +2220,7 @@ dependencies = [
"phonenumber",
"proptest",
"quick-xml",
- "rand 0.8.5",
+ "rand 0.8.6",
"regex",
"reqwest 0.13.5",
"ring 0.17.14",
@@ -2289,7 +2289,7 @@ dependencies = [
[[package]]
name = "config_patch_derive"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?tag=2026.11.04.1#198172f839a45ecf50974f55ca9ac07f1245a3c5"
+source = "git+https://github.com/juspay/connector-service?tag=2026.11.06.2#3597e805122646934cc94e82dc1e7f811e25c2c2"
dependencies = [
"proc-macro2",
"quote",
@@ -3603,7 +3603,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d391ba4af7f1d93f01fcf7b2f29e2bc9348e109dfdbf4dcbdc51dfa38dab0b6"
dependencies = [
"deunicode",
- "rand 0.8.5",
+ "rand 0.8.6",
]
[[package]]
@@ -3784,7 +3784,7 @@ dependencies = [
"futures",
"log",
"parking_lot",
- "rand 0.8.5",
+ "rand 0.8.6",
"redis-protocol",
"rustls 0.23.46",
"rustls-native-certs 0.7.3",
@@ -4180,7 +4180,7 @@ dependencies = [
"into-attr-derive",
"pest",
"pest_derive",
- "rand 0.8.5",
+ "rand 0.8.6",
"tempfile",
]
@@ -4198,7 +4198,7 @@ dependencies = [
[[package]]
name = "grpc-api-types"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?tag=2026.11.04.1#198172f839a45ecf50974f55ca9ac07f1245a3c5"
+source = "git+https://github.com/juspay/connector-service?tag=2026.11.06.2#3597e805122646934cc94e82dc1e7f811e25c2c2"
dependencies = [
"axum 0.8.4",
"bytes",
@@ -4758,7 +4758,7 @@ dependencies = [
"pem 3.0.5",
"qrcode",
"quick-xml",
- "rand 0.8.5",
+ "rand 0.8.6",
"regex",
"reqwest 0.13.5",
"ring 0.17.14",
@@ -5979,7 +5979,7 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ffa00dec017b5b1a8b7cf5e2c008bfda1aa7e0697ac1508b491fdf2622fb4d8"
dependencies = [
- "rand 0.8.5",
+ "rand 0.8.6",
]
[[package]]
@@ -6106,7 +6106,7 @@ dependencies = [
"num-integer",
"num-iter",
"num-traits",
- "rand 0.8.5",
+ "rand 0.8.6",
"smallvec",
"zeroize",
]
@@ -6246,7 +6246,7 @@ dependencies = [
"chrono",
"getrandom 0.2.16",
"http 0.2.12",
- "rand 0.8.5",
+ "rand 0.8.6",
"serde",
"serde_json",
"serde_path_to_error",
@@ -6260,7 +6260,7 @@ name = "oci_kms"
version = "0.1.0"
dependencies = [
"base64 0.22.1",
- "rand 0.8.5",
+ "rand 0.8.6",
"reqwest 0.12.7",
"rsa",
"serde",
@@ -6346,7 +6346,7 @@ dependencies = [
"oauth2",
"p256",
"p384",
- "rand 0.8.5",
+ "rand 0.8.6",
"rsa",
"serde",
"serde-value",
@@ -6513,7 +6513,7 @@ dependencies = [
"glob",
"opentelemetry",
"percent-encoding",
- "rand 0.8.5",
+ "rand 0.8.6",
"thiserror 1.0.69",
"tokio",
"tokio-stream",
@@ -6878,7 +6878,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6"
dependencies = [
"phf_shared 0.10.0",
- "rand 0.8.5",
+ "rand 0.8.6",
]
[[package]]
@@ -6888,7 +6888,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0"
dependencies = [
"phf_shared 0.11.2",
- "rand 0.8.5",
+ "rand 0.8.6",
]
[[package]]
@@ -7211,7 +7211,7 @@ dependencies = [
"bitflags 2.9.0",
"lazy_static",
"num-traits",
- "rand 0.8.5",
+ "rand 0.8.6",
"rand_chacha 0.3.1",
"rand_xorshift",
"regex-syntax 0.8.5",
@@ -7494,9 +7494,9 @@ checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09"
[[package]]
name = "rand"
-version = "0.8.5"
+version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
+checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a"
dependencies = [
"libc",
"rand_chacha 0.3.1",
@@ -8072,7 +8072,7 @@ dependencies = [
"payment_methods",
"pm_auth",
"prost-types 0.14.3",
- "rand 0.8.5",
+ "rand 0.8.6",
"rand_chacha 0.3.1",
"rdkafka",
"redis_interface",
@@ -8201,7 +8201,7 @@ dependencies = [
[[package]]
name = "rust-grpc-client"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?tag=2026.11.04.1#198172f839a45ecf50974f55ca9ac07f1245a3c5"
+source = "git+https://github.com/juspay/connector-service?tag=2026.11.06.2#3597e805122646934cc94e82dc1e7f811e25c2c2"
dependencies = [
"grpc-api-types",
]
@@ -8280,7 +8280,7 @@ dependencies = [
"borsh",
"bytes",
"num-traits",
- "rand 0.8.5",
+ "rand 0.8.6",
"rkyv",
"serde",
"serde_json",
@@ -8577,7 +8577,7 @@ dependencies = [
"futures",
"hyperswitch_domain_models",
"num_cpus",
- "rand 0.8.5",
+ "rand 0.8.6",
"redis_interface",
"router_env",
"serde",
@@ -9327,7 +9327,7 @@ dependencies = [
"memchr",
"once_cell",
"percent-encoding",
- "rand 0.8.5",
+ "rand 0.8.6",
"rsa",
"serde",
"sha1 0.10.6",
@@ -9368,7 +9368,7 @@ dependencies = [
"memchr",
"num-bigint",
"once_cell",
- "rand 0.8.5",
+ "rand 0.8.6",
"serde",
"serde_json",
"sha2 0.10.9",
@@ -9938,7 +9938,7 @@ dependencies = [
"percent-encoding",
"pest",
"pest_derive",
- "rand 0.8.5",
+ "rand 0.8.6",
"regex",
"serde",
"serde_json",
@@ -10004,7 +10004,7 @@ dependencies = [
"common_enums",
"common_utils",
"hyperswitch_masking",
- "rand 0.8.5",
+ "rand 0.8.6",
"reqwest 0.11.27",
"serde",
"serde_json",
@@ -10562,7 +10562,7 @@ dependencies = [
"indexmap 1.9.3",
"pin-project",
"pin-project-lite",
- "rand 0.8.5",
+ "rand 0.8.6",
"slab",
"tokio",
"tokio-util",
@@ -10834,7 +10834,7 @@ checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9"
[[package]]
name = "ucs_cards"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?tag=2026.11.04.1#198172f839a45ecf50974f55ca9ac07f1245a3c5"
+source = "git+https://github.com/juspay/connector-service?tag=2026.11.06.2#3597e805122646934cc94e82dc1e7f811e25c2c2"
dependencies = [
"bytes",
"error-stack 0.4.1",
@@ -10850,7 +10850,7 @@ dependencies = [
[[package]]
name = "ucs_common_enums"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?tag=2026.11.04.1#198172f839a45ecf50974f55ca9ac07f1245a3c5"
+source = "git+https://github.com/juspay/connector-service?tag=2026.11.06.2#3597e805122646934cc94e82dc1e7f811e25c2c2"
dependencies = [
"serde",
"strum 0.26.3",
@@ -10861,7 +10861,7 @@ dependencies = [
[[package]]
name = "ucs_common_utils"
version = "0.1.0"
-source = "git+https://github.com/juspay/connector-service?tag=2026.11.04.1#198172f839a45ecf50974f55ca9ac07f1245a3c5"
+source = "git+https://github.com/juspay/connector-service?tag=2026.11.06.2#3597e805122646934cc94e82dc1e7f811e25c2c2"
dependencies = [
"anyhow",
"base64 0.21.7",
@@ -10879,7 +10879,7 @@ dependencies = [
"once_cell",
"openssl",
"quick-xml",
- "rand 0.8.5",
+ "rand 0.8.6",
"regex",
"reqwest 0.12.7",
"ring 0.17.14",
diff --git a/api-reference/v1/openapi_spec_v1.json b/api-reference/v1/openapi_spec_v1.json
index d93e390c4a..ab6d8d6703 100644
--- a/api-reference/v1/openapi_spec_v1.json
+++ b/api-reference/v1/openapi_spec_v1.json
@@ -20406,6 +20406,56 @@
"month"
]
},
+ "CorporateSenderDetails": {
+ "type": "object",
+ "description": "A company providing the funds.",
+ "required": [
+ "company_name"
+ ],
+ "properties": {
+ "company_name": {
+ "type": "string",
+ "description": "The sender's legal company name.",
+ "example": "Acme Ltd",
+ "maxLength": 255
+ },
+ "address": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AddressDetails"
+ }
+ ],
+ "nullable": true
+ },
+ "email": {
+ "type": "string",
+ "description": "The sender's email address.",
+ "example": "[email protected]",
+ "nullable": true
+ },
+ "phone": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/PhoneDetails"
+ }
+ ],
+ "nullable": true
+ },
+ "reference_id": {
+ "type": "string",
+ "description": "The merchant's stable identifier for the sender.",
+ "nullable": true
+ },
+ "source_of_funds": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/SourceOfFunds"
+ }
+ ],
+ "nullable": true
+ }
+ }
+ },
"Country": {
"type": "string",
"enum": [
@@ -26820,6 +26870,68 @@
}
}
},
+ "IndividualSenderDetails": {
+ "type": "object",
+ "description": "An individual providing the funds.",
+ "properties": {
+ "first_name": {
+ "type": "string",
+ "description": "The sender's first name. When neither the first nor the last name is provided, the name\nfrom the billing address of the payment method is used instead.",
+ "example": "John",
+ "nullable": true,
+ "maxLength": 255
+ },
+ "last_name": {
+ "type": "string",
+ "description": "The sender's last name. When neither the first nor the last name is provided, the name\nfrom the billing address of the payment method is used instead.",
+ "example": "Doe",
+ "nullable": true,
+ "maxLength": 255
+ },
+ "date_of_birth": {
+ "type": "string",
+ "format": "date",
+ "description": "The sender's date of birth, in the format yyyy-mm-dd.",
+ "example": "1990-01-31",
+ "nullable": true
+ },
+ "address": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AddressDetails"
+ }
+ ],
+ "nullable": true
+ },
+ "email": {
+ "type": "string",
+ "description": "The sender's email address.",
+ "example": "[email protected]",
+ "nullable": true
+ },
+ "phone": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/PhoneDetails"
+ }
+ ],
+ "nullable": true
+ },
+ "reference_id": {
+ "type": "string",
+ "description": "The merchant's stable identifier for the sender",
+ "nullable": true
+ },
+ "source_of_funds": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/SourceOfFunds"
+ }
+ ],
+ "nullable": true
+ }
+ }
+ },
"IndomaretVoucherData": {
"type": "object",
"properties": {
@@ -40350,7 +40462,23 @@
},
"metadata": {
"type": "object",
- "description": "You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.",
+ "description": "Legacy vendor/individual details in metadata are a compatibility fallback for Stripe.\nExplicit sender_details takes precedence and is never merged with that identity.\nYou can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.",
+ "nullable": true
+ },
+ "funds_transfer_type": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/PayoutFundsTransferType"
+ }
+ ],
+ "nullable": true
+ },
+ "sender_details": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/SenderDetails"
+ }
+ ],
"nullable": true
},
"payout_token": {
@@ -40447,6 +40575,7 @@
"enum": [
"adyen",
"adyenplatform",
+ "checkout",
"cybersource",
"deutschebank",
"ebanx",
@@ -40669,6 +40798,22 @@
"description": "You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.",
"nullable": true
},
+ "funds_transfer_type": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/PayoutFundsTransferType"
+ }
+ ],
+ "nullable": true
+ },
+ "sender_details": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/SenderDetails"
+ }
+ ],
+ "nullable": true
+ },
"merchant_connector_id": {
"type": "string",
"description": "Unique identifier of the merchant connector account",
@@ -40827,6 +40972,26 @@
}
}
},
+ "PayoutFundsTransferType": {
+ "type": "string",
+ "description": "The category of funds transfer to use when processing a payout.",
+ "enum": [
+ "account_to_account",
+ "funds_transfer",
+ "cross_border_money_transfer",
+ "peer_to_peer",
+ "staged_digital_wallet_transfer",
+ "funds_disbursement",
+ "loyalty_payments",
+ "payroll_and_pension_disbursements",
+ "online_gambling",
+ "mastercard_person_to_person",
+ "mastercard_transfer_to_own_account",
+ "mastercard_business_disbursement",
+ "mastercard_business_to_business",
+ "mastercard_gaming_repay"
+ ]
+ },
"PayoutLinkInitiateRequest": {
"type": "object",
"required": [
@@ -41445,7 +41610,23 @@
},
"metadata": {
"type": "object",
- "description": "You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.",
+ "description": "Legacy vendor/individual details in metadata are a compatibility fallback for Stripe.\nExplicit sender_details takes precedence and is never merged with that identity.\nYou can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.",
+ "nullable": true
+ },
+ "funds_transfer_type": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/PayoutFundsTransferType"
+ }
+ ],
+ "nullable": true
+ },
+ "sender_details": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/SenderDetails"
+ }
+ ],
"nullable": true
},
"payout_token": {
@@ -41709,7 +41890,23 @@
},
"metadata": {
"type": "object",
- "description": "You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.",
+ "description": "Legacy vendor/individual details in metadata are a compatibility fallback for Stripe.\nExplicit sender_details takes precedence and is never merged with that identity.\nYou can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.",
+ "nullable": true
+ },
+ "funds_transfer_type": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/PayoutFundsTransferType"
+ }
+ ],
+ "nullable": true
+ },
+ "sender_details": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/SenderDetails"
+ }
+ ],
"nullable": true
},
"payout_token": {
@@ -42283,6 +42480,7 @@
},
"PhoneDetails": {
"type": "object",
+ "description": "Phone contact details shared by payment and payout API models.",
"properties": {
"number": {
"type": "string",
@@ -47345,6 +47543,56 @@
}
}
},
+ "SenderDetails": {
+ "oneOf": [
+ {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/IndividualSenderDetails"
+ },
+ {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "individual"
+ ]
+ }
+ }
+ }
+ ]
+ },
+ {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/CorporateSenderDetails"
+ },
+ {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "corporate"
+ ]
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "description": "Details of the party providing the funds.",
+ "discriminator": {
+ "propertyName": "type"
+ }
+ },
"SepaAndBacsBillingDetails": {
"type": "object",
"properties": {
@@ -47831,6 +48079,18 @@
"SkrillData": {
"type": "object"
},
+ "SourceOfFunds": {
+ "type": "string",
+ "description": "Origin of the funds, supplied by the merchant.",
+ "enum": [
+ "credit",
+ "debit",
+ "prepaid",
+ "deposit_account",
+ "mobile_money_account",
+ "cash"
+ ]
+ },
"SplitPaymentsRequest": {
"oneOf": [
{
diff --git a/api-reference/v2/openapi_spec_v2.json b/api-reference/v2/openapi_spec_v2.json
index ae6b2fa24c..d15d9ff914 100644
--- a/api-reference/v2/openapi_spec_v2.json
+++ b/api-reference/v2/openapi_spec_v2.json
@@ -13377,6 +13377,56 @@
"month"
]
},
+ "CorporateSenderDetails": {
+ "type": "object",
+ "description": "A company providing the funds.",
+ "required": [
+ "company_name"
+ ],
+ "properties": {
+ "company_name": {
+ "type": "string",
+ "description": "The sender's legal company name.",
+ "example": "Acme Ltd",
+ "maxLength": 255
+ },
+ "address": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AddressDetails"
+ }
+ ],
+ "nullable": true
+ },
+ "email": {
+ "type": "string",
+ "description": "The sender's email address.",
+ "example": "[email protected]",
+ "nullable": true
+ },
+ "phone": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/PhoneDetails"
+ }
+ ],
+ "nullable": true
+ },
+ "reference_id": {
+ "type": "string",
+ "description": "The merchant's stable identifier for the sender.",
+ "nullable": true
+ },
+ "source_of_funds": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/SourceOfFunds"
+ }
+ ],
+ "nullable": true
+ }
+ }
+ },
"CountryAlpha2": {
"type": "string",
"enum": [
@@ -18405,6 +18455,68 @@
}
}
},
+ "IndividualSenderDetails": {
+ "type": "object",
+ "description": "An individual providing the funds.",
+ "properties": {
+ "first_name": {
+ "type": "string",
+ "description": "The sender's first name. When neither the first nor the last name is provided, the name\nfrom the billing address of the payment method is used instead.",
+ "example": "John",
+ "nullable": true,
+ "maxLength": 255
+ },
+ "last_name": {
+ "type": "string",
+ "description": "The sender's last name. When neither the first nor the last name is provided, the name\nfrom the billing address of the payment method is used instead.",
+ "example": "Doe",
+ "nullable": true,
+ "maxLength": 255
+ },
+ "date_of_birth": {
+ "type": "string",
+ "format": "date",
+ "description": "The sender's date of birth, in the format yyyy-mm-dd.",
+ "example": "1990-01-31",
+ "nullable": true
+ },
+ "address": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/AddressDetails"
+ }
+ ],
+ "nullable": true
+ },
+ "email": {
+ "type": "string",
+ "description": "The sender's email address.",
+ "example": "[email protected]",
+ "nullable": true
+ },
+ "phone": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/PhoneDetails"
+ }
+ ],
+ "nullable": true
+ },
+ "reference_id": {
+ "type": "string",
+ "description": "The merchant's stable identifier for the sender",
+ "nullable": true
+ },
+ "source_of_funds": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/SourceOfFunds"
+ }
+ ],
+ "nullable": true
+ }
+ }
+ },
"IndomaretVoucherData": {
"type": "object",
"properties": {
@@ -28124,6 +28236,7 @@
"enum": [
"adyen",
"adyenplatform",
+ "checkout",
"cybersource",
"deutschebank",
"ebanx",
@@ -28374,7 +28487,23 @@
},
"metadata": {
"type": "object",
- "description": "You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.",
+ "description": "Legacy vendor/individual details in metadata are a compatibility fallback for Stripe.\nExplicit sender_details takes precedence and is never merged with that identity.\nYou can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.",
+ "nullable": true
+ },
+ "funds_transfer_type": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/PayoutFundsTransferType"
+ }
+ ],
+ "nullable": true
+ },
+ "sender_details": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/SenderDetails"
+ }
+ ],
"nullable": true
},
"payout_token": {
@@ -28620,6 +28749,22 @@
"description": "You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.",
"nullable": true
},
+ "funds_transfer_type": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/PayoutFundsTransferType"
+ }
+ ],
+ "nullable": true
+ },
+ "sender_details": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/SenderDetails"
+ }
+ ],
+ "nullable": true
+ },
"merchant_connector_id": {
"type": "string",
"description": "Unique identifier of the merchant connector account",
@@ -28763,6 +28908,26 @@
"Personal"
]
},
+ "PayoutFundsTransferType": {
+ "type": "string",
+ "description": "The category of funds transfer to use when processing a payout.",
+ "enum": [
+ "account_to_account",
+ "funds_transfer",
+ "cross_border_money_transfer",
+ "peer_to_peer",
+ "staged_digital_wallet_transfer",
+ "funds_disbursement",
+ "loyalty_payments",
+ "payroll_and_pension_disbursements",
+ "online_gambling",
+ "mastercard_person_to_person",
+ "mastercard_transfer_to_own_account",
+ "mastercard_business_disbursement",
+ "mastercard_business_to_business",
+ "mastercard_gaming_repay"
+ ]
+ },
"PayoutLinkInitiateRequest": {
"type": "object",
"required": [
@@ -29709,6 +29874,7 @@
},
"PhoneDetails": {
"type": "object",
+ "description": "Phone contact details shared by payment and payout API models.",
"properties": {
"number": {
"type": "string",
@@ -34392,6 +34558,56 @@
}
}
},
+ "SenderDetails": {
+ "oneOf": [
+ {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/IndividualSenderDetails"
+ },
+ {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "individual"
+ ]
+ }
+ }
+ }
+ ]
+ },
+ {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/CorporateSenderDetails"
+ },
+ {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "corporate"
+ ]
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "description": "Details of the party providing the funds.",
+ "discriminator": {
+ "propertyName": "type"
+ }
+ },
"SepaAndBacsBillingDetails": {
"type": "object",
"properties": {
@@ -34874,6 +35090,18 @@
"modified"
]
},
+ "SourceOfFunds": {
+ "type": "string",
+ "description": "Origin of the funds, supplied by the merchant.",
+ "enum": [
+ "credit",
+ "debit",
+ "prepaid",
+ "deposit_account",
+ "mobile_money_account",
+ "cash"
+ ]
+ },
"SplitPaymentMethodDataRequest": {
"type": "object",
"required": [
diff --git a/config/config.example.toml b/config/config.example.toml
index 1bc0bc7371..0c4f2c4033 100644
--- a/config/config.example.toml
+++ b/config/config.example.toml
@@ -1362,6 +1362,9 @@ debit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RY,TMT,AED,UGX,UAH,USD,UZS,VUV,VND,YER,CNY,ZMW,ZWL" }
+[payout_method_filters.checkout]
+apple_pay = { country = "AM, AT, AZ, BY, BE, BG, HR, CY, DK, EE, FO, FI, FR, GE, DE, GR, GL, GG, HU, IS, IE, IM, IT, KZ, JE, LV, LI, LT, LU, MT, MD, MC, ME, NL, NO, PL, PT, RO, SM, RS, SK, SI, ES, SE, CH, UA, GB, VA, AU , HK, JP , MY , MN, NZ, SG, TW, VN, EG , MA, ZA, AR, BR, CL, CO, CR, DO, EC, SV, GT, HN, MX, PA, PY, PE, UY, BH, IL, JO, KW, OM,QA, SA, AE, CA", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MOP, MYR, MNT, NZD, SGD, KRW, TWD, VND, AMD, EUR, BGN, CZK, DKK, GEL, GBP, HUF, ISK, KZT, CHF, MDL, NOK, PLN, RON, RSD, SEK, UAH, BRL, COP, CRC, DOP, GTQ, HNL, MXN, PAB, PYG, PEN, BSD, UYU, BHD, ILS, JOD, KWD, OMR, QAR, SAR, AED, CAD, USD" }
+
[payment_link]
sdk_url = "http://localhost:9090/0.16.7/v0/HyperLoader.js"
diff --git a/config/deployments/integration_test.toml b/config/deployments/integration_test.toml
index eefd21d459..2c3cfe3947 100644
--- a/config/deployments/integration_test.toml
+++ b/config/deployments/integration_test.toml
@@ -918,6 +918,9 @@ credit = { country = "AF,DZ,AW,AU,AZ,BS,BH,BD,BB,BZ,BM,BT,BO,BA,BW,BR,BN,BG,BI,K
apple_pay = { country = "AF,DZ,AW,AU,AZ,BS,BH,BD,BB,BZ,BM,BT,BO,BA,BW,BR,BN,BG,BI,KH,CA,CV,KY,CL,CO,KM,CD,CR,CZ,DK,DJ,ST,DO,EC,EG,SV,ER,ET,FK,FJ,GM,GE,GH,GI,GT,GN,GY,HT,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IL,IT,JM,JP,JO,KZ,KE,KW,LA,LB,LS,LR,LY,LT,MO,MK,MG,MW,MY,M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MX,MD,MN,MA,MZ,MM,NA,NZ,NI,NG,KP,NO,AR,PK,PG,PY,PE,UY,PH,PL,GB,QA,OM,RO,RU,RW,WS,SG,ST,ZA,KR,LK,SH,SD,SR,SZ,SE,CH,SY,TW,TJ,TZ,TH,TT,TN,TR,UG,UA,US,UZ,VU,VE,VN,ZM,ZW", currency = "AFN,DZD,ANG,AWG,AUD,AZN,BSD,BHD,BDT,BBD,BZD,BMD,BTN,BOB,BAM,BWP,BRL,BND,BGN,BIF,KHR,CAD,CVE,KYD,XOF,XAF,XPF,CLP,COP,KMF,CDF,CRC,EUR,CZK,DKK,DJF,DOP,XCD,EGP,SVC,ERN,ETB,EUR,FKP,FJD,GMD,GEL,GHS,GIP,GTQ,GNF,GYD,HTG,HNL,HKD,HUF,ISK,INR,IDR,IRR,IQD,ILS,JMD,JPY,JOD,KZT,KES,KWD,LAK,LBP,LSL,LRD,LYD,MOP,MKD,MGA,MWK,MYR,MVR,MRU,MUR,MXN,MDL,MNT,MAD,MZN,MMK,NAD,NPR,NZD,NIO,NGN,KPW,NOK,ARS,PKR,PAB,PGK,PYG,PEN,UYU,PHP,PLN,GBP,QAR,OMR,RON,RUB,RWF,WST,SAR,RSD,SCR,SLL,SGD,STN,SBD,SOS,ZAR,KRW,LKR,SHP,SDG,SRD,SZL,SEK,CHF,SYP,TWD,TJS,TZS,THB,TOP,TTD,TND,TRY,TMT,AED,UGX,UAH,USD,UZS,VUV,VND,YER,CNY,ZMW,ZWL" }
+[payout_method_filters.checkout]
+apple_pay = { country = "AM, AT,US, AZ, BY, BE, BG, HR, CY, DK, EE, FO, FI, FR, GE, DE, GR, GL, GG, HU, IS, IE, IM, IT, KZ, JE, LV, LI, LT, LU, MT, MD, MC, ME, NL, NO, PL, PT, RO, SM, RS, SK, SI, ES, SE, CH, UA, GB, VA, AU , HK, JP , MY , MN, NZ, SG, TW, VN, EG , MA, ZA, AR, BR, CL, CO, CR, DO, EC, SV, GT, HN, MX, PA, PY, PE, UY, BH, IL, JO, KW, OM,QA, SA, AE, CA", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MOP, MYR, MNT, NZD, SGD, KRW, TWD, VND, AMD, EUR, BGN, CZK, DKK, GEL, GBP, HUF, ISK, KZT, CHF, MDL, NOK, PLN, RON, RSD, SEK, UAH, BRL, COP, CRC, DOP, GTQ, HNL, MXN, PAB, PYG, PEN, BSD, UYU, BHD, ILS, JOD, KWD, OMR, QAR, SAR, AED, CAD, USD" }
+
[pm_filters.inespay]
sepa = { country = "ES", currency = "EUR"}
diff --git a/config/deployments/production.toml b/config/deployments/production.toml
index f45908b079..bd4dde1a28 100644
--- a/config/deployments/production.toml
+++ b/config/deployments/production.toml
@@ -1020,6 +1020,9 @@ credit = { country = "AF,DZ,AW,AU,AZ,BS,BH,BD,BB,BZ,BM,BT,BO,BA,BW,BR,BN,BG,BI,K
apple_pay = { country = "AF,DZ,AW,AU,AZ,BS,BH,BD,BB,BZ,BM,BT,BO,BA,BW,BR,BN,BG,BI,KH,CA,CV,KY,CL,CO,KM,CD,CR,CZ,DK,DJ,ST,DO,EC,EG,SV,ER,ET,FK,FJ,GM,GE,GH,GI,GT,GN,GY,HT,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IL,IT,JM,JP,JO,KZ,KE,KW,LA,LB,LS,LR,LY,LT,MO,MK,MG,MW,MY,MV,MR,MU,MX,MD,MN,MA,MZ,MM,NA,NZ,NI,NG,KP,NO,AR,PK,PG,PY,PE,UY,PH,PL,GB,QA,OM,RO,RU,RW,WS,SG,ST,ZA,KR,LK,SH,SD,SR,SZ,SE,CH,SY,TW,TJ,TZ,TH,TT,TN,TR,UG,UA,US,UZ,VU,VE,VN,ZM,ZW", currency = "AFN,DZD,ANG,AWG,AUD,AZN,BSD,BHD,BDT,BBD,BZD,BMD,BTN,BOB,BAM,BWP,BRL,BND,BGN,BIF,KHR,CAD,CVE,KYD,XOF,XAF,XPF,CLP,COP,KMF,CDF,CRC,EUR,CZK,DKK,DJF,DOP,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SVC,ERN,ETB,EUR,FKP,FJD,GMD,GEL,GHS,GIP,GTQ,GNF,GYD,HTG,HNL,HKD,HUF,ISK,INR,IDR,IRR,IQD,ILS,JMD,JPY,JOD,KZT,KES,KWD,LAK,LBP,LSL,LRD,LYD,MOP,MKD,MGA,MWK,MYR,MVR,MRU,MUR,MXN,MDL,MNT,MAD,MZN,MMK,NAD,NPR,NZD,NIO,NGN,KPW,NOK,ARS,PKR,PAB,PGK,PYG,PEN,UYU,PHP,PLN,GBP,QAR,OMR,RON,RUB,RWF,WST,SAR,RSD,SCR,SLL,SGD,STN,SBD,SOS,ZAR,KRW,LKR,SHP,SDG,SRD,SZL,SEK,CHF,SYP,TWD,TJS,TZS,THB,TOP,TTD,TND,TRY,TMT,AED,UGX,UAH,USD,UZS,VUV,VND,YER,CNY,ZMW,ZWL" }
+[payout_method_filters.checkout]
+apple_pay = { country = "AM, AT,US, AZ, BY, BE, BG, HR, CY, DK, EE, FO, FI, FR, GE, DE, GR, GL, GG, HU, IS, IE, IM, IT, KZ, JE, LV, LI, LT, LU, MT, MD, MC, ME, NL, NO, PL, PT, RO, SM, RS, SK, SI, ES, SE, CH, UA, GB, VA, AU , HK, JP , MY , MN, NZ, SG, TW, VN, EG , MA, ZA, AR, BR, CL, CO, CR, DO, EC, SV, GT, HN, MX, PA, PY, PE, UY, BH, IL, JO, KW, OM,QA, SA, AE, CA", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MOP, MYR, MNT, NZD, SGD, KRW, TWD, VND, AMD, EUR, BGN, CZK, DKK, GEL, GBP, HUF, ISK, KZT, CHF, MDL, NOK, PLN, RON, RSD, SEK, UAH, BRL, COP, CRC, DOP, GTQ, HNL, MXN, PAB, PYG, PEN, BSD, UYU, BHD, ILS, JOD, KWD, OMR, QAR, SAR, AED, CAD, USD" }
+
[temp_locker_enable_config]
ilixium.payment_method = "card"
bluesnap.payment_method = "card"
diff --git a/config/deployments/sandbox.toml b/config/deployments/sandbox.toml
index 24dc97059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S,ZAR,KRW,LKR,SHP,SDG,SRD,SZL,SEK,CHF,SYP,TWD,TJS,TZS,THB,TOP,TTD,TND,TRY,TMT,AED,UGX,UAH,USD,UZS,VUV,VND,YER,CNY,ZMW,ZWL" }
+[payout_method_filters.checkout]
+apple_pay = { country = "AM, AT,US, AZ, BY, BE, BG, HR, CY, DK, EE, FO, FI, FR, GE, DE, GR, GL, GG, HU, IS, IE, IM, IT, KZ, JE, LV, LI, LT, LU, MT, MD, MC, ME, NL, NO, PL, PT, RO, SM, RS, SK, SI, ES, SE, CH, UA, GB, VA, AU , HK, JP , MY , MN, NZ, SG, TW, VN, EG , MA, ZA, AR, BR, CL, CO, CR, DO, EC, SV, GT, HN, MX, PA, PY, PE, UY, BH, IL, JO, KW, OM,QA, SA, AE, CA", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MOP, MYR, MNT, NZD, SGD, KRW, TWD, VND, AMD, EUR, BGN, CZK, DKK, GEL, GBP, HUF, ISK, KZT, CHF, MDL, NOK, PLN, RON, RSD, SEK, UAH, BRL, COP, CRC, DOP, GTQ, HNL, MXN, PAB, PYG, PEN, BSD, UYU, BHD, ILS, JOD, KWD, OMR, QAR, SAR, AED, CAD, USD" }
+
[temp_locker_enable_config]
ilixium.payment_method = "card"
bluesnap.payment_method = "card"
diff --git a/config/development.toml b/config/development.toml
index a9d1bbe482..67e2a843ba 100644
--- a/config/development.toml
+++ b/config/development.toml
@@ -1510,6 +1510,9 @@ credit = { country = "AF,DZ,AW,AU,AZ,BS,BH,BD,BB,BZ,BM,BT,BO,BA,BW,BR,BN,BG,BI,K
apple_pay = { country = "AF,DZ,AW,AU,AZ,BS,BH,BD,BB,BZ,BM,BT,BO,BA,BW,BR,BN,BG,BI,KH,CA,CV,KY,CL,CO,KM,CD,CR,CZ,DK,DJ,ST,DO,EC,EG,SV,ER,ET,FK,FJ,GM,GE,GH,GI,GT,GN,GY,HT,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IL,IT,JM,JP,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E,KW,LA,LB,LS,LR,LY,LT,MO,MK,MG,MW,MY,MV,MR,MU,MX,MD,MN,MA,MZ,MM,NA,NZ,NI,NG,KP,NO,AR,PK,PG,PY,PE,UY,PH,PL,GB,QA,OM,RO,RU,RW,WS,SG,ST,ZA,KR,LK,SH,SD,SR,SZ,SE,CH,SY,TW,TJ,TZ,TH,TT,TN,TR,UG,UA,US,UZ,VU,VE,VN,ZM,ZW", currency = "AFN,DZD,ANG,AWG,AUD,AZN,BSD,BHD,BDT,BBD,BZD,BMD,BTN,BOB,BAM,BWP,BRL,BND,BGN,BIF,KHR,CAD,CVE,KYD,XOF,XAF,XPF,CLP,COP,KMF,CDF,CRC,EUR,CZK,DKK,DJF,DOP,XCD,EGP,SVC,ERN,ETB,EUR,FKP,FJD,GMD,GEL,GHS,GIP,GTQ,GNF,GYD,HTG,HNL,HKD,HUF,ISK,INR,IDR,IRR,IQD,ILS,JMD,JPY,JOD,KZT,KES,KWD,LAK,LBP,LSL,LRD,LYD,MOP,MKD,MGA,MWK,MYR,MVR,MRU,MUR,MXN,MDL,MNT,MAD,MZN,MMK,NAD,NPR,NZD,NIO,NGN,KPW,NOK,ARS,PKR,PAB,PGK,PYG,PEN,UYU,PHP,PLN,GBP,QAR,OMR,RON,RUB,RWF,WST,SAR,RSD,SCR,SLL,SGD,STN,SBD,SOS,ZAR,KRW,LKR,SHP,SDG,SRD,SZL,SEK,CHF,SYP,TWD,TJS,TZS,THB,TOP,TTD,TND,TRY,TMT,AED,UGX,UAH,USD,UZS,VUV,VND,YER,CNY,ZMW,ZWL" }
+[payout_method_filters.checkout]
+apple_pay = { country = "AM,US, AT, AZ, BY, BE, BG, HR, CY, DK, EE, FO, FI, FR, GE, DE, GR, GL, GG, HU, IS, IE, IM, IT, KZ, JE, LV, LI, LT, LU, MT, MD, MC, ME, NL, NO, PL, PT, RO, SM, RS, SK, SI, ES, SE, CH, UA, GB, VA, AU , HK, JP , MY , MN, NZ, SG, TW, VN, EG , MA, ZA, AR, BR, CL, CO, CR, DO, EC, SV, GT, HN, MX, PA, PY, PE, UY, BH, IL, JO, KW, OM,QA, SA, AE, CA", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MOP, MYR, MNT, NZD, SGD, KRW, TWD, VND, AMD, EUR, BGN, CZK, DKK, GEL, GBP, HUF, ISK, KZT, CHF, MDL, NOK, PLN, RON, RSD, SEK, UAH, BRL, COP, CRC, DOP, GTQ, HNL, MXN, PAB, PYG, PEN, BSD, UYU, BHD, ILS, JOD, KWD, OMR, QAR, SAR, AED, CAD, USD" }
+
[payment_link]
sdk_url = "http://localhost:9050/HyperLoader.js"
diff --git a/config/docker_compose.toml b/config/docker_compose.toml
index 3f7e3676ab..344b4e265a 100644
--- a/config/docker_compose.toml
+++ b/config/docker_compose.toml
@@ -1498,6 +1498,9 @@ debit = { country = "AF,DZ,AW,AU,AZ,BS,BH,BD,BB,BZ,BM,BT,BO,BA,BW,BR,BN,BG,BI,KH
credit = { country = "AF,DZ,AW,AU,AZ,BS,BH,BD,BB,BZ,BM,BT,BO,BA,BW,BR,BN,BG,BI,KH,CA,CV,KY,CL,CO,KM,CD,CR,CZ,DK,DJ,ST,DO,EC,EG,SV,ER,ET,FK,FJ,GM,GE,GH,GI,GT,GN,GY,HT,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IL,IT,JM,JP,JO,KZ,KE,KW,LA,LB,LS,LR,LY,LT,MO,MK,MG,MW,MY,MV,MR,MU,MX,MD,MN,MA,MZ,MM,NA,NZ,NI,NG,KP,NO,AR,PK,PG,PY,PE,UY,PH,PL,GB,QA,OM,RO,RU,RW,WS,SG,ST,ZA,KR,LK,SH,SD,SR,SZ,SE,CH,SY,TW,TJ,TZ,TH,TT,TN,TR,UG,UA,US,UZ,VU,VE,VN,ZM,ZW", currency = "AFN,DZD,ANG,AWG,AUD,AZN,BSD,BHD,BDT,BBD,BZD,BMD,BTN,BOB,BAM,BWP,BRL,BND,BGN,BIF,KHR,CAD,CVE,KYD,XOF,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,CLP,COP,KMF,CDF,CRC,EUR,CZK,DKK,DJF,DOP,XCD,EGP,SVC,ERN,ETB,EUR,FKP,FJD,GMD,GEL,GHS,GIP,GTQ,GNF,GYD,HTG,HNL,HKD,HUF,ISK,INR,IDR,IRR,IQD,ILS,JMD,JPY,JOD,KZT,KES,KWD,LAK,LBP,LSL,LRD,LYD,MOP,MKD,MGA,MWK,MYR,MVR,MRU,MUR,MXN,MDL,MNT,MAD,MZN,MMK,NAD,NPR,NZD,NIO,NGN,KPW,NOK,ARS,PKR,PAB,PGK,PYG,PEN,UYU,PHP,PLN,GBP,QAR,OMR,RON,RUB,RWF,WST,SAR,RSD,SCR,SLL,SGD,STN,SBD,SOS,ZAR,KRW,LKR,SHP,SDG,SRD,SZL,SEK,CHF,SYP,TWD,TJS,TZS,THB,TOP,TTD,TND,TRY,TMT,AED,UGX,UAH,USD,UZS,VUV,VND,YER,CNY,ZMW,ZWL" }
+[payout_method_filters.checkout]
+apple_pay = { country = "AM, AT, AZ, BY, BE, BG, HR, CY, DK, EE, FO, FI, FR, GE, DE, GR, GL, GG, HU, IS, IE, IM, IT, KZ, JE, LV, LI, LT, LU, MT, MD, MC, ME, NL, NO, PL, PT, RO, SM, RS, SK, SI, ES, SE, CH, UA, GB, VA, AU , HK, JP , MY , MN, NZ, SG, TW, VN, EG , MA, ZA, AR, BR, CL, CO, CR, DO, EC, SV, GT, HN, MX, PA, PY, PE, UY, BH, IL, JO, KW, OM,QA, SA, AE, CA", currency = "EGP, MAD, ZAR, AUD, CNY, HKD, JPY, MOP, MYR, MNT, NZD, SGD, KRW, TWD, VND, AMD, EUR, BGN, CZK, DKK, GEL, GBP, HUF, ISK, KZT, CHF, MDL, NOK, PLN, RON, RSD, SEK, UAH, BRL, COP, CRC, DOP, GTQ, HNL, MXN, PAB, PYG, PEN, BSD, UYU, BHD, ILS, JOD, KWD, OMR, QAR, SAR, AED, CAD, USD" }
+
[locker_based_open_banking_connectors]
connector_list = "tokenio"
diff --git a/crates/api_models/src/enums.rs b/crates/api_models/src/enums.rs
index ddd5ef19ca..ac70ec4f05 100644
--- a/crates/api_models/src/enums.rs
+++ b/crates/api_models/src/enums.rs
@@ -48,6 +48,7 @@ pub enum RoutingAlgorithm {
pub enum PayoutConnectors {
Adyen,
Adyenplatform,
+ Checkout,
Cybersource,
Deutschebank,
Ebanx,
@@ -99,6 +100,7 @@ impl From<PayoutConnectors> for RoutableConnectors {
match value {
PayoutConnectors::Adyen => Self::Adyen,
PayoutConnectors::Adyenplatform => Self::Adyenplatform,
+ PayoutConnectors::Checkout => Self::Checkout,
PayoutConnectors::Cybersource => Self::Cybersource,
PayoutConnectors::Deutschebank => Self::Deutschebank,
PayoutConnectors::Ebanx => Self::Ebanx,
@@ -129,6 +131,7 @@ impl From<PayoutConnectors> for Connector {
match value {
PayoutConnectors::Adyen => Self::Adyen,
PayoutConnectors::Adyenplatform => Self::Adyenplatform,
+ PayoutConnectors::Checkout => Self::Checkout,
PayoutConnectors::Cybersource => Self::Cybersource,
PayoutConnectors::Deutschebank => Self::Deutschebank,
PayoutConnectors::Ebanx => Self::Ebanx,
@@ -160,6 +163,7 @@ impl TryFrom<Connector> for PayoutConnectors {
match value {
Connector::Adyen => Ok(Self::Adyen),
Connector::Adyenplatform => Ok(Self::Adyenplatform),
+ Connector::Checkout => Ok(Self::Checkout),
Connector::Cybersource => Ok(Self::Cybersource),
Connector::Deutschebank => Ok(Self::Deutschebank),
Connector::Ebanx => Ok(Self::Ebanx),
diff --git a/crates/api_models/src/lib.rs b/crates/api_models/src/lib.rs
index 390c19c649..c227b3d6ea 100644
--- a/crates/api_models/src/lib.rs
+++ b/crates/api_models/src/lib.rs
@@ -48,6 +48,7 @@ pub mod relay;
#[cfg(feature = "v2")]
pub mod revenue_recovery_data_backfill;
pub mod routing;
+pub mod sender;
pub mod subscription;
pub mod superposition_proxy;
pub mod superposition_sdk_config;
diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs
index bac0d372f3..c5acefff54 100644
--- a/crates/api_models/src/payments.rs
+++ b/crates/api_models/src/payments.rs
@@ -74,6 +74,7 @@ where
None => Ok(None),
}
}
+pub use common_types::payments::PhoneDetails;
#[cfg(feature = "v1")]
use hyperswitch_masking::ExposeInterface;
use hyperswitch_masking::{PeekInterface, Secret, WithType};
@@ -6865,29 +6866,6 @@ pub struct EncryptableAddressDetails {
pub email: crypto::OptionalEncryptableEmail,
}
-#[derive(
- Debug,
- Clone,
- Default,
- Eq,
- PartialEq,
- ToSchema,
- serde::Deserialize,
- serde::Serialize,
- SmithyModel,
-)]
-#[smithy(namespace = "com.hyperswitch.smithy.types")]
-pub struct PhoneDetails {
- /// The contact number
- #[schema(value_type = Option<String>, example = "9123456789")]
- #[smithy(value_type = "Option<String>")]
- pub number: Option<Secret<String>>,
- /// The country code attached to the number
- #[schema(example = "+1")]
- #[smithy(value_type = "Option<String>")]
- pub country_code: Option<String>,
-}
-
#[cfg(feature = "v1")]
#[derive(
Debug,
diff --git a/crates/api_models/src/payouts.rs b/crates/api_models/src/payouts.rs
index 54884af40c..86f58f4ec8 100644
--- a/crates/api_models/src/payouts.rs
+++ b/crates/api_models/src/payouts.rs
@@ -1,7 +1,7 @@
use std::collections::HashMap;
use cards::CardNumber;
-use common_enums::{BankNames, CardNetwork};
+use common_enums::{BankNames, CardNetwork, PayoutFundsTransferType};
use common_types::payouts::PayoutsBillingDescriptor;
#[cfg(feature = "v2")]
use common_utils::types::BrowserInformation;
@@ -22,7 +22,9 @@ use serde::{Deserialize, Serialize};
use time::PrimitiveDateTime;
use utoipa::ToSchema;
-use crate::{admin, enums as api_enums, payment_methods::RequiredFieldInfo, payments};
+use crate::{
+ admin, enums as api_enums, payment_methods::RequiredFieldInfo, payments, sender::SenderDetails,
+};
#[derive(Debug, Serialize, Clone, ToSchema)]
pub enum PayoutRequest {
@@ -159,10 +161,20 @@ pub struct PayoutCreateRequest {
#[schema(value_type = Option<bool>, default = false)]
pub recurring: Option<bool>,
+ /// Legacy vendor/individual details in metadata are a compatibility fallback for Stripe.
+ /// Explicit sender_details takes precedence and is never merged with that identity.
/// You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.
#[schema(value_type = Option<Object>, example = r#"{ "udf1": "some-value", "udf2": "some-value" }"#)]
pub metadata: Option<pii::SecretSerdeValue>,
+ /// The category of funds transfer to use when processing the payout.
+ #[schema(value_type = Option<PayoutFundsTransferType>, example = "account_to_account")]
+ pub funds_transfer_type: Option<PayoutFundsTransferType>,
+
+ /// Identity of the party providing the funds. Persisted on the payout and echoed
+ #[schema(value_type = Option<SenderDetails>)]
+ pub sender_details: Option<SenderDetails>,
+
/// Provide a reference to a stored payout method, used to process the payout.
#[schema(example = "187282ab-40ef-47a9-9206-5099ba31e432", value_type = Option<String>)]
pub payout_token: Option<String>,
@@ -972,6 +984,14 @@ pub struct PayoutCreateResponse {
#[schema(value_type = Option<Object>, example = r#"{ "udf1": "some-value", "udf2": "some-value" }"#)]
pub metadata: Option<pii::SecretSerdeValue>,
+ /// The category of funds transfer used for the payout.
+ #[schema(value_type = Option<PayoutFundsTransferType>, example = "account_to_account")]
+ pub funds_transfer_type: Option<PayoutFundsTransferType>,
+
+ /// Identity of the party providing the funds, as supplied in the payout request
+ #[schema(value_type = Option<SenderDetails>)]
+ pub sender_details: Option<SenderDetails>,
+
/// Unique identifier of the merchant connector account
#[schema(value_type = Option<String>, example = "mca_sAD3OZLATetvjLOYhUSy")]
pub merchant_connector_id: Option<id_type::MerchantConnectorAccountId>,
@@ -1161,34 +1181,73 @@ pub struct PayoutActionRequest {
pub payout_id: id_type::PayoutId,
}
-#[derive(Default, Debug, ToSchema, Clone, Serialize, Deserialize)]
+/// Normalized payout party/account data consumed by domain and connector code.
+///
+/// Populated either by converting the explicit [`crate::sender::SenderDetails`] supplied with
+/// the payout request, or by parsing legacy vendor metadata when sender details are absent.
+/// It is never persisted directly; only `sender_details` is stored on the payout row.
+/// Existing field names and types are retained for connector compatibility.
+#[derive(Default, Debug, ToSchema, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct PayoutVendorAccountDetails {
+ /// Vendor or corporate party details, retaining the legacy field layout.
pub vendor_details: PayoutVendorDetails,
+ /// Individual party or account representative details.
pub individual_details: PayoutIndividualDetails,
}
-#[derive(Default, Debug, Serialize, ToSchema, Clone, Deserialize)]
+/// Vendor/account information, with the corporate sender fields appended at the end.
+#[derive(Default, Debug, Serialize, ToSchema, Clone, Deserialize, PartialEq, Eq)]
pub struct PayoutVendorDetails {
+ /// Connector account type; empty for sender-only input without account setup.
pub account_type: String,
+ /// Existing party discriminator: individual or company.
pub business_type: String,
+ /// Merchant category code for the business.
pub business_profile_mcc: Option<i32>,
+ /// Business profile URL.
pub business_profile_url: Option<String>,
+ /// Business name; also carries the corporate sender company name.
pub business_profile_name: Option<Secret<String>>,
+ /// Corporate sender street address.
pub company_address_line1: Option<Secret<String>>,
+ /// Additional corporate sender street address.
pub company_address_line2: Option<Secret<String>>,
+ /// Corporate sender postal code.
pub company_address_postal_code: Option<Secret<String>>,
+ /// Corporate sender city.
pub company_address_city: Option<Secret<String>>,
+ /// Corporate sender state or province.
pub company_address_state: Option<Secret<String>>,
+ /// Corporate sender phone number.
pub company_phone: Option<Secret<String>>,
+ /// Company tax identifier.
pub company_tax_id: Option<Secret<String>>,
+ /// Whether account owners have been supplied.
pub company_owners_provided: Option<bool>,
+ /// Whether card payments capability is requested.
pub capabilities_card_payments: Option<bool>,
+ /// Whether transfer capability is requested.
pub capabilities_transfers: Option<bool>,
+ /// Corporate sender country.
+ pub company_address_country: Option<common_enums::CountryAlpha2>,
+ /// Party contact email.
+ #[schema(value_type = Option<String>)]
+ pub email: Option<Email>,
+ /// International dialing code, separate from the phone number.
+ pub phone_country_code: Option<String>,
+ /// Merchant-supplied stable identifier for the funding party.
+ #[schema(value_type = Option<String>)]
+ pub reference_id: Option<Secret<String>>,
+ /// Merchant-supplied classification of the funding source.
+ pub source_of_funds: Option<crate::sender::SourceOfFunds>,
}
-#[derive(Default, Debug, Serialize, ToSchema, Clone, Deserialize)]
+/// Individual/account information, with the individual sender fields appended at the end.
+#[derive(Default, Debug, Serialize, ToSchema, Clone, Deserialize, PartialEq, Eq)]
pub struct PayoutIndividualDetails {
+ /// Unix timestamp of terms-of-service acceptance.
pub tos_acceptance_date: Option<i64>,
+ /// IP address used to accept terms of service.
pub tos_acceptance_ip: Option<Secret<String>>,
/// Deprecated. Use `date_of_birth`.
#[schema(deprecated, value_type = Option<String>)]
@@ -1202,9 +1261,25 @@ pub struct PayoutIndividualDetails {
/// The individual's date of birth.
#[schema(value_type = Option<time::Date>, example = "1990-01-31")]
pub date_of_birth: Option<Secret<time::Date>>,
+ /// Individual government identification number.
pub individual_id_number: Option<Secret<String>>,
+ /// Last four digits of the individual social security number.
pub individual_ssn_last_4: Option<Secret<String>>,
+ /// Existing individual/company account-holder classification.
pub external_account_account_holder_type: Option<String>,
+ /// Individual sender given name.
+ #[schema(value_type = Option<String>)]
+ pub first_name: Option<Secret<String>>,
+ /// Individual sender family name.
+ #[schema(value_type = Option<String>)]
+ pub last_name: Option<Secret<String>>,
+ /// Individual sender contact and postal address details.
+ pub address: Option<payments::Address>,
+ /// Merchant-supplied stable identifier for the funding party.
+ #[schema(value_type = Option<String>)]
+ pub reference_id: Option<Secret<String>>,
+ /// Merchant-supplied classification of the funding source.
+ pub source_of_funds: Option<crate::sender::SourceOfFunds>,
}
#[derive(Clone, Debug, serde::Deserialize, ToSchema, serde::Serialize)]
@@ -1919,3 +1994,101 @@ impl From<&PayoutMethodData> for api_enums::PaymentMethodType {
}
}
}
+
+/// Normalizes the API sender identity into the payout vendor representation consumed by
+/// domain and connector code. Explicit sender input takes precedence over legacy vendor
+/// metadata without merging identities. Every field is listed explicitly so that adding a
+/// vendor field forces a deliberate mapping decision here.
+impl From<SenderDetails> for PayoutVendorAccountDetails {
+ fn from(value: SenderDetails) -> Self {
+ match value {
+ SenderDetails::Individual(sender) => Self {
+ vendor_details: PayoutVendorDetails {
+ account_type: String::new(),
+ business_type: "individual".to_owned(),
+ business_profile_mcc: None,
+ business_profile_url: None,
+ business_profile_name: None,
+ company_address_line1: None,
+ company_address_line2: None,
+ company_address_postal_code: None,
+ company_address_city: None,
+ company_address_state: None,
+ company_phone: None,
+ company_tax_id: None,
+ company_owners_provided: None,
+ capabilities_card_payments: None,
+ capabilities_transfers: None,
+ company_address_country: None,
+ email: None,
+ phone_country_code: None,
+ reference_id: None,
+ source_of_funds: None,
+ },
+ individual_details: PayoutIndividualDetails {
+ tos_acceptance_date: None,
+ tos_acceptance_ip: None,
+ individual_dob_day: None,
+ individual_dob_month: None,
+ individual_dob_year: None,
+ date_of_birth: sender.date_of_birth,
+ individual_id_number: None,
+ individual_ssn_last_4: None,
+ external_account_account_holder_type: None,
+ first_name: sender.first_name,
+ last_name: sender.last_name,
+ address: Some(payments::Address {
+ address: sender.address,
+ email: sender.email,
+ phone: sender.phone,
+ }),
+ reference_id: sender.reference_id,
+ source_of_funds: sender.source_of_funds,
+ },
+ },
+ SenderDetails::Corporate(sender) => {
+ let address = sender.address.unwrap_or_default();
+ Self {
+ vendor_details: PayoutVendorDetails {
+ account_type: String::new(),
+ business_type: "company".to_owned(),
+ business_profile_mcc: None,
+ business_profile_url: None,
+ business_profile_name: Some(sender.company_name),
+ company_address_line1: address.line1,
+ company_address_line2: address.line2,
+ company_address_postal_code: address.zip,
+ company_address_city: address.city.map(Secret::new),
+ company_address_state: address.state,
+ company_phone: sender.phone.as_ref().and_then(|p| p.number.clone()),
+ company_tax_id: None,
+ company_owners_provided: None,
+ capabilities_card_payments: None,
+ capabilities_transfers: None,
+ company_address_country: address.country,
+ email: sender.email,
+ phone_country_code: sender.phone.and_then(|p| p.country_code),
+ reference_id: sender.reference_id,
+ source_of_funds: sender.source_of_funds,
+ },
+ individual_details: PayoutIndividualDetails {
+ tos_acceptance_date: None,
+ tos_acceptance_ip: None,
+ individual_dob_day: None,
+ individual_dob_month: None,
+ individual_dob_year: None,
+ date_of_birth: None,
+ individual_id_number: None,
+ individual_ssn_last_4: None,
+ external_account_account_holder_type: None,
+ first_name: None,
+ last_name: None,
+ address: None,
+ reference_id: None,
+ source_of_funds: None,
+ },
+ }
+ }
+ }
+ }
+}
diff --git a/crates/api_models/src/sender.rs b/crates/api_models/src/sender.rs
new file mode 100644
index 0000000000..57412f6008
--- /dev/null
+++ b/crates/api_models/src/sender.rs
@@ -0,0 +1,264 @@
+//! Sender identity — the party providing the funds, independent of the destination.
+//!
+//! These types are shared by payments (account funded transactions) and payouts. In payments
+//! the sender is persisted encrypted on the payment intent and echoed in responses only
+//! through the masked [`SenderDetailsResponse`] view; in payouts the sender is persisted
+//! encrypted on the payout and normalized into common payout vendor details at the domain
+//! boundary.
+
+use common_types::payments::PhoneDetails;
+use common_utils::{
+ new_type::{MaskedEmail, MaskedPhoneNumber},
+ pii::Email,
+ transformers::ForeignFrom,
+};
+use hyperswitch_masking::Secret;
+use time::Date;
+use utoipa::ToSchema;
+
+use crate::payments::AddressDetails;
+
+/// Origin of the funds, supplied by the merchant.
+#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Deserialize, serde::Serialize, ToSchema)]
+#[serde(rename_all = "snake_case")]
+pub enum SourceOfFunds {
+ /// Credit funding.
+ Credit,
+ /// Debit funding.
+ Debit,
+ /// Prepaid funding.
+ Prepaid,
+ /// Deposit account funding.
+ DepositAccount,
+ /// Mobile money funding.
+ MobileMoneyAccount,
+ /// Cash funding.
+ Cash,
+}
+
+/// An individual providing the funds.
+#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
+pub struct IndividualSenderDetails {
+ /// The sender's first name. When neither the first nor the last name is provided, the name
+ /// from the billing address of the payment method is used instead.
+ #[schema(value_type = Option<String>, max_length = 255, example = "John")]
+ pub first_name: Option<Secret<String>>,
+
+ /// The sender's last name. When neither the first nor the last name is provided, the name
+ /// from the billing address of the payment method is used instead.
+ #[schema(value_type = Option<String>, max_length = 255, example = "Doe")]
+ pub last_name: Option<Secret<String>>,
+
+ /// The sender's date of birth, in the format yyyy-mm-dd.
+ #[schema(value_type = Option<Date>, example = "1990-01-31")]
+ pub date_of_birth: Option<Secret<Date>>,
+
+ /// The sender's address. When no address field is provided, the billing address of the
+ /// payment method is used instead, unless the sender is named and their name differs from
+ /// the billing name, in which case no address is sent.
+ #[schema(value_type = Option<AddressDetails>)]
+ pub address: Option<AddressDetails>,
+
+ /// The sender's email address.
+ #[schema(value_type = Option<String>, example = "[email protected]")]
+ pub email: Option<Email>,
+
+ /// The sender's phone number.
+ #[schema(value_type = Option<PhoneDetails>)]
+ pub phone: Option<PhoneDetails>,
+
+ /// The merchant's stable identifier for the sender
+ #[schema(value_type = Option<String>)]
+ pub reference_id: Option<Secret<String>>,
+
+ /// Origin of the funds, supplied by the merchant.
+ pub source_of_funds: Option<SourceOfFunds>,
+}
+
+/// A company providing the funds.
+#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
+pub struct CorporateSenderDetails {
+ /// The sender's legal company name.
+ #[schema(value_type = String, max_length = 255, example = "Acme Ltd")]
+ pub company_name: Secret<String>,
+
+ /// The sender's address. When no address field is provided, the billing address of the
+ /// payment method is used instead.
+ #[schema(value_type = Option<AddressDetails>)]
+ pub address: Option<AddressDetails>,
+
+ /// The sender's email address.
+ #[schema(value_type = Option<String>, example = "[email protected]")]
+ pub email: Option<Email>,
+
+ /// The sender's phone number.
+ #[schema(value_type = Option<PhoneDetails>)]
+ pub phone: Option<PhoneDetails>,
+
+ /// The merchant's stable identifier for the sender.
+ #[schema(value_type = Option<String>)]
+ pub reference_id: Option<Secret<String>>,
+
+ /// Origin of the funds, supplied by the merchant.
+ pub source_of_funds: Option<SourceOfFunds>,
+}
+
+/// Details of the party providing the funds.
+#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
+#[serde(tag = "type", rename_all = "snake_case")]
+pub enum SenderDetails {
+ /// The funds are provided by an individual.
+ Individual(IndividualSenderDetails),
+ /// The funds are provided by a company.
+ Corporate(CorporateSenderDetails),
+}
+
+impl SenderDetails {
+ /// The individual sender's first name, if provided.
+ pub fn get_individual_first_name(&self) -> Option<&Secret<String>> {
+ match self {
+ Self::Individual(individual) => individual.first_name.as_ref(),
+ Self::Corporate(_) => None,
+ }
+ }
+
+ /// The individual sender's last name, if provided.
+ pub fn get_individual_last_name(&self) -> Option<&Secret<String>> {
+ match self {
+ Self::Individual(individual) => individual.last_name.as_ref(),
+ Self::Corporate(_) => None,
+ }
+ }
+
+ /// The corporate sender's company name, if applicable.
+ pub fn get_corporate_company_name(&self) -> Option<&Secret<String>> {
+ match self {
+ Self::Individual(_) => None,
+ Self::Corporate(corporate) => Some(&corporate.company_name),
+ }
+ }
+
+ /// The sender's address, if provided.
+ pub fn get_address(&self) -> Option<&AddressDetails> {
+ match self {
+ Self::Individual(individual) => individual.address.as_ref(),
+ Self::Corporate(corporate) => corporate.address.as_ref(),
+ }
+ }
+
+ /// The sender's email address, if provided.
+ pub fn get_email(&self) -> Option<&Email> {
+ match self {
+ Self::Individual(individual) => individual.email.as_ref(),
+ Self::Corporate(corporate) => corporate.email.as_ref(),
+ }
+ }
+
+ /// The merchant-supplied sender reference, independent of the sender kind.
+ pub fn reference_id(&self) -> Option<&Secret<String>> {
+ match self {
+ Self::Individual(sender) => sender.reference_id.as_ref(),
+ Self::Corporate(sender) => sender.reference_id.as_ref(),
+ }
+ }
+}
+
+/// A partially masked view of [`PhoneDetails`], safe to return in API responses.
+#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
+pub struct MaskedSenderPhoneDetails {
+ /// The sender's partially masked phone number.
+ #[schema(value_type = Option<String>, example = "********89")]
+ pub number: Option<MaskedPhoneNumber>,
+
+ /// The country code of the sender's phone number.
+ #[schema(example = "+44")]
+ pub country_code: Option<String>,
+}
+
+/// A partially masked view of `IndividualSenderDetails`, safe to return in API responses.
+#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
+pub struct IndividualSenderDetailsResponse {
+ /// The sender's first name.
+ #[schema(value_type = Option<String>, example = "John")]
+ pub first_name: Option<Secret<String>>,
+
+ /// The sender's last name.
+ #[schema(value_type = Option<String>, example = "Doe")]
+ pub last_name: Option<Secret<String>>,
+
+ /// The sender's address.
+ #[schema(value_type = Option<AddressDetails>)]
+ pub address: Option<AddressDetails>,
+
+ /// The sender's partially masked phone number.
+ #[schema(value_type = Option<MaskedSenderPhoneDetails>)]
+ pub phone: Option<MaskedSenderPhoneDetails>,
+
+ /// The sender's masked email address.
+ #[schema(value_type = Option<String>, example = "jo******@example.com")]
+ pub email: Option<MaskedEmail>,
+}
+
+/// A partially masked view of `CorporateSenderDetails`, safe to return in API responses.
+#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
+pub struct CorporateSenderDetailsResponse {
+ /// The sender's legal company name.
+ #[schema(value_type = String, example = "Acme Ltd")]
+ pub company_name: Secret<String>,
+
+ /// The sender's address.
+ #[schema(value_type = Option<AddressDetails>)]
+ pub address: Option<AddressDetails>,
+
+ /// The sender's partially masked phone number.
+ #[schema(value_type = Option<MaskedSenderPhoneDetails>)]
+ pub phone: Option<MaskedSenderPhoneDetails>,
+
+ /// The sender's masked email address.
+ #[schema(value_type = Option<String>, example = "tr******@acme.com")]
+ pub email: Option<MaskedEmail>,
+}
+
+/// A partially masked view of `SenderDetails`, safe to return in API responses. The sender's
+/// date of birth is never returned.
+#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
+#[serde(tag = "type", rename_all = "snake_case")]
+pub enum SenderDetailsResponse {
+ /// The funds are provided by an individual.
+ Individual(IndividualSenderDetailsResponse),
+ /// The funds are provided by a company.
+ Corporate(CorporateSenderDetailsResponse),
+}
+
+impl From<PhoneDetails> for MaskedSenderPhoneDetails {
+ fn from(phone: PhoneDetails) -> Self {
+ Self {
+ number: phone.number.map(MaskedPhoneNumber::from),
+ country_code: phone.country_code,
+ }
+ }
+}
+
+impl From<SenderDetails> for SenderDetailsResponse {
+ fn from(sender_details: SenderDetails) -> Self {
+ match sender_details {
+ SenderDetails::Individual(individual) => {
+ Self::Individual(IndividualSenderDetailsResponse {
+ first_name: individual.first_name,
+ last_name: individual.last_name,
+ address: individual.address,
+ phone: individual.phone.map(MaskedSenderPhoneDetails::from),
+ email: individual.email.map(MaskedEmail::foreign_from),
+ })
+ }
+ SenderDetails::Corporate(corporate) => {
+ Self::Corporate(CorporateSenderDetailsResponse {
+ company_name: corporate.company_name,
+ address: corporate.address,
+ phone: corporate.phone.map(MaskedSenderPhoneDetails::from),
+ email: corporate.email.map(MaskedEmail::foreign_from),
+ })
+ }
+ }
+ }
+}
diff --git a/crates/common_enums/src/connector_enums.rs b/crates/common_enums/src/connector_enums.rs
index f45b85584d..042a2a27a7 100644
--- a/crates/common_enums/src/connector_enums.rs
+++ b/crates/common_enums/src/connector_enums.rs
@@ -239,6 +239,7 @@ impl Connector {
matches!(
(self, payout_method),
(Self::Paypal, Some(PayoutType::Wallet))
+ | (Self::Checkout, _)
| (Self::Envoy, _)
| (_, Some(PayoutType::Card))
| (Self::Adyenplatform, _)
diff --git a/crates/common_enums/src/enums.rs b/crates/common_enums/src/enums.rs
index 90d35c9a1b..6f5f228313 100644
--- a/crates/common_enums/src/enums.rs
+++ b/crates/common_enums/src/enums.rs
@@ -9427,6 +9427,40 @@ pub enum PayoutSendPriority {
Internal,
}
+/// The category of funds transfer to use when processing a payout.
+#[derive(
+ Clone,
+ Copy,
+ Debug,
+ Eq,
+ PartialEq,
+ serde::Deserialize,
+ serde::Serialize,
+ strum::Display,
+ strum::EnumString,
+ ToSchema,
+ Hash,
+)]
+#[cfg_attr(feature = "diesel", router_derive::diesel_enum(storage_type = "text"))]
+#[serde(rename_all = "snake_case")]
+#[strum(serialize_all = "snake_case")]
+pub enum PayoutFundsTransferType {
+ AccountToAccount,
+ FundsTransfer,
+ CrossBorderMoneyTransfer,
+ PeerToPeer,
+ StagedDigitalWalletTransfer,
+ FundsDisbursement,
+ LoyaltyPayments,
+ PayrollAndPensionDisbursements,
+ OnlineGambling,
+ MastercardPersonToPerson,
+ MastercardTransferToOwnAccount,
+ MastercardBusinessDisbursement,
+ MastercardBusinessToBusiness,
+ MastercardGamingRepay,
+}
+
#[derive(
Clone,
Copy,
diff --git a/crates/common_types/src/payments.rs b/crates/common_types/src/payments.rs
index 785c3374cd..888199d0af 100644
--- a/crates/common_types/src/payments.rs
+++ b/crates/common_types/src/payments.rs
@@ -34,6 +34,30 @@ use crate::{
consts::PERCENTAGE_BASE,
domain::{AdyenSplitData, PostCaptureVoidData, XenditSplitSubMerchantData},
};
+/// Phone contact details shared by payment and payout API models.
+#[derive(
+ Debug,
+ Clone,
+ Default,
+ Eq,
+ PartialEq,
+ ToSchema,
+ serde::Deserialize,
+ serde::Serialize,
+ SmithyModel,
+)]
+#[smithy(namespace = "com.hyperswitch.smithy.types")]
+pub struct PhoneDetails {
+ /// The contact number
+ #[schema(value_type = Option<String>, example = "9123456789")]
+ #[smithy(value_type = "Option<String>")]
+ pub number: Option<Secret<String>>,
+ /// The country code attached to the number
+ #[schema(example = "+1")]
+ #[smithy(value_type = "Option<String>")]
+ pub country_code: Option<String>,
+}
+
/// Merchant settlement leg for a single capture or refund. No conversion is recomputed.
#[derive(
Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize, ToSchema, SmithyModel,
diff --git a/crates/connector_configs/src/connector.rs b/crates/connector_configs/src/connector.rs
index 70d263dbd5..01879dd70a 100644
--- a/crates/connector_configs/src/connector.rs
+++ b/crates/connector_configs/src/connector.rs
@@ -172,6 +172,8 @@ pub struct ConfigMetadata {
pub boleto: Option<Vec<InputData>>,
pub client_id: Option<InputData>,
pub client_secret: Option<InputData>,
+ pub connector_client_id: Option<InputData>,
+ pub connector_currency_account_id: Option<InputData>,
pub workspace_id: Option<InputData>,
pub merchant_id: Option<MerchantIdConfig>,
pub endpoint_prefix: Option<InputData>,
@@ -330,6 +332,8 @@ pub struct ConnectorConfig {
pub custombilling: Option<ConnectorTomlConfig>,
pub checkbook: Option<ConnectorTomlConfig>,
pub checkout: Option<ConnectorTomlConfig>,
+ #[cfg(feature = "payouts")]
+ pub checkout_payout: Option<ConnectorTomlConfig>,
pub coinbase: Option<ConnectorTomlConfig>,
pub coingate: Option<ConnectorTomlConfig>,
pub cryptopay: Option<ConnectorTomlConfig>,
@@ -527,6 +531,7 @@ impl ConnectorConfig {
match connector {
PayoutConnectors::Adyen => Ok(connector_data.adyen_payout),
PayoutConnectors::Adyenplatform => Ok(connector_data.adyenplatform_payout),
+ PayoutConnectors::Checkout => Ok(connector_data.checkout_payout),
PayoutConnectors::Cybersource => Ok(connector_data.cybersource_payout),
PayoutConnectors::Deutschebank => Ok(connector_data.deutschebank_payout),
PayoutConnectors::Ebanx => Ok(connector_data.ebanx_payout),
diff --git a/crates/connector_configs/toml/development.toml b/crates/connector_configs/toml/development.toml
index a0cd482fe3..b59a65c991 100644
--- a/crates/connector_configs/toml/development.toml
+++ b/crates/connector_configs/toml/development.toml
@@ -2037,6 +2037,27 @@ placeholder="Enter Acquirer Country Code"
required=false
type="Text"
+[checkout_payout]
+[[checkout_payout.wallet]]
+payment_method_type = "apple_pay"
+[checkout_payout.connector_auth.SignatureKey]
+api_key = "Checkout Public Key"
+key1 = "Processing Channel ID"
+api_secret = "Checkout API Secret Key"
+[checkout_payout.metadata.connector_currency_account_id]
+name = "connector_currency_account_id"
+label = "Checkout Currency Account ID"
+placeholder = "Enter Checkout Currency Account ID (ca_...)"
+required = true
+type = "Text"
+[checkout_payout.metadata.connector_client_id]
+name = "connector_client_id"
+label = "Checkout Client ID"
+placeholder = "Enter Checkout Client ID (cli_...)"
+required = false
+type = "Text"
+
+
[coinbase]
[[coinbase.crypto]]
payment_method_type = "crypto_currency"
diff --git a/crates/connector_configs/toml/production.toml b/crates/connector_configs/toml/production.toml
index 4554ac3db8..faf54fe0ad 100644
--- a/crates/connector_configs/toml/production.toml
+++ b/crates/connector_configs/toml/production.toml
@@ -1782,6 +1782,27 @@ type = "MultiSelect"
options = ["PAN_ONLY", "CRYPTOGRAM_3DS"]
+[checkout_payout]
+[[checkout_payout.wallet]]
+payment_method_type = "apple_pay"
+[checkout_payout.connector_auth.SignatureKey]
+api_key = "Checkout Public Key"
+key1 = "Processing Channel ID"
+api_secret = "Checkout API Secret Key"
+[checkout_payout.metadata.connector_currency_account_id]
+name = "connector_currency_account_id"
+label = "Checkout Currency Account ID"
+placeholder = "Enter Checkout Currency Account ID (ca_...)"
+required = true
+type = "Text"
+[checkout_payout.metadata.connector_client_id]
+name = "connector_client_id"
+label = "Checkout Client ID"
+placeholder = "Enter Checkout Client ID (cli_...)"
+required = false
+type = "Text"
+
+
[coinbase]
[[coinbase.crypto]]
payment_method_type = "crypto_currency"
diff --git a/crates/connector_configs/toml/sandbox.toml b/crates/connector_configs/toml/sandbox.toml
index 8912de8b57..76df37f5b1 100644
--- a/crates/connector_configs/toml/sandbox.toml
+++ b/crates/connector_configs/toml/sandbox.toml
@@ -2034,6 +2034,27 @@ placeholder = "Enter Acquirer Country Code"
required = false
type = "Text"
+[checkout_payout]
+[[checkout_payout.wallet]]
+payment_method_type = "apple_pay"
+[checkout_payout.connector_auth.SignatureKey]
+api_key = "Checkout Public Key"
+key1 = "Processing Channel ID"
+api_secret = "Checkout API Secret Key"
+[checkout_payout.metadata.connector_currency_account_id]
+name = "connector_currency_account_id"
+label = "Checkout Currency Account ID"
+placeholder = "Enter Checkout Currency Account ID (ca_...)"
+required = true
+type = "Text"
+[checkout_payout.metadata.connector_client_id]
+name = "connector_client_id"
+label = "Checkout Client ID"
+placeholder = "Enter Checkout Client ID (cli_...)"
+required = false
+type = "Text"
+
+
[coinbase]
[[coinbase.crypto]]
payment_method_type = "crypto_currency"
diff --git a/crates/diesel_models/src/payouts.rs b/crates/diesel_models/src/payouts.rs
index 975b4398c4..4f9417df61 100644
--- a/crates/diesel_models/src/payouts.rs
+++ b/crates/diesel_models/src/payouts.rs
@@ -1,4 +1,4 @@
-use common_utils::{pii, types::MinorUnit};
+use common_utils::{encryption::Encryption, pii, types::MinorUnit};
use diesel::{AsChangeset, Identifiable, Insertable, Queryable, Selectable};
use serde::{self, Deserialize, Serialize};
use time::PrimitiveDateTime;
@@ -41,6 +41,8 @@ pub struct Payouts {
pub processor_merchant_id: Option<common_utils::id_type::MerchantId>,
pub created_by: Option<String>,
pub billing_descriptor: Option<common_types::payouts::PayoutsBillingDescriptor>,
+ pub funds_transfer_type: Option<storage_enums::PayoutFundsTransferType>,
+ pub sender_details: Option<Encryption>,
}
#[derive(
@@ -86,6 +88,8 @@ pub struct PayoutsNew {
pub processor_merchant_id: Option<common_utils::id_type::MerchantId>,
pub created_by: Option<String>,
pub billing_descriptor: Option<common_types::payouts::PayoutsBillingDescriptor>,
+ pub funds_transfer_type: Option<storage_enums::PayoutFundsTransferType>,
+ pub sender_details: Option<Encryption>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -100,6 +104,8 @@ pub enum PayoutsUpdate {
return_url: Option<String>,
entity_type: storage_enums::PayoutEntityType,
metadata: Option<pii::SecretSerdeValue>,
+ funds_transfer_type: Option<storage_enums::PayoutFundsTransferType>,
+ sender_details: Option<Encryption>,
profile_id: Option<common_utils::id_type::ProfileId>,
status: Option<storage_enums::PayoutStatus>,
confirm: Option<bool>,
@@ -142,6 +148,10 @@ pub struct PayoutsUpdateInternal {
pub return_url: Option<String>,
pub entity_type: Option<storage_enums::PayoutEntityType>,
pub metadata: Option<pii::SecretSerdeValue>,
+ pub funds_transfer_type: Option<storage_enums::PayoutFundsTransferType>,
+ /// Sender identity supplied with the payout request; normalized at the domain boundary.
+ /// Encrypted at rest with the merchant key.
+ pub sender_details: Option<Encryption>,
pub payout_method_id: Option<String>,
pub profile_id: Option<common_utils::id_type::ProfileId>,
pub status: Option<storage_enums::PayoutStatus>,
@@ -166,6 +176,8 @@ impl Default for PayoutsUpdateInternal {
return_url: None,
entity_type: None,
metadata: None,
+ funds_transfer_type: None,
+ sender_details: None,
payout_method_id: None,
profile_id: None,
status: None,
@@ -193,6 +205,8 @@ impl From<PayoutsUpdate> for PayoutsUpdateInternal {
return_url,
entity_type,
metadata,
+ funds_transfer_type,
+ sender_details,
profile_id,
status,
confirm,
@@ -210,6 +224,8 @@ impl From<PayoutsUpdate> for PayoutsUpdateInternal {
return_url,
entity_type: Some(entity_type),
metadata,
+ funds_transfer_type,
+ sender_details,
profile_id,
status,
confirm,
diff --git a/crates/diesel_models/src/schema.rs b/crates/diesel_models/src/schema.rs
index 666b6ea9c6..9f43fcf3c2 100644
--- a/crates/diesel_models/src/schema.rs
+++ b/crates/diesel_models/src/schema.rs
@@ -1610,6 +1610,9 @@ diesel::table! {
#[max_length = 255]
created_by -> Nullable<Varchar>,
billing_descriptor -> Nullable<Jsonb>,
+ #[max_length = 64]
+ funds_transfer_type -> Nullable<Varchar>,
+ sender_details -> Nullable<Bytea>,
}
}
diff --git a/crates/diesel_models/src/schema_v2.rs b/crates/diesel_models/src/schema_v2.rs
index 13b60133a5..66c7648d38 100644
--- a/crates/diesel_models/src/schema_v2.rs
+++ b/crates/diesel_models/src/schema_v2.rs
@@ -1529,6 +1529,9 @@ diesel::table! {
#[max_length = 255]
created_by -> Nullable<Varchar>,
billing_descriptor -> Nullable<Jsonb>,
+ #[max_length = 64]
+ funds_transfer_type -> Nullable<Varchar>,
+ sender_details -> Nullable<Bytea>,
}
}
diff --git a/crates/euclid_wasm/Cargo.toml b/crates/euclid_wasm/Cargo.toml
index b1aa515a48..51fd03d491 100644
--- a/crates/euclid_wasm/Cargo.toml
+++ b/crates/euclid_wasm/Cargo.toml
@@ -15,7 +15,7 @@ release = ["payouts"]
dummy_connector = ["kgraph_utils/dummy_connector", "connector_configs/dummy_connector"]
production = ["connector_configs/production"]
sandbox = ["connector_configs/sandbox"]
-payouts = ["api_models/payouts", "common_enums/payouts", "euclid/payouts"]
+payouts = ["api_models/payouts", "common_enums/payouts", "connector_configs/payouts", "euclid/payouts"]
v1 = ["api_models/v1", "kgraph_utils/v1", "payouts"]
v2 = []
diff --git a/crates/external_services/Cargo.toml b/crates/external_services/Cargo.toml
index 51d316c881..1c194a4e0e 100644
--- a/crates/external_services/Cargo.toml
+++ b/crates/external_services/Cargo.toml
@@ -88,7 +88,7 @@ http = "1.3.1"
url = { version = "2.5.4", features = ["serde"] }
quick-xml = { version = "0.31.0", features = ["serialize"] }
-unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.11.04.1", package = "rust-grpc-client" }
+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.11.06.2", package = "rust-grpc-client" }
open-feature = { version = "0.2.5", optional = true }
bytes = { version = "1.10.1", optional = true }
futures = { version = "0.3.31", optional = true }
diff --git a/crates/external_services/src/grpc_client/unified_connector_service.rs b/crates/external_services/src/grpc_client/unified_connector_service.rs
index a79c061f3f..e321d2a592 100644
--- a/crates/external_services/src/grpc_client/unified_connector_service.rs
+++ b/crates/external_services/src/grpc_client/unified_connector_service.rs
@@ -877,9 +877,7 @@ impl UnifiedConnectorServiceClient {
build_unified_connector_service_grpc_headers(connector_auth_metadata, grpc_headers)?;
*request.metadata_mut() = metadata;
- self.payment_service_client
- .clone()
- .capture(request)
+ Box::pin(self.payment_service_client.clone().capture(request))
.await
.map_err(|error| {
error_stack::Report::new(UnifiedConnectorServiceError::from_grpc_error(
@@ -1310,9 +1308,9 @@ impl UnifiedConnectorServiceClient {
*request.metadata_mut() = metadata;
- self.payout_service_client
- .clone()
- .transfer(request)
+ // Box the transfer future: the merged UCS proto request types are large enough
+ // to trip clippy::large_futures when this is awaited inline.
+ Box::pin(self.payout_service_client.clone().transfer(request))
.await
.map_err(|error| {
error_stack::Report::new(UnifiedConnectorServiceError::from_grpc_error(
diff --git a/crates/hyperswitch_connectors/src/connectors/checkout.rs b/crates/hyperswitch_connectors/src/connectors/checkout.rs
index fda730a5ec..3d0fcfaa9f 100644
--- a/crates/hyperswitch_connectors/src/connectors/checkout.rs
+++ b/crates/hyperswitch_connectors/src/connectors/checkout.rs
@@ -38,6 +38,12 @@ use hyperswitch_domain_models::{
PaymentsSyncRouterData, RefundsRouterData, SetupMandateRouterData, TokenizationRouterData,
},
};
+#[cfg(feature = "payouts")]
+use hyperswitch_domain_models::{
+ router_flow_types::payouts::{PoFulfill, PoSync},
+ router_request_types::PayoutsData,
+ router_response_types::PayoutsResponseData,
+};
use hyperswitch_interfaces::{
api::{
self,
@@ -249,6 +255,7 @@ impl ConnectorValidation for Checkout {
}
impl api::Payment for Checkout {}
+impl api::Payouts for Checkout {}
impl api::PaymentAuthorize for Checkout {}
impl api::PaymentSync for Checkout {}
@@ -262,6 +269,40 @@ impl Dispute for Checkout {}
impl RetrieveFile for Checkout {}
impl DefendDispute for Checkout {}
+#[cfg(feature = "payouts")]
+impl api::PayoutFulfill for Checkout {}
+
+#[cfg(feature = "payouts")]
+impl ConnectorIntegration<PoFulfill, PayoutsData, PayoutsResponseData> for Checkout {
+ fn build_request(
+ &self,
+ _req: &RouterData<PoFulfill, PayoutsData, PayoutsResponseData>,
+ _connectors: &Connectors,
+ ) -> CustomResult<Option<Request>, errors::ConnectorError> {
+ Err(errors::ConnectorError::NotImplemented(
+ "Checkout payouts are supported only through UCS".to_string(),
+ )
+ .into())
+ }
+}
+
+#[cfg(feature = "payouts")]
+impl api::PayoutSync for Checkout {}
+
+#[cfg(feature = "payouts")]
+impl ConnectorIntegration<PoSync, PayoutsData, PayoutsResponseData> for Checkout {
+ fn build_request(
+ &self,
+ _req: &RouterData<PoSync, PayoutsData, PayoutsResponseData>,
+ _connectors: &Connectors,
+ ) -> CustomResult<Option<Request>, errors::ConnectorError> {
+ Err(errors::ConnectorError::NotImplemented(
+ "Checkout payouts are supported only through UCS".to_string(),
+ )
+ .into())
+ }
+}
+
impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData>
for Checkout
{
diff --git a/crates/hyperswitch_connectors/src/default_implementations.rs b/crates/hyperswitch_connectors/src/default_implementations.rs
index 1d422b5be1..3e43300025 100644
--- a/crates/hyperswitch_connectors/src/default_implementations.rs
+++ b/crates/hyperswitch_connectors/src/default_implementations.rs
@@ -5296,7 +5296,6 @@ default_imp_for_payouts!(
connectors::Celero,
connectors::Chargebee,
connectors::Checkbook,
- connectors::Checkout,
connectors::Cryptopay,
connectors::Cybersourcedecisionmanager,
connectors::D24,
@@ -5643,7 +5642,6 @@ default_imp_for_payouts_retrieve!(
connectors::Celero,
connectors::Chargebee,
connectors::Checkbook,
- connectors::Checkout,
connectors::Coinbase,
connectors::Coingate,
connectors::Cryptopay,
@@ -6005,7 +6003,6 @@ default_imp_for_payouts_fulfill!(
connectors::Celero,
connectors::Chargebee,
connectors::Checkbook,
- connectors::Checkout,
connectors::Coinbase,
connectors::Coingate,
connectors::Cryptopay,
diff --git a/crates/hyperswitch_domain_models/src/payouts/payouts.rs b/crates/hyperswitch_domain_models/src/payouts/payouts.rs
index 919b95ed06..e3ae828fd2 100644
--- a/crates/hyperswitch_domain_models/src/payouts/payouts.rs
+++ b/crates/hyperswitch_domain_models/src/payouts/payouts.rs
@@ -1,5 +1,6 @@
use common_enums as storage_enums;
-use common_utils::{id_type, pii, types::MinorUnit};
+use common_utils::{encryption::Encryption, id_type, pii, types::MinorUnit};
+use hyperswitch_masking::PeekInterface;
use serde::{Deserialize, Serialize};
use storage_enums::MerchantStorageScheme;
use time::PrimitiveDateTime;
@@ -7,6 +8,7 @@ use time::PrimitiveDateTime;
use super::payout_attempt::PayoutAttempt;
#[cfg(feature = "olap")]
use super::PayoutFetchConstraints;
+use crate::{merchant_key_store::MerchantKeyStore, type_encryption::OptionalEncryptableJsonType};
#[async_trait::async_trait]
pub trait PayoutsInterface {
@@ -14,6 +16,7 @@ pub trait PayoutsInterface {
async fn insert_payout(
&self,
_payout: PayoutsNew,
+ _merchant_key_store: &MerchantKeyStore,
_storage_scheme: MerchantStorageScheme,
) -> error_stack::Result<Payouts, Self::Error>;
@@ -21,6 +24,7 @@ pub trait PayoutsInterface {
&self,
_merchant_id: &id_type::MerchantId,
_payout_id: &id_type::PayoutId,
+ _merchant_key_store: &MerchantKeyStore,
_storage_scheme: MerchantStorageScheme,
) -> error_stack::Result<Payouts, Self::Error>;
@@ -29,6 +33,7 @@ pub trait PayoutsInterface {
_this: &Payouts,
_payout: PayoutsUpdate,
_payout_attempt: &PayoutAttempt,
+ _merchant_key_store: &MerchantKeyStore,
_storage_scheme: MerchantStorageScheme,
) -> error_stack::Result<Payouts, Self::Error>;
@@ -36,6 +41,7 @@ pub trait PayoutsInterface {
&self,
_merchant_id: &id_type::MerchantId,
_payout_id: &id_type::PayoutId,
+ _merchant_key_store: &MerchantKeyStore,
_storage_scheme: MerchantStorageScheme,
) -> error_stack::Result<Option<Payouts>, Self::Error>;
@@ -44,6 +50,7 @@ pub trait PayoutsInterface {
&self,
_merchant_id: &id_type::MerchantId,
_filters: &PayoutFetchConstraints,
+ _merchant_key_store: &MerchantKeyStore,
_storage_scheme: MerchantStorageScheme,
) -> error_stack::Result<Vec<Payouts>, Self::Error>;
@@ -52,6 +59,7 @@ pub trait PayoutsInterface {
&self,
_merchant_id: &id_type::MerchantId,
_filters: &PayoutFetchConstraints,
+ _merchant_key_store: &MerchantKeyStore,
_storage_scheme: MerchantStorageScheme,
) -> error_stack::Result<
Vec<(
@@ -68,6 +76,7 @@ pub trait PayoutsInterface {
&self,
_merchant_id: &id_type::MerchantId,
_time_range: &common_utils::types::TimeRange,
+ _merchant_key_store: &MerchantKeyStore,
_storage_scheme: MerchantStorageScheme,
) -> error_stack::Result<Vec<Payouts>, Self::Error>;
@@ -100,7 +109,7 @@ pub trait PayoutsInterface {
) -> error_stack::Result<Vec<(common_enums::PayoutStatus, i64)>, Self::Error>;
}
-#[derive(Clone, Debug, Eq, PartialEq)]
+#[derive(Clone, Debug)]
pub struct Payouts {
pub payout_id: id_type::PayoutId,
pub merchant_id: id_type::MerchantId,
@@ -117,6 +126,11 @@ pub struct Payouts {
pub return_url: Option<String>,
pub entity_type: storage_enums::PayoutEntityType,
pub metadata: Option<pii::SecretSerdeValue>,
+ /// The category of funds transfer to use when processing the payout.
+ pub funds_transfer_type: Option<storage_enums::PayoutFundsTransferType>,
+ /// Sender identity supplied with the payout request; normalized at the domain boundary.
+ /// Encrypted at rest with the merchant key.
+ pub sender_details: OptionalEncryptableJsonType<api_models::sender::SenderDetails>,
pub created_at: PrimitiveDateTime,
pub last_modified_at: PrimitiveDateTime,
pub attempt_count: i16,
@@ -132,7 +146,7 @@ pub struct Payouts {
pub billing_descriptor: Option<common_types::payouts::PayoutsBillingDescriptor>,
}
-#[derive(Clone, Debug, Eq, PartialEq)]
+#[derive(Clone, Debug)]
pub struct PayoutsNew {
pub payout_id: id_type::PayoutId,
pub merchant_id: id_type::MerchantId,
@@ -149,6 +163,11 @@ pub struct PayoutsNew {
pub return_url: Option<String>,
pub entity_type: storage_enums::PayoutEntityType,
pub metadata: Option<pii::SecretSerdeValue>,
+ /// The category of funds transfer to use when processing the payout.
+ pub funds_transfer_type: Option<storage_enums::PayoutFundsTransferType>,
+ /// Sender identity supplied with the payout request; normalized at the domain boundary.
+ /// Encrypted at rest with the merchant key.
+ pub sender_details: OptionalEncryptableJsonType<api_models::sender::SenderDetails>,
pub created_at: PrimitiveDateTime,
pub last_modified_at: PrimitiveDateTime,
pub attempt_count: i16,
@@ -164,6 +183,15 @@ pub struct PayoutsNew {
pub billing_descriptor: Option<common_types::payouts::PayoutsBillingDescriptor>,
}
+impl Payouts {
+ /// Access the decrypted sender identity carried in this domain value.
+ pub fn get_optional_sender_details(&self) -> Option<&api_models::sender::SenderDetails> {
+ self.sender_details
+ .as_ref()
+ .map(|sender_details| sender_details.get_inner().peek().inner())
+ }
+}
+
#[derive(Debug, Serialize, Deserialize)]
pub enum PayoutsUpdate {
Update {
@@ -176,6 +204,8 @@ pub enum PayoutsUpdate {
return_url: Option<String>,
entity_type: storage_enums::PayoutEntityType,
metadata: Option<pii::SecretSerdeValue>,
+ funds_transfer_type: Option<storage_enums::PayoutFundsTransferType>,
+ sender_details: Option<Encryption>,
profile_id: Option<id_type::ProfileId>,
status: Option<storage_enums::PayoutStatus>,
confirm: Option<bool>,
@@ -216,6 +246,10 @@ pub struct PayoutsUpdateInternal {
pub return_url: Option<String>,
pub entity_type: Option<storage_enums::PayoutEntityType>,
pub metadata: Option<pii::SecretSerdeValue>,
+ pub funds_transfer_type: Option<storage_enums::PayoutFundsTransferType>,
+ /// Sender identity supplied with the payout request; normalized at the domain boundary.
+ /// Encrypted at rest with the merchant key.
+ pub sender_details: Option<Encryption>,
pub payout_method_id: Option<String>,
pub profile_id: Option<id_type::ProfileId>,
pub status: Option<storage_enums::PayoutStatus>,
@@ -240,6 +274,8 @@ impl From<PayoutsUpdate> for PayoutsUpdateInternal {
return_url,
entity_type,
metadata,
+ funds_transfer_type,
+ sender_details,
profile_id,
status,
confirm,
@@ -257,6 +293,8 @@ impl From<PayoutsUpdate> for PayoutsUpdateInternal {
return_url,
entity_type: Some(entity_type),
metadata,
+ funds_transfer_type,
+ sender_details,
profile_id,
status,
confirm,
diff --git a/crates/hyperswitch_domain_models/src/router_request_types.rs b/crates/hyperswitch_domain_models/src/router_request_types.rs
index 66d1439348..aaf0c74435 100644
--- a/crates/hyperswitch_domain_models/src/router_request_types.rs
+++ b/crates/hyperswitch_domain_models/src/router_request_types.rs
@@ -1748,6 +1748,8 @@ pub struct PayoutsData {
pub payout_type: Option<storage_enums::PayoutType>,
pub entity_type: storage_enums::PayoutEntityType,
pub customer_details: Option<CustomerDetails>,
+ /// Payout party details converted from explicit sender input or parsed from legacy
+ /// vendor metadata. Never persisted; only `sender_details` is stored on the payout row.
pub vendor_details: Option<api_models::payouts::PayoutVendorAccountDetails>,
// New minor amount for amount framework
@@ -1756,6 +1758,9 @@ pub struct PayoutsData {
pub connector_transfer_method_id: Option<String>,
pub webhook_url: Option<String>,
pub browser_info: Option<BrowserInformation>,
+ /// The category of funds transfer to use when processing the payout.
+ pub funds_transfer_type: Option<storage_enums::PayoutFundsTransferType>,
+ /// Connector-generated state persisted on the payout attempt for later payout steps.
pub payout_connector_metadata: Option<pii::SecretSerdeValue>,
pub additional_payout_method_data: Option<payout_method_utils::AdditionalPayoutMethodData>,
pub source_bank_data: Option<api_models::payouts::BankTransfer>,
diff --git a/crates/hyperswitch_interfaces/Cargo.toml b/crates/hyperswitch_interfaces/Cargo.toml
index 0cf716e3f2..f5af790a1b 100644
--- a/crates/hyperswitch_interfaces/Cargo.toml
+++ b/crates/hyperswitch_interfaces/Cargo.toml
@@ -37,7 +37,7 @@ time = "0.3.41"
tonic = "0.14"
url = { version = "2.5.4", features = ["serde"] }
-unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.11.04.1", package = "rust-grpc-client" }
+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.11.06.2", package = "rust-grpc-client" }
tokio = { version = "1.45.1", features = ["macros", "rt-multi-thread"] }
# First party crates
diff --git a/crates/openapi/src/openapi.rs b/crates/openapi/src/openapi.rs
index 1fabe3c352..f089bddc40 100644
--- a/crates/openapi/src/openapi.rs
+++ b/crates/openapi/src/openapi.rs
@@ -930,6 +930,11 @@ Never share your secret api keys. Keep them guarded and secure.
api_models::payments::Address,
api_models::payments::BankCodeResponse,
common_types::payouts::PayoutsBillingDescriptor,
+ api_models::enums::PayoutFundsTransferType,
+ api_models::sender::SenderDetails,
+ api_models::sender::IndividualSenderDetails,
+ api_models::sender::CorporateSenderDetails,
+ api_models::sender::SourceOfFunds,
api_models::payouts::CardPayout,
api_models::payouts::Wallet,
api_models::payouts::Paypal,
diff --git a/crates/openapi/src/openapi_v2.rs b/crates/openapi/src/openapi_v2.rs
index 471d828449..a12147cbc8 100644
--- a/crates/openapi/src/openapi_v2.rs
+++ b/crates/openapi/src/openapi_v2.rs
@@ -817,6 +817,11 @@ Never share your secret api keys. Keep them guarded and secure.
api_models::payments::ProtestRules,
api_models::payments::PeachpaymentsCardOnFileTransactionType,
common_types::payouts::PayoutsBillingDescriptor,
+ api_models::enums::PayoutFundsTransferType,
+ api_models::sender::SenderDetails,
+ api_models::sender::IndividualSenderDetails,
+ api_models::sender::CorporateSenderDetails,
+ api_models::sender::SourceOfFunds,
api_models::payouts::CardPayout,
api_models::payouts::Wallet,
api_models::payouts::Paypal,
diff --git a/crates/router/Cargo.toml b/crates/router/Cargo.toml
index b6f04e0123..fc88724e4d 100644
--- a/crates/router/Cargo.toml
+++ b/crates/router/Cargo.toml
@@ -257,8 +257,8 @@ rust_decimal = { version = "1.37.1", features = [
] }
rust-i18n = "3.1.5"
-unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.11.04.1", package = "rust-grpc-client" }
-unified-connector-service-cards = { git = "https://github.com/juspay/connector-service", tag = "2026.11.04.1", package = "ucs_cards" }
+unified-connector-service-client = { git = "https://github.com/juspay/connector-service", tag = "2026.11.06.2", package = "rust-grpc-client" }
+unified-connector-service-cards = { git = "https://github.com/juspay/connector-service", tag = "2026.11.06.2", package = "ucs_cards" }
rustc-hash = "1.1.0"
rustls = { version = "0.23", default-features = false, features = [
"aws-lc-rs",
diff --git a/crates/router/src/connector/utils.rs b/crates/router/src/connector/utils.rs
index f34ffd90dc..909398179e 100644
--- a/crates/router/src/connector/utils.rs
+++ b/crates/router/src/connector/utils.rs
@@ -1,7 +1,9 @@
use std::{collections::HashMap, str::FromStr, sync::LazyLock};
#[cfg(feature = "payouts")]
-use api_models::payouts::{self, PayoutVendorAccountDetails};
+use api_models::payouts;
+#[cfg(feature = "payouts")]
+use api_models::payouts::PayoutVendorAccountDetails;
use api_models::{
enums::{CanadaStatesAbbreviation, UsStatesAbbreviation},
payments,
diff --git a/crates/router/src/core/payout_link.rs b/crates/router/src/core/payout_link.rs
index 58932ede72..d852426aca 100644
--- a/crates/router/src/core/payout_link.rs
+++ b/crates/router/src/core/payout_link.rs
@@ -50,6 +50,7 @@ pub async fn initiate_payout_link(
.find_payout_by_merchant_id_payout_id(
merchant_id,
&req.payout_id,
+ platform.get_processor().get_key_store(),
platform.get_processor().get_account().storage_scheme,
)
.await
diff --git a/crates/router/src/core/payouts.rs b/crates/router/src/core/payouts.rs
index 533d6af19a..8d7426ad02 100644
--- a/crates/router/src/core/payouts.rs
+++ b/crates/router/src/core/payouts.rs
@@ -571,6 +571,7 @@ async fn update_frm_blocked_payout_tracker(
status: common_enums::PayoutStatus::Failed,
},
&payout_data.payout_attempt,
+ platform.get_processor().get_key_store(),
storage_scheme,
)
.await
@@ -1040,6 +1041,7 @@ pub async fn payouts_cancel_core(
&payout_data.payouts,
storage::PayoutsUpdate::StatusUpdate { status },
&payout_data.payout_attempt,
+ platform.get_processor().get_key_store(),
platform.get_processor().get_account().storage_scheme,
)
.await
@@ -1201,6 +1203,7 @@ pub async fn payouts_list_core(
db,
&constraints,
merchant_id,
+ platform.get_processor().get_key_store(),
platform.get_processor().get_account().storage_scheme,
)
.await
@@ -1351,6 +1354,7 @@ pub async fn payouts_filtered_list_core(
.filter_payouts_and_attempts(
platform.get_processor().get_account().get_id(),
&constraints,
+ platform.get_processor().get_key_store(),
platform.get_processor().get_account().storage_scheme,
)
.await
@@ -1460,6 +1464,7 @@ pub async fn payouts_list_available_filters_core(
.filter_payouts_by_time_range_constraints(
platform.get_processor().get_account().get_id(),
&time_range,
+ platform.get_processor().get_key_store(),
platform.get_processor().get_account().storage_scheme,
)
.await
@@ -1944,6 +1949,7 @@ pub async fn create_recipient(
&payout_data.payouts,
storage::PayoutsUpdate::StatusUpdate { status },
&payout_data.payout_attempt,
+ platform.get_processor().get_key_store(),
platform.get_processor().get_account().storage_scheme,
)
.await
@@ -1986,6 +1992,7 @@ pub async fn create_recipient(
&payout_data.payouts,
storage::PayoutsUpdate::StatusUpdate { status },
&payout_data.payout_attempt,
+ platform.get_processor().get_key_store(),
platform.get_processor().get_account().storage_scheme,
)
.await
@@ -2053,6 +2060,7 @@ pub async fn create_recipient(
&payout_data.payouts,
storage::PayoutsUpdate::StatusUpdate { status },
&payout_data.payout_attempt,
+ platform.get_processor().get_key_store(),
platform.get_processor().get_account().storage_scheme,
)
.await
@@ -2201,6 +2209,7 @@ pub async fn check_payout_eligibility(
&payout_data.payouts,
storage::PayoutsUpdate::StatusAndMetadataUpdate { status, metadata },
&payout_data.payout_attempt,
+ platform.get_processor().get_key_store(),
platform.get_processor().get_account().storage_scheme,
)
.await
@@ -2266,6 +2275,7 @@ pub async fn check_payout_eligibility(
&payout_data.payouts,
storage::PayoutsUpdate::StatusUpdate { status },
&payout_data.payout_attempt,
+ platform.get_processor().get_key_store(),
platform.get_processor().get_account().storage_scheme,
)
.await
@@ -2331,6 +2341,7 @@ pub async fn complete_create_payout(
status: storage::enums::PayoutStatus::RequiresFulfillment,
},
&payout_data.payout_attempt,
+ platform.get_processor().get_key_store(),
platform.get_processor().get_account().storage_scheme,
)
.await
@@ -2452,6 +2463,7 @@ pub async fn create_payout(
&payout_data.payouts,
storage::PayoutsUpdate::StatusUpdate { status },
&payout_data.payout_attempt,
+ platform.get_processor().get_key_store(),
platform.get_processor().get_account().storage_scheme,
)
.await
@@ -2514,6 +2526,7 @@ pub async fn create_payout(
&payout_data.payouts,
storage::PayoutsUpdate::StatusUpdate { status },
&payout_data.payout_attempt,
+ platform.get_processor().get_key_store(),
platform.get_processor().get_account().storage_scheme,
)
.await
@@ -2759,6 +2772,7 @@ pub async fn update_retrieve_payout_tracker<F, T>(
&payout_data.payouts,
storage::PayoutsUpdate::StatusUpdate { status },
&payout_data.payout_attempt,
+ platform.get_processor().get_key_store(),
platform.get_processor().get_account().storage_scheme,
)
.await
@@ -3102,6 +3116,7 @@ pub async fn cancel_payout(
&payout_data.payouts,
storage::PayoutsUpdate::StatusUpdate { status },
&payout_data.payout_attempt,
+ platform.get_processor().get_key_store(),
platform.get_processor().get_account().storage_scheme,
)
.await
@@ -3167,6 +3182,7 @@ pub async fn cancel_payout(
&payout_data.payouts,
storage::PayoutsUpdate::StatusUpdate { status },
&payout_data.payout_attempt,
+ platform.get_processor().get_key_store(),
platform.get_processor().get_account().storage_scheme,
)
.await
@@ -3285,6 +3301,7 @@ pub async fn fulfill_payout(
&payout_data.payouts,
storage::PayoutsUpdate::StatusUpdate { status },
&payout_data.payout_attempt,
+ platform.get_processor().get_key_store(),
platform.get_processor().get_account().storage_scheme,
)
.await
@@ -3376,6 +3393,7 @@ pub async fn fulfill_payout(
&payout_data.payouts,
storage::PayoutsUpdate::StatusUpdate { status },
&payout_data.payout_attempt,
+ platform.get_processor().get_key_store(),
platform.get_processor().get_account().storage_scheme,
)
.await
@@ -3478,6 +3496,8 @@ pub async fn response_handler(
entity_type: payouts.entity_type.to_owned(),
recurring: payouts.recurring,
metadata: payouts.metadata.clone(),
+ funds_transfer_type: payouts.funds_transfer_type,
+ sender_details: payouts.get_optional_sender_details().cloned(),
merchant_connector_id: payout_attempt.merchant_connector_id.to_owned(),
status: payout_attempt.status.to_owned(),
error_message: payout_attempt.error_message.to_owned(),
@@ -3620,6 +3640,29 @@ pub async fn payout_create_db_entries(
consts::ID_LENGTH,
format!("payout_{}_secret", payout_id.get_string_repr()).as_str(),
);
+ let sender_details = req
+ .sender_details
+ .clone()
+ .async_map(|sender_details| async {
+ core_utils::create_encrypted_data(
+ &state.into(),
+ platform.get_processor().get_key_store(),
+ sender_details,
+ common_utils::type_name!(storage::Payouts),
+ )
+ .await
+ })
+ .await
+ .transpose()
+ .change_context(errors::ApiErrorResponse::InternalServerError)
+ .attach_printable("Unable to encrypt payout sender details")?
+ .map(|encrypted_sender_details| {
+ encrypted_sender_details
+ .deserialize_inner_value(|value| value.parse_value("PayoutSenderDetails"))
+ })
+ .transpose()
+ .change_context(errors::ApiErrorResponse::InternalServerError)
+ .attach_printable("Unable to parse payout sender details")?;
let amount = MinorUnit::from(req.amount.unwrap_or(api::Amount::Zero));
let status = if req.payout_method_data.is_some()
|| req.payout_token.is_some()
@@ -3653,6 +3696,8 @@ pub async fn payout_create_db_entries(
profile_id: profile_id.to_owned(),
attempt_count: 1,
metadata: req.metadata.clone(),
+ funds_transfer_type: req.funds_transfer_type,
+ sender_details,
confirm: req.confirm,
payout_link_id: payout_link
.clone()
@@ -3677,6 +3722,7 @@ pub async fn payout_create_db_entries(
let payouts = db
.insert_payout(
payouts_req,
+ platform.get_processor().get_key_store(),
platform.get_processor().get_account().storage_scheme,
)
.await
@@ -3872,6 +3918,7 @@ pub async fn make_payout_data(
.find_payout_by_merchant_id_payout_id(
merchant_id,
&payout_id,
+ platform.get_processor().get_key_store(),
platform.get_processor().get_account().storage_scheme,
)
.await
@@ -4522,6 +4569,7 @@ pub async fn payouts_manual_update_core(
.find_payout_by_merchant_id_payout_id(
&merchant_id,
&payout_id,
+ &key_store,
merchant_account.storage_scheme,
)
.await
@@ -4585,6 +4633,7 @@ pub async fn payouts_manual_update_core(
&payouts,
payout_update,
&updated_payout_attempt,
+ &key_store,
merchant_account.storage_scheme,
)
.await
diff --git a/crates/router/src/core/payouts/guards.rs b/crates/router/src/core/payouts/guards.rs
index 00b5cb4171..f0844c50ae 100644
--- a/crates/router/src/core/payouts/guards.rs
+++ b/crates/router/src/core/payouts/guards.rs
@@ -210,6 +210,7 @@ async fn update_blocked_payout_tracker(
status: common_enums::PayoutStatus::Failed,
},
&payout_data.payout_attempt,
+ platform.get_processor().get_key_store(),
storage_scheme,
)
.await
diff --git a/crates/router/src/core/payouts/helpers.rs b/crates/router/src/core/payouts/helpers.rs
index a9175ae125..88e1dee1fc 100644
--- a/crates/router/src/core/payouts/helpers.rs
+++ b/crates/router/src/core/payouts/helpers.rs
@@ -890,6 +890,7 @@ pub async fn save_payout_data_to_locker(
payouts,
updated_payout,
&payout_data.payout_attempt,
+ platform.get_processor().get_key_store(),
platform.get_processor().get_account().storage_scheme,
)
.await
@@ -1418,10 +1419,16 @@ pub(super) async fn filter_by_constraints(
db: &dyn StorageInterface,
constraints: &api::PayoutListConstraints,
merchant_id: &id_type::MerchantId,
+ merchant_key_store: &domain::MerchantKeyStore,
storage_scheme: storage::enums::MerchantStorageScheme,
) -> CustomResult<Vec<storage::Payouts>, errors::StorageError> {
let result = db
- .filter_payouts_by_constraints(merchant_id, &constraints.clone().into(), storage_scheme)
+ .filter_payouts_by_constraints(
+ merchant_id,
+ &constraints.clone().into(),
+ merchant_key_store,
+ storage_scheme,
+ )
.await?;
Ok(result)
}
@@ -1511,6 +1518,25 @@ pub async fn update_payouts_and_payout_attempt(
// Update DB with new data
let payouts = payout_data.payouts.to_owned();
let amount = MinorUnit::from(req.amount.unwrap_or(payouts.amount.into()));
+ let funds_transfer_type = req.funds_transfer_type.or(payouts.funds_transfer_type);
+ let sender_details = req
+ .sender_details
+ .clone()
+ .or_else(|| payouts.get_optional_sender_details().cloned())
+ .async_map(|sender_details| async {
+ core_utils::create_encrypted_data(
+ &state.into(),
+ platform.get_processor().get_key_store(),
+ sender_details,
+ type_name!(storage::Payouts),
+ )
+ .await
+ })
+ .await
+ .transpose()
+ .change_context(errors::ApiErrorResponse::InternalServerError)
+ .attach_printable("Unable to encrypt payout sender details")?
+ .map(Encryption::from);
let updated_payouts = storage::PayoutsUpdate::Update {
amount,
destination_currency: req
@@ -1537,6 +1563,8 @@ pub async fn update_payouts_and_payout_attempt(
.or(payouts.return_url.clone()),
entity_type: req.entity_type.to_owned().unwrap_or(payouts.entity_type),
metadata: req.metadata.clone().or(payouts.metadata.clone()),
+ funds_transfer_type,
+ sender_details,
status: Some(status),
profile_id: Some(payout_attempt.profile_id.clone()),
confirm: req.confirm.to_owned(),
@@ -1553,6 +1581,7 @@ pub async fn update_payouts_and_payout_attempt(
&payouts,
updated_payouts,
&payout_attempt,
+ platform.get_processor().get_key_store(),
platform.get_processor().get_account().storage_scheme,
)
.await
diff --git a/crates/router/src/core/payouts/proxy.rs b/crates/router/src/core/payouts/proxy.rs
index 0922438de5..53405fd946 100644
--- a/crates/router/src/core/payouts/proxy.rs
+++ b/crates/router/src/core/payouts/proxy.rs
@@ -836,6 +836,7 @@ impl ExternalVaultPayout<'_> {
&*state.store,
&payout_id,
merchant_id,
+ platform.get_processor().get_key_store(),
platform.get_processor().get_account().storage_scheme,
)
.await
diff --git a/crates/router/src/core/payouts/retry.rs b/crates/router/src/core/payouts/retry.rs
index 4983b1d556..d3d380a1b5 100644
--- a/crates/router/src/core/payouts/retry.rs
+++ b/crates/router/src/core/payouts/retry.rs
@@ -318,6 +318,7 @@ pub async fn modify_trackers(
&payout_data.payouts,
updated_payouts,
&payout_data.payout_attempt,
+ platform.get_processor().get_key_store(),
platform.get_processor().get_account().storage_scheme,
)
.await
diff --git a/crates/router/src/core/payouts/transformers.rs b/crates/router/src/core/payouts/transformers.rs
index 2347b94bcd..398d626878 100644
--- a/crates/router/src/core/payouts/transformers.rs
+++ b/crates/router/src/core/payouts/transformers.rs
@@ -69,6 +69,7 @@ impl
unified_code: None,
unified_message: None,
};
+ let sender_details = payout.get_optional_sender_details().cloned();
Self {
payout_id: payout.payout_id,
merchant_id: payout.merchant_id,
@@ -89,6 +90,8 @@ impl
entity_type: payout.entity_type,
recurring: payout.recurring,
metadata: payout.metadata,
+ funds_transfer_type: payout.funds_transfer_type,
+ sender_details,
status: payout_attempt.status,
error_message: payout_attempt.error_message,
error_code: payout_attempt.error_code,
diff --git a/crates/router/src/core/payouts/validator.rs b/crates/router/src/core/payouts/validator.rs
index e923f4f778..fc824c9475 100644
--- a/crates/router/src/core/payouts/validator.rs
+++ b/crates/router/src/core/payouts/validator.rs
@@ -100,10 +100,16 @@ pub async fn validate_uniqueness_of_payout_id_against_merchant_id(
db: &dyn StorageInterface,
payout_id: &id_type::PayoutId,
merchant_id: &id_type::MerchantId,
+ merchant_key_store: &domain::MerchantKeyStore,
storage_scheme: storage::enums::MerchantStorageScheme,
) -> RouterResult<Option<storage::Payouts>> {
let maybe_payouts = db
- .find_optional_payout_by_merchant_id_payout_id(merchant_id, payout_id, storage_scheme)
+ .find_optional_payout_by_merchant_id_payout_id(
+ merchant_id,
+ payout_id,
+ merchant_key_store,
+ storage_scheme,
+ )
.await;
match maybe_payouts {
Err(err) => {
@@ -207,6 +213,7 @@ pub async fn validate_create_request(
db,
&payout_id,
merchant_id,
+ platform.get_processor().get_key_store(),
platform.get_processor().get_account().storage_scheme,
)
.await
diff --git a/crates/router/src/core/unified_connector_service/connector_config.rs b/crates/router/src/core/unified_connector_service/connector_config.rs
index 13e75cd694..0eef80e014 100644
--- a/crates/router/src/core/unified_connector_service/connector_config.rs
+++ b/crates/router/src/core/unified_connector_service/connector_config.rs
@@ -63,6 +63,14 @@ pub struct AdyenMetadata {
endpoint_prefix: Option<Secret<String>>,
}
+/// Checkout payout configuration stored on the merchant connector account.
+#[derive(Debug, serde::Deserialize)]
+pub struct CheckoutMetadata {
+ connector_client_id: Option<Secret<String>>,
+ /// Checkout currency account (`ca_...`) used as the payout `source.id`.
+ connector_currency_account_id: Option<Secret<String>>,
+}
+
#[derive(Debug, serde::Deserialize)]
pub struct JpmorganMetadata {
company_name: Secret<String>,
@@ -376,6 +384,11 @@ pub enum ConnectorSpecificConfig {
api_key: Secret<String>,
api_secret: Secret<String>,
processing_channel_id: Secret<String>,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ connector_client_id: Option<Secret<String>>,
+ /// Payout-only Checkout currency account (`ca_...`) used as `source.id`.
+ #[serde(skip_serializing_if = "Option::is_none")]
+ connector_currency_account_id: Option<Secret<String>>,
},
/// Authorize.net connector configuration
Authorizedotnet {
@@ -1544,11 +1557,30 @@ impl ForeignTryFrom<(Connector, &ConnectorAuthType, Option<&serde_json::Value>)>
api_key,
key1,
api_secret,
- } => Ok(Self::Checkout {
- api_key: api_key.clone(),
- api_secret: api_secret.clone(),
- processing_channel_id: key1.clone(),
- }),
+ } => {
+ let checkout_metadata = metadata
+ .map(|metadata| {
+ serde_json::from_value::<CheckoutMetadata>(metadata.clone())
+ .map_err(|_| err("Invalid Checkout metadata format"))
+ })
+ .transpose()?;
+
+ let (connector_client_id, connector_currency_account_id) = checkout_metadata
+ .map(|metadata| {
+ (
+ metadata.connector_client_id,
+ metadata.connector_currency_account_id,
+ )
+ })
+ .unwrap_or_default();
+ Ok(Self::Checkout {
+ api_key: api_key.clone(),
+ api_secret: api_secret.clone(),
+ processing_channel_id: key1.clone(),
+ connector_client_id,
+ connector_currency_account_id,
+ })
+ }
_ => Err(err("Checkout requires SignatureKey auth type")),
},
Connector::Dlocal => match auth {
diff --git a/crates/router/src/core/unified_connector_service/transformers.rs b/crates/router/src/core/unified_connector_service/transformers.rs
index 907ae9288c..a93e389fa8 100644
--- a/crates/router/src/core/unified_connector_service/transformers.rs
+++ b/crates/router/src/core/unified_connector_service/transformers.rs
@@ -230,6 +230,48 @@ impl transformers::ForeignTryFrom<&payments_grpc::Money>
}
}
+impl ForeignFrom<api_models::sender::SourceOfFunds> for payments_grpc::PayoutSourceOfFunds {
+ fn foreign_from(value: api_models::sender::SourceOfFunds) -> Self {
+ use api_models::sender::SourceOfFunds;
+ match value {
+ SourceOfFunds::Credit => Self::Credit,
+ SourceOfFunds::Debit => Self::Debit,
+ SourceOfFunds::Prepaid => Self::Prepaid,
+ SourceOfFunds::DepositAccount => Self::DepositAccount,
+ SourceOfFunds::MobileMoneyAccount => Self::MobileMoneyAccount,
+ SourceOfFunds::Cash => Self::Cash,
+ }
+ }
+}
+
+impl ForeignFrom<common_enums::PayoutFundsTransferType> for payments_grpc::PayoutFundsTransferType {
+ fn foreign_from(funds_transfer_type: common_enums::PayoutFundsTransferType) -> Self {
+ use common_enums::PayoutFundsTransferType as FundsTransferType;
+ match funds_transfer_type {
+ FundsTransferType::AccountToAccount => Self::AccountToAccount,
+ FundsTransferType::FundsTransfer => Self::FundsTransfer,
+ FundsTransferType::CrossBorderMoneyTransfer => Self::CrossBorderMoneyTransfer,
+ FundsTransferType::PeerToPeer => Self::PeerToPeer,
+ FundsTransferType::StagedDigitalWalletTransfer => Self::StagedDigitalWalletTransfer,
+ FundsTransferType::FundsDisbursement => Self::FundsDisbursement,
+ FundsTransferType::LoyaltyPayments => Self::LoyaltyPayments,
+ FundsTransferType::PayrollAndPensionDisbursements => {
+ Self::PayrollAndPensionDisbursements
+ }
+ FundsTransferType::OnlineGambling => Self::OnlineGambling,
+ FundsTransferType::MastercardPersonToPerson => Self::MastercardPersonToPerson,
+ FundsTransferType::MastercardTransferToOwnAccount => {
+ Self::MastercardTransferToOwnAccount
+ }
+ FundsTransferType::MastercardBusinessDisbursement => {
+ Self::MastercardBusinessDisbursement
+ }
+ FundsTransferType::MastercardBusinessToBusiness => Self::MastercardBusinessToBusiness,
+ FundsTransferType::MastercardGamingRepay => Self::MastercardGamingRepay,
+ }
+ }
+}
+
impl ForeignFrom<&api_models::payments::ConnectorMetadata>
for payments_grpc::AdditionalConnectorDetails
{
@@ -1657,6 +1699,8 @@ impl ForeignFrom<&mandates::ConnectorMandateReferenceId>
mandate_metadata: value.get_mandate_metadata().map(|mandate_metadata| {
Secret::new(serde_json::to_string(&mandate_metadata.expose()).unwrap_or_default())
}),
+ network_transaction_id: None,
+ transaction_link_id: None,
}
}
}
@@ -1701,6 +1745,8 @@ impl ForeignFrom<&RouterData<PSync, PaymentsSyncData, PaymentsResponseData>>
serde_json::to_string(&mandate_metadata.expose()).unwrap_or_default(),
)
}),
+ network_transaction_id: None,
+ transaction_link_id: None,
})
}
}
@@ -2562,6 +2608,7 @@ impl transformers::ForeignTryFrom<&RouterData<Capture, PaymentsCaptureData, Paym
Ok(Self {
split_settlement: None,
+ domain_data: None,
payment_method,
connector_transaction_id,
merchant_capture_id: Some(router_data.connector_request_reference_id.clone()),
@@ -3816,6 +3863,8 @@ impl
.unwrap_or_default(),
)
}),
+ network_transaction_id: None,
+ transaction_link_id: None,
},
),
),
@@ -6090,6 +6139,7 @@ impl transformers::ForeignTryFrom<router_request_types::BrowserInformation>
) -> Result<Self, Self::Error> {
Ok(Self {
color_depth: browser_info.color_depth.map(|v| v.into()),
+ challenge_window_size: None,
java_enabled: browser_info.java_enabled,
java_script_enabled: browser_info.java_script_enabled,
language: browser_info.language,
@@ -10062,6 +10112,22 @@ impl
.transpose()?;
Ok(Self {
+ funds_transfer_type: router_data
+ .request
+ .funds_transfer_type
+ .map(payments_grpc::PayoutFundsTransferType::foreign_from)
+ .map(i32::from),
+ vendor_account_details: router_data
+ .request
+ .vendor_details
+ .as_ref()
+ .map(|details| {
+ payments_grpc::PayoutVendorAccountDetails::foreign_try_from((
+ details,
+ router_data,
+ ))
+ })
+ .transpose()?,
merchant_payout_id: router_data.payout_id.clone(),
address: Some(address),
amount: Some(money),
@@ -10185,7 +10251,7 @@ impl<F>
type Error = error_stack::Report<UnifiedConnectorServiceError>;
fn foreign_try_from(
- (vendor_account_details, router_data): (
+ (vendor_account_details, _router_data): (
&api_models::payouts::PayoutVendorAccountDetails,
&RouterData<F, router_request_types::PayoutsData, PayoutsResponseData>,
),
@@ -10193,16 +10259,30 @@ impl<F>
let vendor_details = &vendor_account_details.vendor_details;
let individual_details = &vendor_account_details.individual_details;
- let billing_details = router_data
- .address
- .get_payment_method_billing()
- .and_then(|billing_address| billing_address.address.as_ref());
-
let business_profile_name = vendor_details
.business_profile_name
.as_ref()
.map(|name| name.peek().to_string().into());
+ let individual_address = individual_details
+ .address
+ .as_ref()
+ .filter(|address| {
+ address.address.is_some()
+ || address.email.is_some()
+ || address
+ .phone
+ .as_ref()
+ .is_some_and(|phone| phone.number.is_some() || phone.country_code.is_some())
+ })
+ .cloned()
+ .map(|address| {
+ payments_grpc::Address::foreign_try_from(
+ hyperswitch_domain_models::address::Address::from(address),
+ )
+ })
+ .transpose()?;
+
Ok(Self {
vendor_details: Some(payments_grpc::VendorDetails {
account_type: match vendor_details.account_type.as_str() {
@@ -10234,20 +10314,45 @@ impl<F>
},
card_payments_enabled: vendor_details.capabilities_card_payments,
transfers_enabled: vendor_details.capabilities_transfers,
+ company_tax_id: vendor_details.company_tax_id.clone(),
+ address: Some(payments_grpc::Address {
+ first_name: None,
+ last_name: None,
+ line1: vendor_details.company_address_line1.clone(),
+ line2: vendor_details.company_address_line2.clone(),
+ line3: None,
+ city: vendor_details.company_address_city.clone(),
+ state: vendor_details.company_address_state.clone(),
+ zip_code: vendor_details.company_address_postal_code.clone(),
+ origin_zip: None,
+ country_alpha2_code: vendor_details
+ .company_address_country
+ .and_then(|country| {
+ payments_grpc::CountryAlpha2::from_str_name(&country.to_string())
+ })
+ .map(i32::from),
+ email: vendor_details
+ .email
+ .as_ref()
+ .map(|email| Secret::new(email.peek().clone())),
+ phone_number: vendor_details.company_phone.clone(),
+ phone_country_code: vendor_details.phone_country_code.clone(),
+ state_code_iso: None,
+ }),
+ merchant_sender_reference_id: vendor_details.reference_id.clone(),
+ source_of_funds: vendor_details
+ .source_of_funds
+ .map(payments_grpc::PayoutSourceOfFunds::foreign_from)
+ .map(i32::from),
}),
individual_details: Some(payments_grpc::IndividualDetails {
- first_name: billing_details
- .and_then(|billing_details| billing_details.first_name.as_ref())
- .map(|first_name| first_name.peek().to_string().into()),
- last_name: billing_details
- .and_then(|billing_details| billing_details.last_name.as_ref())
- .map(|last_name| last_name.peek().to_string().into()),
- phone: router_data
- .request
- .customer_details
+ first_name: individual_details.first_name.clone(),
+ last_name: individual_details.last_name.clone(),
+ phone: individual_details
+ .address
.as_ref()
- .and_then(|customer_details| customer_details.phone.as_ref())
- .map(|phone| phone.peek().to_string().into()),
+ .and_then(|address| address.phone.as_ref())
+ .and_then(|phone| phone.number.clone()),
ssn_last_4: individual_details
.individual_ssn_last_4
.as_ref()
@@ -10256,20 +10361,11 @@ impl<F>
.individual_id_number
.as_ref()
.map(|id_number| id_number.peek().to_string().into()),
- date_of_birth: match individual_details.date_of_birth.as_ref() {
- Some(date) => Some(format_date_of_birth(date)?),
- None => match (
- individual_details.individual_dob_year.as_ref(),
- individual_details.individual_dob_month.as_ref(),
- individual_details.individual_dob_day.as_ref(),
- ) {
- (Some(year), Some(month), Some(day)) => Some(
- format!("{}-{:0>2}-{:0>2}", year.peek(), month.peek(), day.peek())
- .into(),
- ),
- _ => None,
- },
- },
+ date_of_birth: individual_details
+ .date_of_birth
+ .as_ref()
+ .map(format_date_of_birth)
+ .transpose()?,
tos_acceptance_ip: individual_details
.tos_acceptance_ip
.as_ref()
@@ -10283,6 +10379,12 @@ impl<F>
_ => None,
},
tos_acceptance_date: individual_details.tos_acceptance_date,
+ address: individual_address,
+ merchant_sender_reference_id: individual_details.reference_id.clone(),
+ source_of_funds: individual_details
+ .source_of_funds
+ .map(payments_grpc::PayoutSourceOfFunds::foreign_from)
+ .map(i32::from),
}),
})
}
diff --git a/crates/router/src/core/utils.rs b/crates/router/src/core/utils.rs
index 2422b7a313..0a64661084 100644
--- a/crates/router/src/core/utils.rs
+++ b/crates/router/src/core/utils.rs
@@ -290,7 +290,13 @@ pub(super) async fn construct_payout_router_data_common<F>(
})
.and_then(|id| serde_json::from_value::<String>(id).ok());
- let vendor_details: Option<PayoutVendorAccountDetails> =
+ let vendor_details: Option<PayoutVendorAccountDetails> = if let Some(sender_details) =
+ payout_data.payouts.get_optional_sender_details()
+ {
+ // Persisted sender input is normalized to the vendor type only at this
+ // domain boundary; the raw sender identity stays on the payout row.
+ Some(sender_details.clone().into())
+ } else {
match api_models::enums::PayoutConnectors::try_from(connector_name.to_owned()).map_err(
|err| report!(errors::ApiErrorResponse::InternalServerError).attach_printable(err),
)? {
@@ -316,7 +322,8 @@ pub(super) async fn construct_payout_router_data_common<F>(
})
.transpose()?,
_ => None,
- };
+ }
+ };
let webhook_url = helpers::create_webhook_url(
&state.base_url,
@@ -401,6 +408,7 @@ pub(super) async fn construct_payout_router_data_common<F>(
connector_transfer_method_id,
webhook_url: Some(webhook_url),
browser_info,
+ funds_transfer_type: payouts.funds_transfer_type,
payout_connector_metadata: payout_attempt.payout_connector_metadata.to_owned(),
additional_payout_method_data: payout_attempt.additional_payout_method_data.to_owned(),
source_bank_data: payout_data.source_bank_data.clone(),
diff --git a/crates/router/src/core/verification/utils.rs b/crates/router/src/core/verification/utils.rs
index 2f24f53f7e..81f36046c1 100644
--- a/crates/router/src/core/verification/utils.rs
+++ b/crates/router/src/core/verification/utils.rs
@@ -234,6 +234,7 @@ pub async fn check_if_profile_id_is_present_in_payouts(
.find_payout_by_merchant_id_payout_id(
processor.get_account().get_id(),
&payout_id,
+ processor.get_key_store(),
processor.get_account().storage_scheme,
)
.await
diff --git a/crates/router/src/core/webhooks/incoming.rs b/crates/router/src/core/webhooks/incoming.rs
index 2a8dd6ce05..4016f07c37 100644
--- a/crates/router/src/core/webhooks/incoming.rs
+++ b/crates/router/src/core/webhooks/incoming.rs
@@ -1354,6 +1354,7 @@ async fn payout_incoming_webhook_update_status(
&payout_data.payouts,
payouts_update,
payout_attempt,
+ platform.get_processor().get_key_store(),
platform.get_processor().get_account().storage_scheme,
)
.await
diff --git a/crates/router/src/db/kafka_store.rs b/crates/router/src/db/kafka_store.rs
index 8f9de76e76..5410de6386 100644
--- a/crates/router/src/db/kafka_store.rs
+++ b/crates/router/src/db/kafka_store.rs
@@ -2817,10 +2817,16 @@ impl PayoutsInterface for KafkaStore {
&self,
merchant_id: &id_type::MerchantId,
payout_id: &id_type::PayoutId,
+ merchant_key_store: &domain::MerchantKeyStore,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<storage::Payouts, errors::StorageError> {
self.diesel_store
- .find_payout_by_merchant_id_payout_id(merchant_id, payout_id, storage_scheme)
+ .find_payout_by_merchant_id_payout_id(
+ merchant_id,
+ payout_id,
+ merchant_key_store,
+ storage_scheme,
+ )
.await
}
@@ -2829,11 +2835,18 @@ impl PayoutsInterface for KafkaStore {
this: &storage::Payouts,
payout_update: storage::PayoutsUpdate,
payout_attempt: &storage::PayoutAttempt,
+ merchant_key_store: &domain::MerchantKeyStore,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<storage::Payouts, errors::StorageError> {
let payout = self
.diesel_store
- .update_payout(this, payout_update, payout_attempt, storage_scheme)
+ .update_payout(
+ this,
+ payout_update,
+ payout_attempt,
+ merchant_key_store,
+ storage_scheme,
+ )
.await?;
if let Err(err) = self
.kafka_producer
@@ -2852,10 +2865,11 @@ impl PayoutsInterface for KafkaStore {
async fn insert_payout(
&self,
payout: storage::PayoutsNew,
+ merchant_key_store: &domain::MerchantKeyStore,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<storage::Payouts, errors::StorageError> {
self.diesel_store
- .insert_payout(payout, storage_scheme)
+ .insert_payout(payout, merchant_key_store, storage_scheme)
.await
}
@@ -2863,10 +2877,16 @@ impl PayoutsInterface for KafkaStore {
&self,
merchant_id: &id_type::MerchantId,
payout_id: &id_type::PayoutId,
+ merchant_key_store: &domain::MerchantKeyStore,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<Option<storage::Payouts>, errors::StorageError> {
self.diesel_store
- .find_optional_payout_by_merchant_id_payout_id(merchant_id, payout_id, storage_scheme)
+ .find_optional_payout_by_merchant_id_payout_id(
+ merchant_id,
+ payout_id,
+ merchant_key_store,
+ storage_scheme,
+ )
.await
}
@@ -2875,10 +2895,11 @@ impl PayoutsInterface for KafkaStore {
&self,
merchant_id: &id_type::MerchantId,
filters: &hyperswitch_domain_models::payouts::PayoutFetchConstraints,
+ merchant_key_store: &domain::MerchantKeyStore,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<Vec<storage::Payouts>, errors::StorageError> {
self.diesel_store
- .filter_payouts_by_constraints(merchant_id, filters, storage_scheme)
+ .filter_payouts_by_constraints(merchant_id, filters, merchant_key_store, storage_scheme)
.await
}
@@ -2887,6 +2908,7 @@ impl PayoutsInterface for KafkaStore {
&self,
merchant_id: &id_type::MerchantId,
filters: &hyperswitch_domain_models::payouts::PayoutFetchConstraints,
+ merchant_key_store: &domain::MerchantKeyStore,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<
Vec<(
@@ -2898,7 +2920,7 @@ impl PayoutsInterface for KafkaStore {
errors::StorageError,
> {
self.diesel_store
- .filter_payouts_and_attempts(merchant_id, filters, storage_scheme)
+ .filter_payouts_and_attempts(merchant_id, filters, merchant_key_store, storage_scheme)
.await
}
@@ -2907,10 +2929,16 @@ impl PayoutsInterface for KafkaStore {
&self,
merchant_id: &id_type::MerchantId,
time_range: &common_utils::types::TimeRange,
+ merchant_key_store: &domain::MerchantKeyStore,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<Vec<storage::Payouts>, errors::StorageError> {
self.diesel_store
- .filter_payouts_by_time_range_constraints(merchant_id, time_range, storage_scheme)
+ .filter_payouts_by_time_range_constraints(
+ merchant_id,
+ time_range,
+ merchant_key_store,
+ storage_scheme,
+ )
.await
}
diff --git a/crates/router/tests/connectors/utils.rs b/crates/router/tests/connectors/utils.rs
index b098b9f0f0..0d87ee4d1f 100644
--- a/crates/router/tests/connectors/utils.rs
+++ b/crates/router/tests/connectors/utils.rs
@@ -487,6 +487,7 @@ pub trait ConnectorActions: Connector {
connector_transfer_method_id: None,
webhook_url: None,
browser_info: None,
+ funds_transfer_type: None,
payout_connector_metadata: None,
additional_payout_method_data: None,
source_bank_data: None,
diff --git a/crates/storage_impl/src/mock_db/payouts.rs b/crates/storage_impl/src/mock_db/payouts.rs
index 3e493f9e3c..df90966d76 100644
--- a/crates/storage_impl/src/mock_db/payouts.rs
+++ b/crates/storage_impl/src/mock_db/payouts.rs
@@ -1,8 +1,11 @@
use common_utils::errors::CustomResult;
use diesel_models::enums as storage_enums;
-use hyperswitch_domain_models::payouts::{
- payout_attempt::PayoutAttempt,
- payouts::{Payouts, PayoutsInterface, PayoutsNew, PayoutsUpdate},
+use hyperswitch_domain_models::{
+ merchant_key_store::MerchantKeyStore,
+ payouts::{
+ payout_attempt::PayoutAttempt,
+ payouts::{Payouts, PayoutsInterface, PayoutsNew, PayoutsUpdate},
+ },
};
use crate::{errors::StorageError, MockDb};
@@ -14,6 +17,7 @@ impl PayoutsInterface for MockDb {
&self,
_merchant_id: &common_utils::id_type::MerchantId,
_payout_id: &common_utils::id_type::PayoutId,
+ _merchant_key_store: &MerchantKeyStore,
_storage_scheme: storage_enums::MerchantStorageScheme,
) -> CustomResult<Payouts, StorageError> {
// TODO: Implement function for `MockDb`
@@ -25,6 +29,7 @@ impl PayoutsInterface for MockDb {
_this: &Payouts,
_payout_update: PayoutsUpdate,
_payout_attempt: &PayoutAttempt,
+ _merchant_key_store: &MerchantKeyStore,
_storage_scheme: storage_enums::MerchantStorageScheme,
) -> CustomResult<Payouts, StorageError> {
// TODO: Implement function for `MockDb`
@@ -34,6 +39,7 @@ impl PayoutsInterface for MockDb {
async fn insert_payout(
&self,
_payout: PayoutsNew,
+ _merchant_key_store: &MerchantKeyStore,
_storage_scheme: storage_enums::MerchantStorageScheme,
) -> CustomResult<Payouts, StorageError> {
// TODO: Implement function for `MockDb`
@@ -44,6 +50,7 @@ impl PayoutsInterface for MockDb {
&self,
_merchant_id: &common_utils::id_type::MerchantId,
_payout_id: &common_utils::id_type::PayoutId,
+ _merchant_key_store: &MerchantKeyStore,
_storage_scheme: storage_enums::MerchantStorageScheme,
) -> CustomResult<Option<Payouts>, StorageError> {
// TODO: Implement function for `MockDb`
@@ -55,6 +62,7 @@ impl PayoutsInterface for MockDb {
&self,
_merchant_id: &common_utils::id_type::MerchantId,
_filters: &hyperswitch_domain_models::payouts::PayoutFetchConstraints,
+ _merchant_key_store: &MerchantKeyStore,
_storage_scheme: storage_enums::MerchantStorageScheme,
) -> CustomResult<Vec<Payouts>, StorageError> {
// TODO: Implement function for `MockDb`
@@ -66,6 +74,7 @@ impl PayoutsInterface for MockDb {
&self,
_merchant_id: &common_utils::id_type::MerchantId,
_filters: &hyperswitch_domain_models::payouts::PayoutFetchConstraints,
+ _merchant_key_store: &MerchantKeyStore,
_storage_scheme: storage_enums::MerchantStorageScheme,
) -> CustomResult<
Vec<(
@@ -85,6 +94,7 @@ impl PayoutsInterface for MockDb {
&self,
_merchant_id: &common_utils::id_type::MerchantId,
_time_range: &common_utils::types::TimeRange,
+ _merchant_key_store: &MerchantKeyStore,
_storage_scheme: storage_enums::MerchantStorageScheme,
) -> CustomResult<Vec<Payouts>, StorageError> {
// TODO: Implement function for `MockDb`
diff --git a/crates/storage_impl/src/payouts/payouts.rs b/crates/storage_impl/src/payouts/payouts.rs
index e1755ea1e8..50a6477a6c 100644
--- a/crates/storage_impl/src/payouts/payouts.rs
+++ b/crates/storage_impl/src/payouts/payouts.rs
@@ -1,6 +1,11 @@
#[cfg(feature = "olap")]
use api_models::enums::PayoutConnectors;
-use common_utils::ext_traits::Encode;
+use common_utils::{
+ encryption::Encryption,
+ errors::{CustomResult, ValidationError},
+ ext_traits::Encode,
+ types::keymanager::{Identifier, KeyManagerState},
+};
#[cfg(feature = "olap")]
use diesel::{associations::HasTable, ExpressionMethods, QueryDsl};
#[cfg(all(feature = "v1", feature = "olap"))]
@@ -25,10 +30,15 @@ use diesel_models::{
use error_stack::ResultExt;
#[cfg(feature = "olap")]
use hyperswitch_domain_models::payouts::PayoutFetchConstraints;
-use hyperswitch_domain_models::payouts::{
- payout_attempt::PayoutAttempt,
- payouts::{Payouts, PayoutsInterface, PayoutsNew, PayoutsUpdate},
+use hyperswitch_domain_models::{
+ merchant_key_store::MerchantKeyStore,
+ payouts::{
+ payout_attempt::PayoutAttempt,
+ payouts::{Payouts, PayoutsInterface, PayoutsNew, PayoutsUpdate},
+ },
+ type_encryption::{crypto_operation, CryptoOperation, EncryptedJsonType},
};
+use hyperswitch_masking::{PeekInterface, Secret};
use redis_interface::HsetnxReply;
use router_env::instrument;
@@ -40,6 +50,7 @@ use crate::store::schema::{
payout_attempt::all_columns as poa_all_columns, payouts::all_columns as po_all_columns,
};
use crate::{
+ behaviour::{Conversion, ReverseConversion},
diesel_error_to_data_error,
errors::{RedisErrorExt, StorageError},
kv_router_store::KVRouterStore,
@@ -55,6 +66,7 @@ impl<T: DatabaseStore> PayoutsInterface for KVRouterStore<T> {
async fn insert_payout(
&self,
new: PayoutsNew,
+ merchant_key_store: &MerchantKeyStore,
storage_scheme: MerchantStorageScheme,
) -> error_stack::Result<Payouts, StorageError> {
let storage_scheme = Box::pin(decide_storage_scheme::<_, DieselPayouts>(
@@ -65,7 +77,9 @@ impl<T: DatabaseStore> PayoutsInterface for KVRouterStore<T> {
.await;
match storage_scheme {
MerchantStorageScheme::PostgresOnly => {
- self.router_store.insert_payout(new, storage_scheme).await
+ self.router_store
+ .insert_payout(new, merchant_key_store, storage_scheme)
+ .await
}
MerchantStorageScheme::RedisKv => {
let merchant_id = new.merchant_id.clone();
@@ -92,6 +106,8 @@ impl<T: DatabaseStore> PayoutsInterface for KVRouterStore<T> {
return_url: new.return_url.clone(),
entity_type: new.entity_type,
metadata: new.metadata.clone(),
+ funds_transfer_type: new.funds_transfer_type,
+ sender_details: new.sender_details.clone(),
created_at: new.created_at,
last_modified_at: new.last_modified_at,
profile_id: new.profile_id.clone(),
@@ -146,6 +162,7 @@ impl<T: DatabaseStore> PayoutsInterface for KVRouterStore<T> {
this: &Payouts,
payout_update: PayoutsUpdate,
payout_attempt: &PayoutAttempt,
+ merchant_key_store: &MerchantKeyStore,
storage_scheme: MerchantStorageScheme,
) -> error_stack::Result<Payouts, StorageError> {
let key = PartitionKey::MerchantIdPayoutId {
@@ -162,7 +179,13 @@ impl<T: DatabaseStore> PayoutsInterface for KVRouterStore<T> {
match storage_scheme {
MerchantStorageScheme::PostgresOnly => {
self.router_store
- .update_payout(this, payout_update, payout_attempt, storage_scheme)
+ .update_payout(
+ this,
+ payout_update,
+ payout_attempt,
+ merchant_key_store,
+ storage_scheme,
+ )
.await
}
MerchantStorageScheme::RedisKv => {
@@ -202,7 +225,15 @@ impl<T: DatabaseStore> PayoutsInterface for KVRouterStore<T> {
.try_into_hset()
.change_context(StorageError::KVError)?;
- Ok(Payouts::from_storage_model(diesel_payout))
+ diesel_payout
+ .convert(
+ self.get_keymanager_state()
+ .attach_printable("Missing KeyManagerState")?,
+ merchant_key_store.key.get_inner(),
+ Identifier::Merchant(merchant_key_store.merchant_id.clone()),
+ )
+ .await
+ .change_context(StorageError::DecryptionError)
}
}
}
@@ -212,6 +243,7 @@ impl<T: DatabaseStore> PayoutsInterface for KVRouterStore<T> {
&self,
merchant_id: &common_utils::id_type::MerchantId,
payout_id: &common_utils::id_type::PayoutId,
+ merchant_key_store: &MerchantKeyStore,
storage_scheme: MerchantStorageScheme,
) -> error_stack::Result<Payouts, StorageError> {
let database_call = || async {
@@ -229,7 +261,7 @@ impl<T: DatabaseStore> PayoutsInterface for KVRouterStore<T> {
Op::Find,
))
.await;
- match storage_scheme {
+ let storage_model = match storage_scheme {
MerchantStorageScheme::PostgresOnly => database_call().await,
MerchantStorageScheme::RedisKv => {
let key = PartitionKey::MerchantIdPayoutId {
@@ -251,8 +283,16 @@ impl<T: DatabaseStore> PayoutsInterface for KVRouterStore<T> {
))
.await
}
- }
- .map(Payouts::from_storage_model)
+ }?;
+ storage_model
+ .convert(
+ self.get_keymanager_state()
+ .attach_printable("Missing KeyManagerState")?,
+ merchant_key_store.key.get_inner(),
+ Identifier::Merchant(merchant_key_store.merchant_id.clone()),
+ )
+ .await
+ .change_context(StorageError::DecryptionError)
}
#[instrument(skip_all)]
@@ -260,6 +300,7 @@ impl<T: DatabaseStore> PayoutsInterface for KVRouterStore<T> {
&self,
merchant_id: &common_utils::id_type::MerchantId,
payout_id: &common_utils::id_type::PayoutId,
+ merchant_key_store: &MerchantKeyStore,
storage_scheme: MerchantStorageScheme,
) -> error_stack::Result<Option<Payouts>, StorageError> {
let database_call = || async {
@@ -277,10 +318,10 @@ impl<T: DatabaseStore> PayoutsInterface for KVRouterStore<T> {
Op::Find,
))
.await;
- match storage_scheme {
+ let maybe_payouts = match storage_scheme {
MerchantStorageScheme::PostgresOnly => {
let maybe_payouts = database_call().await?;
- Ok(maybe_payouts.filter(|payout| &payout.payout_id == payout_id))
+ maybe_payouts.filter(|payout| &payout.payout_id == payout_id)
}
MerchantStorageScheme::RedisKv => {
let key = PartitionKey::MerchantIdPayoutId {
@@ -301,10 +342,23 @@ impl<T: DatabaseStore> PayoutsInterface for KVRouterStore<T> {
},
database_call,
))
- .await
+ .await?
}
+ };
+ match maybe_payouts {
+ Some(storage_model) => Ok(Some(
+ storage_model
+ .convert(
+ self.get_keymanager_state()
+ .attach_printable("Missing KeyManagerState")?,
+ merchant_key_store.key.get_inner(),
+ Identifier::Merchant(merchant_key_store.merchant_id.clone()),
+ )
+ .await
+ .change_context(StorageError::DecryptionError)?,
+ )),
+ None => Ok(None),
}
- .map(|payout| payout.map(Payouts::from_storage_model))
}
#[cfg(feature = "olap")]
@@ -313,10 +367,11 @@ impl<T: DatabaseStore> PayoutsInterface for KVRouterStore<T> {
&self,
merchant_id: &common_utils::id_type::MerchantId,
filters: &PayoutFetchConstraints,
+ merchant_key_store: &MerchantKeyStore,
storage_scheme: MerchantStorageScheme,
) -> error_stack::Result<Vec<Payouts>, StorageError> {
self.router_store
- .filter_payouts_by_constraints(merchant_id, filters, storage_scheme)
+ .filter_payouts_by_constraints(merchant_id, filters, merchant_key_store, storage_scheme)
.await
}
@@ -326,6 +381,7 @@ impl<T: DatabaseStore> PayoutsInterface for KVRouterStore<T> {
&self,
merchant_id: &common_utils::id_type::MerchantId,
filters: &PayoutFetchConstraints,
+ merchant_key_store: &MerchantKeyStore,
storage_scheme: MerchantStorageScheme,
) -> error_stack::Result<
Vec<(
@@ -337,7 +393,7 @@ impl<T: DatabaseStore> PayoutsInterface for KVRouterStore<T> {
StorageError,
> {
self.router_store
- .filter_payouts_and_attempts(merchant_id, filters, storage_scheme)
+ .filter_payouts_and_attempts(merchant_id, filters, merchant_key_store, storage_scheme)
.await
}
@@ -347,10 +403,16 @@ impl<T: DatabaseStore> PayoutsInterface for KVRouterStore<T> {
&self,
merchant_id: &common_utils::id_type::MerchantId,
time_range: &common_utils::types::TimeRange,
+ merchant_key_store: &MerchantKeyStore,
storage_scheme: MerchantStorageScheme,
) -> error_stack::Result<Vec<Payouts>, StorageError> {
self.router_store
- .filter_payouts_by_time_range_constraints(merchant_id, time_range, storage_scheme)
+ .filter_payouts_by_time_range_constraints(
+ merchant_id,
+ time_range,
+ merchant_key_store,
+ storage_scheme,
+ )
.await
}
@@ -409,17 +471,23 @@ impl<T: DatabaseStore> PayoutsInterface for crate::RouterStore<T> {
async fn insert_payout(
&self,
new: PayoutsNew,
+ merchant_key_store: &MerchantKeyStore,
_storage_scheme: MerchantStorageScheme,
) -> error_stack::Result<Payouts, StorageError> {
let conn = pg_connection_write(self).await?;
- new.to_storage_model()
- .insert(&conn)
+ let storage_model = new.to_storage_model().insert(&conn).await.map_err(|er| {
+ let new_err = diesel_error_to_data_error(*er.current_context());
+ er.change_context(new_err)
+ })?;
+ storage_model
+ .convert(
+ self.get_keymanager_state()
+ .attach_printable("Missing KeyManagerState")?,
+ merchant_key_store.key.get_inner(),
+ Identifier::Merchant(merchant_key_store.merchant_id.clone()),
+ )
.await
- .map_err(|er| {
- let new_err = diesel_error_to_data_error(*er.current_context());
- er.change_context(new_err)
- })
- .map(Payouts::from_storage_model)
+ .change_context(StorageError::DecryptionError)
}
#[instrument(skip_all)]
@@ -428,18 +496,28 @@ impl<T: DatabaseStore> PayoutsInterface for crate::RouterStore<T> {
this: &Payouts,
payout: PayoutsUpdate,
_payout_attempt: &PayoutAttempt,
+ merchant_key_store: &MerchantKeyStore,
_storage_scheme: MerchantStorageScheme,
) -> error_stack::Result<Payouts, StorageError> {
let conn = pg_connection_write(self).await?;
- this.clone()
+ let storage_model = this
+ .clone()
.to_storage_model()
.update(&conn, payout.to_storage_model())
.await
.map_err(|er| {
let new_err = diesel_error_to_data_error(*er.current_context());
er.change_context(new_err)
- })
- .map(Payouts::from_storage_model)
+ })?;
+ storage_model
+ .convert(
+ self.get_keymanager_state()
+ .attach_printable("Missing KeyManagerState")?,
+ merchant_key_store.key.get_inner(),
+ Identifier::Merchant(merchant_key_store.merchant_id.clone()),
+ )
+ .await
+ .change_context(StorageError::DecryptionError)
}
#[instrument(skip_all)]
@@ -447,16 +525,26 @@ impl<T: DatabaseStore> PayoutsInterface for crate::RouterStore<T> {
&self,
merchant_id: &common_utils::id_type::MerchantId,
payout_id: &common_utils::id_type::PayoutId,
+ merchant_key_store: &MerchantKeyStore,
_storage_scheme: MerchantStorageScheme,
) -> error_stack::Result<Payouts, StorageError> {
let conn = pg_connection_read(self).await?;
- DieselPayouts::find_by_merchant_id_payout_id(&conn, merchant_id, payout_id)
+ let storage_model =
+ DieselPayouts::find_by_merchant_id_payout_id(&conn, merchant_id, payout_id)
+ .await
+ .map_err(|er| {
+ let new_err = diesel_error_to_data_error(*er.current_context());
+ er.change_context(new_err)
+ })?;
+ storage_model
+ .convert(
+ self.get_keymanager_state()
+ .attach_printable("Missing KeyManagerState")?,
+ merchant_key_store.key.get_inner(),
+ Identifier::Merchant(merchant_key_store.merchant_id.clone()),
+ )
.await
- .map(Payouts::from_storage_model)
- .map_err(|er| {
- let new_err = diesel_error_to_data_error(*er.current_context());
- er.change_context(new_err)
- })
+ .change_context(StorageError::DecryptionError)
}
#[instrument(skip_all)]
@@ -464,16 +552,31 @@ impl<T: DatabaseStore> PayoutsInterface for crate::RouterStore<T> {
&self,
merchant_id: &common_utils::id_type::MerchantId,
payout_id: &common_utils::id_type::PayoutId,
+ merchant_key_store: &MerchantKeyStore,
_storage_scheme: MerchantStorageScheme,
) -> error_stack::Result<Option<Payouts>, StorageError> {
let conn = pg_connection_read(self).await?;
- DieselPayouts::find_optional_by_merchant_id_payout_id(&conn, merchant_id, payout_id)
- .await
- .map(|x| x.map(Payouts::from_storage_model))
- .map_err(|er| {
- let new_err = diesel_error_to_data_error(*er.current_context());
- er.change_context(new_err)
- })
+ let maybe_payouts =
+ DieselPayouts::find_optional_by_merchant_id_payout_id(&conn, merchant_id, payout_id)
+ .await
+ .map_err(|er| {
+ let new_err = diesel_error_to_data_error(*er.current_context());
+ er.change_context(new_err)
+ })?;
+ match maybe_payouts {
+ Some(storage_model) => Ok(Some(
+ storage_model
+ .convert(
+ self.get_keymanager_state()
+ .attach_printable("Missing KeyManagerState")?,
+ merchant_key_store.key.get_inner(),
+ Identifier::Merchant(merchant_key_store.merchant_id.clone()),
+ )
+ .await
+ .change_context(StorageError::DecryptionError)?,
+ )),
+ None => Ok(None),
+ }
}
#[cfg(feature = "olap")]
@@ -482,6 +585,7 @@ impl<T: DatabaseStore> PayoutsInterface for crate::RouterStore<T> {
&self,
merchant_id: &common_utils::id_type::MerchantId,
filters: &PayoutFetchConstraints,
+ merchant_key_store: &MerchantKeyStore,
storage_scheme: MerchantStorageScheme,
) -> error_stack::Result<Vec<Payouts>, StorageError> {
let conn = connection::pg_connection_read(self).await?;
@@ -514,6 +618,7 @@ impl<T: DatabaseStore> PayoutsInterface for crate::RouterStore<T> {
.find_payout_by_merchant_id_payout_id(
merchant_id,
starting_after_id,
+ merchant_key_store,
storage_scheme,
)
.await?
@@ -531,6 +636,7 @@ impl<T: DatabaseStore> PayoutsInterface for crate::RouterStore<T> {
.find_payout_by_merchant_id_payout_id(
merchant_id,
ending_before_id,
+ merchant_key_store,
storage_scheme,
)
.await?
@@ -552,21 +658,32 @@ impl<T: DatabaseStore> PayoutsInterface for crate::RouterStore<T> {
}
}
- conn.track_get_results::<<DieselPayouts as HasTable>::Table, _, DieselPayouts>(
- db_metrics::DatabaseOperation::Filter,
- query,
- )
- .await
- .map(|payouts| {
- payouts
- .into_iter()
- .map(Payouts::from_storage_model)
- .collect::<Vec<Payouts>>()
- })
- .map_err(|er| {
- error_stack::report!(StorageError::from(er))
- .attach_printable("Error filtering payout records")
- })
+ let storage_models = conn
+ .track_get_results::<<DieselPayouts as HasTable>::Table, _, DieselPayouts>(
+ db_metrics::DatabaseOperation::Filter,
+ query,
+ )
+ .await
+ .map_err(|er| {
+ error_stack::report!(StorageError::from(er))
+ .attach_printable("Error filtering payout records")
+ })?;
+
+ let mut payouts = Vec::with_capacity(storage_models.len());
+ for storage_model in storage_models.into_iter() {
+ payouts.push(
+ storage_model
+ .convert(
+ self.get_keymanager_state()
+ .attach_printable("Missing KeyManagerState")?,
+ merchant_key_store.key.get_inner(),
+ Identifier::Merchant(merchant_key_store.merchant_id.clone()),
+ )
+ .await
+ .change_context(StorageError::DecryptionError)?,
+ );
+ }
+ Ok(payouts)
}
#[cfg(all(feature = "v1", feature = "olap"))]
@@ -575,6 +692,7 @@ impl<T: DatabaseStore> PayoutsInterface for crate::RouterStore<T> {
&self,
merchant_id: &common_utils::id_type::MerchantId,
filters: &PayoutFetchConstraints,
+ merchant_key_store: &MerchantKeyStore,
storage_scheme: MerchantStorageScheme,
) -> error_stack::Result<
Vec<(
@@ -634,6 +752,7 @@ impl<T: DatabaseStore> PayoutsInterface for crate::RouterStore<T> {
.find_payout_by_merchant_id_payout_id(
merchant_id,
starting_after_id,
+ merchant_key_store,
storage_scheme,
)
.await?
@@ -650,6 +769,7 @@ impl<T: DatabaseStore> PayoutsInterface for crate::RouterStore<T> {
.find_payout_by_merchant_id_payout_id(
merchant_id,
ending_before_id,
+ merchant_key_store,
storage_scheme,
)
.await?
@@ -693,38 +813,44 @@ impl<T: DatabaseStore> PayoutsInterface for crate::RouterStore<T> {
}
};
- conn.track_get_results::<<DieselPayouts as HasTable>::Table, _, (
- DieselPayouts,
- DieselPayoutAttempt,
- Option<DieselCustomer>,
- Option<DieselAddress>,
- )>(
- db_metrics::DatabaseOperation::Filter,
- query.select((
- po_all_columns,
- poa_all_columns,
- cust_all_columns.nullable(),
- addr_all_columns.nullable(),
- )),
- )
- .await
- .map(|results| {
- results
- .into_iter()
- .map(|(pi, pa, c, add)| {
- (
- Payouts::from_storage_model(pi),
- PayoutAttempt::from_storage_model(pa),
- c,
- add,
- )
- })
- .collect()
- })
- .map_err(|er| {
- error_stack::report!(StorageError::from(er))
- .attach_printable("Error filtering payout records")
- })
+ let results = conn
+ .track_get_results::<<DieselPayouts as HasTable>::Table, _, (
+ DieselPayouts,
+ DieselPayoutAttempt,
+ Option<DieselCustomer>,
+ Option<DieselAddress>,
+ )>(
+ db_metrics::DatabaseOperation::Filter,
+ query.select((
+ po_all_columns,
+ poa_all_columns,
+ cust_all_columns.nullable(),
+ addr_all_columns.nullable(),
+ )),
+ )
+ .await
+ .map_err(|er| {
+ error_stack::report!(StorageError::from(er))
+ .attach_printable("Error filtering payout records")
+ })?;
+
+ let mut payouts_and_attempts = Vec::with_capacity(results.len());
+ for (pi, pa, c, add) in results.into_iter() {
+ payouts_and_attempts.push((
+ pi.convert(
+ self.get_keymanager_state()
+ .attach_printable("Missing KeyManagerState")?,
+ merchant_key_store.key.get_inner(),
+ Identifier::Merchant(merchant_key_store.merchant_id.clone()),
+ )
+ .await
+ .change_context(StorageError::DecryptionError)?,
+ PayoutAttempt::from_storage_model(pa),
+ c,
+ add,
+ ));
+ }
+ Ok(payouts_and_attempts)
}
#[cfg(all(feature = "olap", feature = "v2"))]
@@ -733,6 +859,7 @@ impl<T: DatabaseStore> PayoutsInterface for crate::RouterStore<T> {
&self,
_merchant_id: &common_utils::id_type::MerchantId,
_filters: &PayoutFetchConstraints,
+ _merchant_key_store: &MerchantKeyStore,
_storage_scheme: MerchantStorageScheme,
) -> error_stack::Result<
Vec<(
@@ -752,11 +879,17 @@ impl<T: DatabaseStore> PayoutsInterface for crate::RouterStore<T> {
&self,
merchant_id: &common_utils::id_type::MerchantId,
time_range: &common_utils::types::TimeRange,
+ merchant_key_store: &MerchantKeyStore,
storage_scheme: MerchantStorageScheme,
) -> error_stack::Result<Vec<Payouts>, StorageError> {
let payout_filters = (*time_range).into();
- self.filter_payouts_by_constraints(merchant_id, &payout_filters, storage_scheme)
- .await
+ self.filter_payouts_by_constraints(
+ merchant_id,
+ &payout_filters,
+ merchant_key_store,
+ storage_scheme,
+ )
+ .await
}
#[cfg(feature = "olap")]
@@ -925,6 +1058,78 @@ impl<T: DatabaseStore> PayoutsInterface for crate::RouterStore<T> {
}
}
+#[async_trait::async_trait]
+impl Conversion for Payouts {
+ type DstType = DieselPayouts;
+ type NewDstType = DieselPayoutsNew;
+
+ async fn convert(self) -> CustomResult<Self::DstType, ValidationError> {
+ Ok(self.to_storage_model())
+ }
+
+ async fn convert_back(
+ state: &KeyManagerState,
+ other: Self::DstType,
+ key: &Secret<Vec<u8>>,
+ key_manager_identifier: Identifier,
+ ) -> CustomResult<Self, ValidationError> {
+ let sender_details = crypto_operation::<
+ EncryptedJsonType<api_models::sender::SenderDetails>,
+ hyperswitch_masking::WithType,
+ >(
+ state,
+ common_utils::type_name!(DieselPayouts),
+ CryptoOperation::DecryptOptional(other.sender_details.clone()),
+ key_manager_identifier,
+ key.peek(),
+ )
+ .await
+ .and_then(|val| val.try_into_optionaloperation())
+ .change_context(ValidationError::InvalidValue {
+ message: "Failed while decrypting payouts sender_details".to_string(),
+ })?;
+
+ let mut payouts = Self::from_storage_model(other);
+ payouts.sender_details = sender_details;
+ Ok(payouts)
+ }
+
+ async fn construct_new(self) -> CustomResult<Self::NewDstType, ValidationError> {
+ Ok(DieselPayoutsNew {
+ payout_id: self.payout_id,
+ merchant_id: self.merchant_id,
+ customer_id: self.customer_id,
+ address_id: self.address_id,
+ payout_type: self.payout_type,
+ payout_method_id: self.payout_method_id,
+ amount: self.amount,
+ destination_currency: self.destination_currency,
+ source_currency: self.source_currency,
+ description: self.description,
+ recurring: self.recurring,
+ auto_fulfill: self.auto_fulfill,
+ return_url: self.return_url,
+ entity_type: self.entity_type,
+ metadata: self.metadata,
+ funds_transfer_type: self.funds_transfer_type,
+ sender_details: self.sender_details.map(Encryption::from),
+ created_at: self.created_at,
+ last_modified_at: self.last_modified_at,
+ profile_id: self.profile_id,
+ status: self.status,
+ attempt_count: self.attempt_count,
+ confirm: self.confirm,
+ payout_link_id: self.payout_link_id,
+ client_secret: self.client_secret,
+ priority: self.priority,
+ organization_id: self.organization_id,
+ processor_merchant_id: self.processor_merchant_id,
+ created_by: self.created_by.map(|created_by| created_by.to_string()),
+ billing_descriptor: self.billing_descriptor,
+ })
+ }
+}
+
impl DataModelExt for Payouts {
type StorageModel = DieselPayouts;
@@ -945,6 +1150,8 @@ impl DataModelExt for Payouts {
return_url: self.return_url,
entity_type: self.entity_type,
metadata: self.metadata,
+ funds_transfer_type: self.funds_transfer_type,
+ sender_details: self.sender_details.map(Encryption::from),
created_at: self.created_at,
last_modified_at: self.last_modified_at,
profile_id: self.profile_id,
@@ -978,6 +1185,10 @@ impl DataModelExt for Payouts {
return_url: storage_model.return_url,
entity_type: storage_model.entity_type,
metadata: storage_model.metadata,
+ funds_transfer_type: storage_model.funds_transfer_type,
+ // `sender_details` holds ciphertext in storage; it is populated by the
+ // async decryption step in the `PayoutsInterface` implementations.
+ sender_details: None,
created_at: storage_model.created_at,
last_modified_at: storage_model.last_modified_at,
profile_id: storage_model.profile_id,
@@ -1016,6 +1227,8 @@ impl DataModelExt for PayoutsNew {
return_url: self.return_url,
entity_type: self.entity_type,
metadata: self.metadata,
+ funds_transfer_type: self.funds_transfer_type,
+ sender_details: self.sender_details.map(Encryption::from),
created_at: self.created_at,
last_modified_at: self.last_modified_at,
profile_id: self.profile_id,
@@ -1049,6 +1262,10 @@ impl DataModelExt for PayoutsNew {
return_url: storage_model.return_url,
entity_type: storage_model.entity_type,
metadata: storage_model.metadata,
+ funds_transfer_type: storage_model.funds_transfer_type,
+ // `sender_details` holds ciphertext in storage; it is populated by the
+ // async decryption step in the `PayoutsInterface` implementations.
+ sender_details: None,
created_at: storage_model.created_at,
last_modified_at: storage_model.last_modified_at,
profile_id: storage_model.profile_id,
@@ -1081,6 +1298,8 @@ impl DataModelExt for PayoutsUpdate {
return_url,
entity_type,
metadata,
+ funds_transfer_type,
+ sender_details,
profile_id,
status,
confirm,
@@ -1098,6 +1317,8 @@ impl DataModelExt for PayoutsUpdate {
return_url,
entity_type,
metadata,
+ funds_transfer_type,
+ sender_details,
profile_id,
status,
confirm,
diff --git a/migrations/2026-11-03-000000_add_funds_transfer_type_to_payouts/down.sql b/migrations/2026-11-03-000000_add_funds_transfer_type_to_payouts/down.sql
new file mode 100644
index 0000000000..83787e2db9
--- /dev/null
+++ b/migrations/2026-11-03-000000_add_funds_transfer_type_to_payouts/down.sql
@@ -0,0 +1,2 @@
+ALTER TABLE payouts
+DROP COLUMN IF EXISTS funds_transfer_type;
diff --git a/migrations/2026-11-03-000000_add_funds_transfer_type_to_payouts/up.sql b/migrations/2026-11-03-000000_add_funds_transfer_type_to_payouts/up.sql
new file mode 100644
index 0000000000..61b8b2c9e8
--- /dev/null
+++ b/migrations/2026-11-03-000000_add_funds_transfer_type_to_payouts/up.sql
@@ -0,0 +1,2 @@
+ALTER TABLE payouts
+ADD COLUMN IF NOT EXISTS funds_transfer_type VARCHAR(64) DEFAULT NULL;
diff --git a/migrations/2026-11-04-000000_add_sender_details_to_payouts/down.sql b/migrations/2026-11-04-000000_add_sender_details_to_payouts/down.sql
new file mode 100644
index 0000000000..3cdaa26409
--- /dev/null
+++ b/migrations/2026-11-04-000000_add_sender_details_to_payouts/down.sql
@@ -0,0 +1 @@
+ALTER TABLE payouts DROP COLUMN IF EXISTS sender_details;
diff --git a/migrations/2026-11-04-000000_add_sender_details_to_payouts/up.sql b/migrations/2026-11-04-000000_add_sender_details_to_payouts/up.sql
new file mode 100644
index 0000000000..466c6ef0d6
--- /dev/null
+++ b/migrations/2026-11-04-000000_add_sender_details_to_payouts/up.sql
@@ -0,0 +1 @@
+ALTER TABLE payouts ADD COLUMN IF NOT EXISTS sender_details BYTEA DEFAULT NULL;