Skip to content

Instantly share code, notes, and snippets.

@poojarsn
Last active October 9, 2024 03:18
Show Gist options
  • Select an option

  • Save poojarsn/f6a86cbbabf1131b4502a9fc1411d5f2 to your computer and use it in GitHub Desktop.

Select an option

Save poojarsn/f6a86cbbabf1131b4502a9fc1411d5f2 to your computer and use it in GitHub Desktop.
Sample
{
"openapi": "3.0.1",
"info": {
"title": "Payment Experience API",
"description": "This API is meant to be used as a starting point for any new Experience APIs",
"contact": {
"name": "Thunder Team",
"email": "Thunder@bupaau.onmicrosoft.com"
},
"version": "1.0"
},
"paths": {
"/isAlive": {
"get": {
"tags": [
"Experience.Api.Payment, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
],
"parameters": [
{
"name": "X-Correlation-Request",
"in": "header",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"type": "string"
}
}
}
}
}
}
},
"/api/v1/Payment/captureKey": {
"get": {
"tags": [
"Payment"
],
"summary": "Get Capture Key",
"operationId": "Get Capture Key",
"parameters": [
{
"name": "X-Correlation-Request",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "X-Correlation-Session",
"in": "header",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/CaptureResponse"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/CaptureResponse"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/CaptureResponse"
}
}
}
}
}
}
},
"/api/v1/Payment/setup": {
"post": {
"tags": [
"Payment"
],
"summary": "Setup Payment",
"operationId": "Setup Payment",
"parameters": [
{
"name": "X-Correlation-Request",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "X-Correlation-Session",
"in": "header",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/SetupPaymentResponse"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/SetupPaymentResponse"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/SetupPaymentResponse"
}
}
}
}
}
}
},
"/api/v1/Payment/setup/{paymentMethodId}": {
"post": {
"tags": [
"Payment"
],
"summary": "Setup Payment by PaymentMethodId",
"operationId": "Setup Payment By PaymentMethodId",
"parameters": [
{
"name": "paymentMethodId",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "X-Forwarded-For",
"in": "header",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "X-Client-Agent",
"in": "header",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "returnUrl",
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "X-Correlation-Request",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "X-Correlation-Session",
"in": "header",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/SetupPaymentByPaymentMethodIdResponse"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/SetupPaymentByPaymentMethodIdResponse"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/SetupPaymentByPaymentMethodIdResponse"
}
}
}
}
}
}
},
"/api/v1/Payment/singlepayment/{membershipId}/{personId}": {
"post": {
"tags": [
"Payment"
],
"summary": "ProcessSinglePayment",
"operationId": "Process Single Payment",
"parameters": [
{
"name": "membershipId",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"name": "personId",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"name": "X-Correlation-Request",
"in": "header",
"schema": {
"type": "string"
}
},
{
"name": "X-Correlation-Session",
"in": "header",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SinglePaymentRequest"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/SinglePaymentRequest"
}
},
"application/*+json": {
"schema": {
"$ref": "#/components/schemas/SinglePaymentRequest"
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/SinglePaymentResponse"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/SinglePaymentResponse"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/SinglePaymentResponse"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"CaptureResponse": {
"type": "object",
"properties": {
"captureKey": {
"type": "string",
"nullable": true
}
},
"additionalProperties": false
},
"CardBrand": {
"enum": [
"_0",
"_1",
"_2",
"_3"
],
"type": "string"
},
"PaymentCardInfo": {
"type": "object",
"properties": {
"brand": {
"$ref": "#/components/schemas/CardBrand"
},
"last4": {
"type": "string",
"nullable": true
},
"expiryMonth": {
"type": "integer",
"format": "int32"
},
"expiryYear": {
"type": "integer",
"format": "int32"
}
},
"additionalProperties": false
},
"SetupPaymentByPaymentMethodIdResponse": {
"type": "object",
"properties": {
"secret": {
"type": "string",
"nullable": true
}
},
"additionalProperties": false
},
"SetupPaymentResponse": {
"type": "object",
"properties": {
"clientSecret": {
"type": "string",
"nullable": true
}
},
"additionalProperties": false
},
"SinglePaymentRequest": {
"type": "object",
"properties": {
"paymentDate": {
"type": "string",
"format": "date-time"
},
"organisationId": {
"type": "integer",
"format": "int32",
"nullable": true
},
"paymentAmount": {
"type": "number",
"format": "double"
},
"paymentMethodId": {
"type": "string",
"nullable": true
}
},
"additionalProperties": false
},
"SinglePaymentResponse": {
"type": "object",
"properties": {
"receiptId": {
"type": "integer",
"format": "int32"
},
"transactionId": {
"type": "integer",
"format": "int64"
},
"transactionStatus": {
"type": "string",
"nullable": true
},
"receiptStatus": {
"type": "string",
"nullable": true
},
"rejectionReason": {
"type": "string",
"nullable": true
},
"paymentCard": {
"$ref": "#/components/schemas/PaymentCardInfo"
}
},
"additionalProperties": false
}
},
"securitySchemes": {
"OAuth": {
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
}
},
"security": [
{
"OAuth": [ ]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment