Process Payment

v0.0.1
commandsjson iconJSON Schema

Command to process a payment through the payment gateway

View docs
1{
2  "$schema": "http://json-schema.org/draft-07/schema#",
3  "type": "object",
4  "properties": {
5    "paymentId": {
6      "type": "string",
7      "description": "Unique identifier for this payment"
8    },
9    "amount": {
10      "type": "number",
11      "description": "Payment amount"
12    },
13    "currency": {
14      "type": "string",
15      "description": "Currency code (ISO 4217)"
16    },
17    "paymentMethod": {
18      "type": "object",
19      "properties": {
20        "type": {
21          "type": "string",
22          "enum": ["card", "bank_transfer", "paypal", "digital_wallet"]
23        },
24        "token": {
25          "type": "string",
26          "description": "Payment method token"
27        }
28      },
29      "required": ["type", "token"]
30    },
31    "metadata": {
32      "type": "object",
33      "properties": {
34        "subscriptionId": {
35          "type": "string"
36        },
37        "invoiceId": {
38          "type": "string"
39        },
40        "customerId": {
41          "type": "string"
42        },
43        "orderId": {
44          "type": "string"
45        }
46      }
47    },
48    "idempotencyKey": {
49      "type": "string",
50      "description": "Key to prevent duplicate payments"
51    },
52    "captureImmediately": {
53      "type": "boolean",
54      "description": "Whether to capture payment immediately or just authorize"
55    }
56  },
57  "required": ["paymentId", "amount", "currency", "paymentMethod", "idempotencyKey"]
58}