-
Notifications
You must be signed in to change notification settings - Fork 1
/
socket.yml
396 lines (396 loc) · 12.3 KB
/
socket.yml
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
name: paypal-subscription-payment
description: Socket for creating sunscription payments with paypal
version: 0.0.2
runtime: nodejs_v8
keywords:
- paypal
- subscription
endpoints:
billing-plans:
description: 'Create, get, list and update actions for paypal billing plan.'
long_description: >
This comprises of four actions for `billing-plans` resource. Make sure to
use the request methods `POST` for creating billing plans, `PATCH` for
updating billing plans and `GET` for showing single billing plan details
by ID and listing billing plans that were created. Kindly refer to
https://developer.paypal.com/docs/api/payments.billing-plans for more
details.
inputs:
properties:
create_billing_plan_details:
type: object
description: Detail parameters for creating a billing plan
examples:
- |
{
"description": "Create Plan for Regular",
"type": "INFINITE"
"merchant_preferences": {
"auto_bill_amount": "yes",
"cancel_url": "http://www.cancel.com",
"initial_fail_amount_action": "continue",
"max_fail_attempts": "1",
"return_url": "http://www.success.com",
"setup_fee": {
"currency": "USD",
"value": "25"
}
},
"name": "Testing1-Regular1",
"payment_definitions": [
{
....
}
]
}
update_billing_plan_details:
type: array
description: >-
An array of JSON patch objects to apply partial updates to billing
plan
examples:
- |
[
{
"op": "replace",
"path": "/merchant-preferences",
"value": {
"cancel_url": "https://example.com/cancel",
"setup_fee": {
"value": "5",
"currency": "USD"
}
}
}
]
billing_plan_id:
type: string
description: The ID of the billing plan to update or retrieve.
long_description: >
Note that this is required for get and update and shouldn't be
passed for create or list billing plans.
examples:
- P-3FV74344GJ503923KW
page:
type: string
description: >-
Zero-indexed number of the first page that begins the set of pages
that are returned (List billing plans)
status:
type: string
description: >-
Filters the plans in the response by a plan status (List billing
plans)
examples:
- INACTIVE/CREATED/ACTIVE
page_size:
type: string
description: Number of plans to list on a single page (List billing plans)
examples:
- 10
total_required:
type: string
description: >-
Indicates whether the response includes the total_items and
total_pages fields (List billing plans)
examples:
- 'yes'
outputs:
success:
exit_code: 200
description: Success
examples:
- |
{
"id": "P-7DC96732KA7763723UOPKETA",
"state": "CREATED",
"name": "Plan with Regular and Trial Payment Definitions",
"description": "Plan with regular and trial payment definitions.",
"type": "FIXED",
"payment_definitions": [ ]
...
}
fail:
exit_code: 400
description: Failed
examples:
- |
{
"name": "VALIDATION_ERROR",
"details": [ ... ],
"message": "Invalid request. See details.",
"information_link": "https://developer.paypal.com/docs/api/payments.billing-plans#errors",
"httpStatusCode": 400
}
billing-plans-activate:
description: >-
Endpoint that activates a billing plan so that it can be used to form
billing agreements with users
inputs:
properties:
billing_plan_id:
type: string
description: The ID of the billing plan.
examples:
- P-3FV74344GJ503923KW
outputs:
success:
exit_code: 200
description: Success
examples:
- 200 OK
billing-agreements:
description: 'Create, get, list and update actions for paypal billing agreement.'
long_description: >
This comprises of three actions for `billing-agreements` resource. Make
sure to use the request methods `POST` for creating billing agreements,
`PATCH` for updating billing agreement and `GET` for showing single
billing agreement details by ID. Kindly refer to
https://developer.paypal.com/docs/api/payments.billing-agreements for more
details.
inputs:
properties:
create_billing_agreement_details:
type: object
description: Parameters for creating a billing agreement
examples:
- |
{
"name": "Fast Speed Agreement",
"description": "Agreement for Fast Speed Plan",
"start_date": isoDate,
"plan": {
"id": "P-0NJ10521L3680291SOAQIVTQ"
},
"payer": {
"payment_method": "paypal"
},
"shipping_address": {
"line1": "StayBr111idge Suites",
"line2": "Cro12ok Street",
"city": "San Jose",
"state": "CA",
"postal_code": "95112",
"country_code": "US"
}
}
update_billing_agreement_details:
type: array
description: >-
An array of JSON patch objects to apply partial updates to billing
agreement
examples:
- |
[
{
"op": "replace",
"path": "/merchant-preferences",
"value": {
"description": "Newer Description",
"name": "New Name",
"shipping_address": {
"line1": "StayBr111idge Suites",
"line2": "Cro12ok Street",
"city": "San Jose",
"state": "CA",
"postal_code": "95112",
"country_code": "US"
}
}
}
]
billing_agreement_id:
type: string
description: The ID of a billing agreement.
examples:
- P-3FV74344GJ503923KW
payment_id:
type: string
description: The ID of the payment to execute.
payer_id:
type: string
description: The ID of the payer that PayPal passes in the return_url.
examples:
- 22393D847794YKER7MUI
transactions:
type: array
description: >-
An array of transaction details. For execute the transactions object
accepts only the amount object.
examples:
- |
[
{
"amount": {
"currency": "USD",
"total": "1.00"
}
}
]
billing-agreements-bill-balance:
description: Endpoint that bills an outstanding balance of an agreement.
inputs:
properties:
billing_agreement_id:
type: string
description: The ID of a billing agreement.
examples:
- I-1TJ3GAGG82Y9
note:
type: string
description: Optional note that describes the agreement state change.
examples:
- Billing balance amount
amount:
type: object
description: Billing agreement amounta and currency
examples:
- |
{
"value": "10",
"currency": "USD"
}
outputs:
success:
exit_code: 204
description: Success
examples:
- 204 No Content
billing-agreements-cancel:
description: Endpoint to cancel a billing agreement.
inputs:
properties:
billing_agreement_id:
type: string
description: The ID of a billing agreement.
examples:
- I-1TJ3GAGG82Y9
note:
type: string
description: Optional note that describes the reason for the cancellation.
examples:
- Canceling agreement
outputs:
success:
exit_code: 204
description: Success
examples:
- 204 No Content
billing-agreements-re-activate:
description: Endpoint to re-activate a suspended billing agreement
inputs:
properties:
billing_agreement_id:
type: string
description: The ID of a billing agreement.
examples:
- P-3FV74344GJ503923KW
note:
type: string
description: Optional note that describes the reason for the re-activation
examples:
- Re-activating agreement
outputs:
success:
exit_code: 204
description: Success
examples:
- 204 No Content
billing-agreements-set-balance:
description: Endpoint that sets the balance for an agreement
inputs:
properties:
billing_agreement_id:
type: string
description: The ID of a billing agreement.
examples:
- P-3FV74344GJ503923KW
amount:
type: object
description: Billing agreement amount and currency
examples:
- |
{
"value": "100",
"currency": "USD"
}
outputs:
success:
exit_code: 204
description: Success
examples:
- 204 No Content
billing-agreements-suspend:
description: Endpoint that suspends a billing agreement
inputs:
properties:
billing_agreement_id:
type: string
description: The ID of a billing agreement.
examples:
- P-3FV74344GJ503923KW
note:
type: string
description: Optional note that describes the reason for the state change
examples:
- Suspending the agreement
outputs:
success:
exit_code: 204
description: Success
examples:
- 204 No Content
billing-agreements-transactions:
description: Endpoint to list transactions for an agreement
inputs:
properties:
billing_agreement_id:
type: string
description: The ID of a billing agreement.
examples:
- P-3FV74344GJ503923KW
start_date:
type: string
description: The start date of the range of transactions to list
end_date:
type: string
description: The end date of the range of transactions to list
outputs:
success:
exit_code: 200
description: Success
examples:
- |
{
"agreement_transaction_list": [
{
"transaction_id": "I-V8SSE9WLJGY6",
"status": "Completed",
....
}
...
]
}
billing-agreements-execute:
description: Endpoint that executes a billing agreement
inputs:
properties:
payment_token:
type: string
description: >-
Payment Token of format EC-XXXXXX, appended to return url as a
parameter after buyer approves agreement
examples:
- EC-2V0782854X675410W
outputs:
success:
exit_code: 200
description: Success
examples:
- |
{
"id": "I-1TJ3GAGG82Y9",
"state": "Active",
"description": "Monthly agreement with free trial payment definition.",
...
}