Skip to content

Commit

Permalink
feat(core): Add payments update-intent API for v2
Browse files Browse the repository at this point in the history
  • Loading branch information
AnuthaDev committed Nov 6, 2024
1 parent 62c4479 commit 5465965
Show file tree
Hide file tree
Showing 20 changed files with 1,321 additions and 273 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
openapi: post /v2/payments/{id}/update-intent
---
1 change: 1 addition & 0 deletions api-reference-v2/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"pages": [
"api-reference/payments/payments--create-intent",
"api-reference/payments/payments--get-intent",
"api-reference/payments/payments--update-intent",
"api-reference/payments/payments--session-token",
"api-reference/payments/payments--confirm-intent"
]
Expand Down
255 changes: 255 additions & 0 deletions api-reference-v2/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -1900,6 +1900,67 @@
]
}
},
"/v2/payments/{id}/update-intent": {
"post": {
"tags": [
"Payments"
],
"summary": "Payments - Update Intent",
"description": "**Update a payment intent object**\n\nYou will require the 'API - Key' from the Hyperswitch dashboard to make the call.",
"operationId": "Update a Payment Intent",
"parameters": [
{
"name": "id",
"in": "path",
"description": "The unique identifier for the Payment Intent",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PaymentsUpdateIntentRequest"
},
"examples": {
"Update a payment intent with minimal fields": {
"value": {
"amount_details": {
"currency": "USD",
"order_amount": 6540
}
}
}
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Payment Intent Updated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PaymentsIntentResponse"
}
}
}
},
"404": {
"description": "Payment Intent Not Found"
}
},
"security": [
{
"api_key": []
}
]
}
},
"/v2/payments/{id}/confirm-intent": {
"post": {
"tags": [
Expand Down Expand Up @@ -15081,6 +15142,200 @@
}
}
},
"PaymentsUpdateIntentRequest": {
"type": "object",
"properties": {
"amount_details": {
"allOf": [
{
"$ref": "#/components/schemas/AmountDetails"
}
],
"nullable": true
},
"merchant_reference_id": {
"type": "string",
"description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant.",
"example": "pay_mbabizu24mvu3mela5njyhpit4",
"nullable": true,
"maxLength": 30,
"minLength": 30
},
"routing_algorithm_id": {
"type": "string",
"description": "The routing algorithm id to be used for the payment",
"nullable": true
},
"capture_method": {
"allOf": [
{
"$ref": "#/components/schemas/CaptureMethod"
}
],
"nullable": true
},
"authentication_type": {
"allOf": [
{
"$ref": "#/components/schemas/AuthenticationType"
}
],
"default": "no_three_ds",
"nullable": true
},
"billing": {
"allOf": [
{
"$ref": "#/components/schemas/Address"
}
],
"nullable": true
},
"shipping": {
"allOf": [
{
"$ref": "#/components/schemas/Address"
}
],
"nullable": true
},
"customer_id": {
"type": "string",
"description": "The identifier for the customer",
"example": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
"nullable": true,
"maxLength": 64,
"minLength": 1
},
"customer_present": {
"allOf": [
{
"$ref": "#/components/schemas/PresenceOfCustomerDuringPayment"
}
],
"nullable": true
},
"description": {
"type": "string",
"description": "A description for the payment",
"example": "It's my first payment request",
"nullable": true
},
"return_url": {
"type": "string",
"description": "The URL to which you want the user to be redirected after the completion of the payment operation",
"example": "https://hyperswitch.io",
"nullable": true
},
"setup_future_usage": {
"allOf": [
{
"$ref": "#/components/schemas/FutureUsage"
}
],
"nullable": true
},
"apply_mit_exemption": {
"allOf": [
{
"$ref": "#/components/schemas/MitExemptionRequest"
}
],
"nullable": true
},
"statement_descriptor": {
"type": "string",
"description": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.",
"example": "Hyperswitch Router",
"nullable": true,
"maxLength": 22
},
"order_details": {
"type": "array",
"items": {
"$ref": "#/components/schemas/OrderDetailsWithAmount"
},
"description": "Use this object to capture the details about the different products for which the payment is being made. The sum of amount across different products here should be equal to the overall payment amount",
"example": "[{\n \"product_name\": \"Apple iPhone 16\",\n \"quantity\": 1,\n \"amount\" : 69000\n \"product_img_link\" : \"https://dummy-img-link.com\"\n }]",
"nullable": true
},
"allowed_payment_method_types": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PaymentMethodType"
},
"description": "Use this parameter to restrict the Payment Method Types to show for a given PaymentIntent",
"nullable": true
},
"metadata": {
"type": "object",
"description": "Metadata is useful for storing additional, unstructured information on an object.",
"nullable": true
},
"connector_metadata": {
"allOf": [
{
"$ref": "#/components/schemas/ConnectorMetadata"
}
],
"nullable": true
},
"feature_metadata": {
"allOf": [
{
"$ref": "#/components/schemas/FeatureMetadata"
}
],
"nullable": true
},
"payment_link_enabled": {
"allOf": [
{
"$ref": "#/components/schemas/EnablePaymentLinkRequest"
}
],
"nullable": true
},
"payment_link_config": {
"allOf": [
{
"$ref": "#/components/schemas/PaymentLinkConfigRequest"
}
],
"nullable": true
},
"request_incremental_authorization": {
"allOf": [
{
"$ref": "#/components/schemas/RequestIncrementalAuthorization"
}
],
"nullable": true
},
"session_expiry": {
"type": "integer",
"format": "int32",
"description": "Will be used to expire client secret after certain amount of time to be supplied in seconds, if not sent it will be taken from profile config\n(900) for 15 mins",
"example": 900,
"nullable": true,
"minimum": 0
},
"frm_metadata": {
"type": "object",
"description": "Additional data related to some frm(Fraud Risk Management) connectors",
"nullable": true
},
"request_external_three_ds_authentication": {
"allOf": [
{
"$ref": "#/components/schemas/External3dsAuthenticationRequest"
}
],
"nullable": true
}
},
"additionalProperties": false
},
"PayoutActionRequest": {
"type": "object"
},
Expand Down
Loading

0 comments on commit 5465965

Please sign in to comment.