-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathYAML
152 lines (149 loc) · 4.31 KB
/
YAML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
openapi: 3.0.0
info:
title: Movie Ticket Payment API
version: 1.0.0
description: API for processing payments during online movie ticket purchases. It includes endpoints for getting payment details, processing payments, and deleting payment records.
paths:
/payments:
get:
summary: Retrieve payment details
parameters:
- in: query
name: transactionId
required: true
schema:
type: string
example: 'txn_1234567890'
responses:
'200':
description: Payment details retrieved successfully
content:
application/json:
schema:
type: object
properties:
transactionId:
type: string
example: 'txn_1234567890'
amount:
type: number
example: 29.99
status:
type: string
example: 'success'
'404':
description: Payment not found
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: 'Payment not found'
'500':
description: Server error
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: 'Internal server error'
post:
summary: Process payment for movie tickets
requestBody:
description: Payment information
required: true
content:
application/json:
schema:
type: object
properties:
creditCardNumber:
type: string
example: '4111111111111111'
expirationDate:
type: string
example: '12/25'
cvv:
type: string
example: '123'
amount:
type: number
example: 29.99
responses:
'200':
description: Payment successfully processed
content:
application/json:
schema:
type: object
properties:
transactionId:
type: string
example: 'txn_1234567890'
status:
type: string
example: 'success'
'400':
description: Invalid payment information
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: 'Invalid credit card number'
'500':
description: Server error
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: 'Internal server error'
delete:
summary: Delete payment record
parameters:
- in: query
name: transactionId
required: true
schema:
type: string
example: 'txn_1234567890'
responses:
'200':
description: Payment record deleted successfully
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: 'Payment record deleted'
'404':
description: Payment not found
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: 'Payment not found'
'500':
description: Server error
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: 'Internal server error'