-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathplayment-service.yaml
87 lines (85 loc) · 1.91 KB
/
playment-service.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
swagger: '2.0'
info:
title: Payment Service API
description: API for processing payments via credit card
version: '1.0.0'
host: 'paymentservice.example.com'
schemes:
- https
basePath: '/api'
produces:
- application/json
paths:
/payment:
post:
summary: Process a payment
description: Processes a payment using credit card information, returning a transaction ID and status.
consumes:
- application/json
parameters:
- in: body
name: paymentRequest
description: Payment request object
required: true
schema:
$ref: '#/definitions/PaymentRequest'
responses:
200:
description: Payment processed successfully
schema:
$ref: '#/definitions/PaymentResponse'
400:
description: Invalid request provided
schema:
$ref: '#/definitions/ErrorResponse'
500:
description: Internal server error
schema:
$ref: '#/definitions/ErrorResponse'
definitions:
PaymentRequest:
type: object
required:
- cardNumber
- expiryMonth
- expiryYear
- cvv
- amount
properties:
cardNumber:
type: string
example: '4111111111111111'
expiryMonth:
type: string
example: '12'
expiryYear:
type: string
example: '2023'
cvv:
type: string
example: '123'
amount:
type: number
format: double
example: 100.00
PaymentResponse:
type: object
properties:
transactionId:
type: string
example: 'tx_123456789'
status:
type: string
example: 'approved'
enum:
- approved
- declined
- error
ErrorResponse:
type: object
properties:
code:
type: integer
format: int32
message:
type: string