feat(router): Add payment_methods_session_delete_payment_method endpoint [V2] (#7409)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Anurag Thakur
2025-03-27 16:49:36 +05:30
committed by GitHub
parent e9433d98e1
commit 652fae4fe9
11 changed files with 214 additions and 10 deletions

View File

@ -0,0 +1,3 @@
---
openapi: delete /v2/payment-method-session/:id
---

View File

@ -67,7 +67,8 @@
"api-reference/payment-method-session/payment-method-session--retrieve",
"api-reference/payment-method-session/payment-method-session--list-payment-methods",
"api-reference/payment-method-session/payment-method-session--update-a-saved-payment-method",
"api-reference/payment-method-session/payment-method-session--confirm-a-payment-method-session"
"api-reference/payment-method-session/payment-method-session--confirm-a-payment-method-session",
"api-reference/payment-method-session/payment-method-session--delete-a-saved-payment-method"
]
},
{

View File

@ -2960,6 +2960,62 @@
"ephemeral_key": []
}
]
},
"delete": {
"tags": [
"Payment Method Session"
],
"summary": "Payment Method Session - Delete a saved payment method",
"description": "Delete a saved payment method from the given payment method session.",
"operationId": "Delete a saved payment method",
"parameters": [
{
"name": "id",
"in": "path",
"description": "The unique identifier for the Payment Method Session",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PaymentMethodSessionDeleteSavedPaymentMethod"
},
"examples": {
"Update the card holder name": {
"value": {
"payment_method_id": "12345_pm_0194b1ecabc172e28aeb71f70a4daba3"
}
}
}
}
},
"required": true
},
"responses": {
"200": {
"description": "The payment method has been updated successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PaymentMethodDeleteResponse"
}
}
}
},
"404": {
"description": "The request is invalid"
}
},
"security": [
{
"ephemeral_key": []
}
]
}
},
"/v2/payment-method-session/:id/list-payment-methods": {
@ -4462,15 +4518,19 @@
"AuthenticationDetails": {
"type": "object",
"required": [
"status",
"error"
"status"
],
"properties": {
"status": {
"$ref": "#/components/schemas/IntentStatus"
},
"error": {
"$ref": "#/components/schemas/ErrorDetails"
"allOf": [
{
"$ref": "#/components/schemas/ErrorDetails"
}
],
"nullable": true
}
}
},
@ -15633,6 +15693,19 @@
}
}
},
"PaymentMethodSessionDeleteSavedPaymentMethod": {
"type": "object",
"required": [
"payment_method_id"
],
"properties": {
"payment_method_id": {
"type": "string",
"description": "The payment method id of the payment method to be updated",
"example": "12345_pm_01926c58bc6e77c09e809964e72af8c8"
}
}
},
"PaymentMethodSessionRequest": {
"type": "object",
"required": [