Skip to content

Commit

Permalink
feat(router): [Xendit] add support for split payments (#7143)
Browse files Browse the repository at this point in the history
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
  • Loading branch information
AkshayaFoiger and hyperswitch-bot[bot] authored Feb 20, 2025
1 parent e475f63 commit 451acba
Show file tree
Hide file tree
Showing 24 changed files with 1,142 additions and 32 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

207 changes: 207 additions & 0 deletions api-reference-v2/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -7392,6 +7392,17 @@
"$ref": "#/components/schemas/AdyenSplitData"
}
}
},
{
"type": "object",
"required": [
"xendit_split_payment"
],
"properties": {
"xendit_split_payment": {
"$ref": "#/components/schemas/XenditChargeResponseData"
}
}
}
],
"description": "Charge Information"
Expand Down Expand Up @@ -20924,6 +20935,17 @@
"$ref": "#/components/schemas/AdyenSplitData"
}
}
},
{
"type": "object",
"required": [
"xendit_split_payment"
],
"properties": {
"xendit_split_payment": {
"$ref": "#/components/schemas/XenditSplitRequest"
}
}
}
],
"description": "Fee information for Split Payments to be charged on the payment being collected"
Expand Down Expand Up @@ -20951,6 +20973,17 @@
"$ref": "#/components/schemas/AdyenSplitData"
}
}
},
{
"type": "object",
"required": [
"xendit_split_refund"
],
"properties": {
"xendit_split_refund": {
"$ref": "#/components/schemas/XenditSplitSubMerchantData"
}
}
}
],
"description": "Charge specific fields for controlling the revert of funds from either platform or connected account. Check sub-fields for more details."
Expand Down Expand Up @@ -22436,6 +22469,180 @@
}
},
"additionalProperties": false
},
"XenditChargeResponseData": {
"oneOf": [
{
"type": "object",
"required": [
"multiple_splits"
],
"properties": {
"multiple_splits": {
"$ref": "#/components/schemas/XenditMultipleSplitResponse"
}
}
},
{
"type": "object",
"required": [
"single_split"
],
"properties": {
"single_split": {
"$ref": "#/components/schemas/XenditSplitSubMerchantData"
}
}
}
],
"description": "Charge Information"
},
"XenditMultipleSplitRequest": {
"type": "object",
"description": "Fee information to be charged on the payment being collected via xendit",
"required": [
"name",
"description",
"routes"
],
"properties": {
"name": {
"type": "string",
"description": "Name to identify split rule. Not required to be unique. Typically based on transaction and/or sub-merchant types."
},
"description": {
"type": "string",
"description": "Description to identify fee rule"
},
"for_user_id": {
"type": "string",
"description": "The sub-account user-id that you want to make this transaction for.",
"nullable": true
},
"routes": {
"type": "array",
"items": {
"$ref": "#/components/schemas/XenditSplitRoute"
},
"description": "Array of objects that define how the platform wants to route the fees and to which accounts."
}
},
"additionalProperties": false
},
"XenditMultipleSplitResponse": {
"type": "object",
"description": "Fee information charged on the payment being collected via xendit",
"required": [
"split_rule_id",
"name",
"description",
"routes"
],
"properties": {
"split_rule_id": {
"type": "string",
"description": "Identifier for split rule created for the payment"
},
"for_user_id": {
"type": "string",
"description": "The sub-account user-id that you want to make this transaction for.",
"nullable": true
},
"name": {
"type": "string",
"description": "Name to identify split rule. Not required to be unique. Typically based on transaction and/or sub-merchant types."
},
"description": {
"type": "string",
"description": "Description to identify fee rule"
},
"routes": {
"type": "array",
"items": {
"$ref": "#/components/schemas/XenditSplitRoute"
},
"description": "Array of objects that define how the platform wants to route the fees and to which accounts."
}
},
"additionalProperties": false
},
"XenditSplitRequest": {
"oneOf": [
{
"type": "object",
"required": [
"multiple_splits"
],
"properties": {
"multiple_splits": {
"$ref": "#/components/schemas/XenditMultipleSplitRequest"
}
}
},
{
"type": "object",
"required": [
"single_split"
],
"properties": {
"single_split": {
"$ref": "#/components/schemas/XenditSplitSubMerchantData"
}
}
}
],
"description": "Xendit Charge Request"
},
"XenditSplitRoute": {
"type": "object",
"description": "Fee information to be charged on the payment being collected via xendit",
"required": [
"currency",
"destination_account_id",
"reference_id"
],
"properties": {
"flat_amount": {
"allOf": [
{
"$ref": "#/components/schemas/MinorUnit"
}
],
"nullable": true
},
"percent_amount": {
"type": "integer",
"format": "int64",
"description": "Amount of payments to be split, using a percent rate as unit",
"nullable": true
},
"currency": {
"$ref": "#/components/schemas/Currency"
},
"destination_account_id": {
"type": "string",
"description": "ID of the destination account where the amount will be routed to"
},
"reference_id": {
"type": "string",
"description": "Reference ID which acts as an identifier of the route itself"
}
},
"additionalProperties": false
},
"XenditSplitSubMerchantData": {
"type": "object",
"description": "Fee information to be charged on the payment being collected for sub-merchant via xendit",
"required": [
"for_user_id"
],
"properties": {
"for_user_id": {
"type": "string",
"description": "The sub-account user-id that you want to make this transaction for."
}
},
"additionalProperties": false
}
},
"securitySchemes": {
Expand Down
Loading

0 comments on commit 451acba

Please sign in to comment.