-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsocket.yml
147 lines (146 loc) · 13 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
name: paypal
description: Socket for PayPal
version: 0.0.2
url: https://github.com/Flixow/syncano-socket-paypal.git
endpoints:
payment_create_with_paypal:
description: Create payment with paypal
file: scripts/payment_create_with_paypal.js
parameters:
paymentJsonData:
type: string
description: "Payment data in JSON format"
example: '{ "intent": "sale", "payer": { "payment_method": "paypal" }, "redirect_urls": { "return_url": "https://api.syncano.rocks/v2/instances/syncano-sockets/endpoints/sockets/paypal/payment_execute/", "cancel_url": "http://cancel.url" }, "transactions": [{ "item_list": { "items": [{ "name": "item1", "sku": "item", "price": "1.00", "currency": "USD", "quantity": 1 }] }, "amount": { "currency": "USD", "total": "1.00" }, "description": "This is the payment description." }] }'
response:
mimetype: application/json
examples:
-
exit_code: 201
description: Success
example: "{ id: 'PAY-7PB74678F47120112LC2Z4NI', intent: 'sale', state: 'created', payer: { payment_method: 'paypal' }, transactions: [ { amount: { total: '1.00', currency: 'USD' }, description: 'This is the payment description.', item_list: { items: [ { name: 'item1', sku: 'item', price: '1.00', currency: 'USD', quantity: 1 } ] }, related_resources: [] } ], create_time: '2017-02-28T15:58:45Z', links: [ { href: 'https://api.sandbox.paypal.com/v1/payments/payment/PAY-7PB74678F47120112LC2Z4NI', rel: 'self', method: 'GET' }, { href: 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-7T094805F4644894L', rel: 'approval_url', method: 'REDIRECT' }, { href: 'https://api.sandbox.paypal.com/v1/payments/payment/PAY-7PB74678F47120112LC2Z4NI/execute', rel: 'execute', method: 'POST' } ], httpStatusCode: 201 }"
-
exit_code: 404
description: Failed
example: "{ response: { name: 'INVALID_RESOURCE_ID', message: 'Requested resource ID was not found.', information_link: 'https://developer.paypal.com/webapps/developer/docs/api/#INVALID_RESOURCE_ID', debug_id: 'e72115d78f2fb', httpStatusCode: 404 }, httpStatusCode: 404 }"
payment_create_with_credit_card:
description: Create payment with credit card
file: scripts/payment_create_with_credit_card.js
parameters:
paymentJsonData:
type: string
description: "Payment data in JSON format"
example: '{ "intent": "sale", "payer": { "payment_method": "credit_card", "funding_instruments": [{ "credit_card": { "type": "visa", "number": "4063332575284750", "expire_month": "03", "expire_year": "2022", "cvv2": "874", "first_name": "Joe", "last_name": "Shopper", "billing_address": { "line1": "52 N Main ST", "city": "Johnstown", "state": "OH", "postal_code": "43210", "country_code": "US" } } }] }, "transactions": [{ "amount": { "total": "7", "currency": "USD", "details": { "subtotal": "5", "tax": "1", "shipping": "1" } }, "description": "This is the payment transaction description." }] }'
response:
mimetype: application/json
examples:
-
exit_code: 201
description: Success
example: '{"id":"PAY-09192451S05232245LC3KINY","create_time":"2017-03-01T10:36:39Z","update_time":"2017-03-01T10:36:43Z","state":"approved","intent":"sale","payer":{"payment_method":"credit_card","funding_instruments":[{"credit_card":{"type":"visa","number":"xxxxxxxxxxxx4750","expire_month":"3","expire_year":"2022","first_name":"Joe","last_name":"Shopper","billing_address":{"line1":"52 N Main ST","city":"Johnstown","state":"OH","postal_code":"43210","country_code":"US"}}}]},"transactions":[{"amount":{"total":"7.00","currency":"USD","details":{"subtotal":"5.00","tax":"1.00","shipping":"1.00"}},"description":"This is the payment transaction description.","related_resources":[{"sale":{"id":"76P51092VV1345602","create_time":"2017-03-01T10:36:39Z","update_time":"2017-03-01T10:36:43Z","amount":{"total":"7.00","currency":"USD"},"state":"completed","parent_payment":"PAY-09192451S05232245LC3KINY","links":[{"href":"https://api.sandbox.paypal.com/v1/payments/sale/76P51092VV1345602","rel":"self","method":"GET"},{"href":"https://api.sandbox.paypal.com/v1/payments/sale/76P51092VV1345602/refund","rel":"refund","method":"POST"},{"href":"https://api.sandbox.paypal.com/v1/payments/payment/PAY-09192451S05232245LC3KINY","rel":"parent_payment","method":"GET"}],"fmf_details":{},"processor_response":{"avs_code":"X","cvv_code":"M"}}}]}],"links":[{"href":"https://api.sandbox.paypal.com/v1/payments/payment/PAY-09192451S05232245LC3KINY","rel":"self","method":"GET"}],"httpStatusCode":201}'
-
exit_code: 404
description: Failed
example: "{ response: { name: 'INVALID_RESOURCE_ID', message: 'Requested resource ID was not found.', information_link: 'https://developer.paypal.com/webapps/developer/docs/api/#INVALID_RESOURCE_ID', debug_id: 'e72115d78f2fb', httpStatusCode: 404 }, httpStatusCode: 404 }"
payment_execute:
description: Execute approved payment
file: scripts/payment_execute.js
parameters:
PayerID:
type: string
description: "Payer ID"
example: "4TYTMXM27QEF6"
paymentId:
type: string
description: "Payment ID"
example: "PAY-62567874WB571642PLC2V63A"
response:
mimetype: application/json
examples:
-
exit_code: 201
description: Success
example: '{"id":"PAY-43M09054456295832LC3KJEQ","intent":"sale","state":"approved","cart":"2JE575925W041130S","payer":{"payment_method":"paypal","status":"VERIFIED","payer_info":{"email":"sampleEmail-buyer@gmail.com","first_name":"test","last_name":"buyer","payer_id":"4TYTMXM27QEF6","shipping_address":{"recipient_name":"test buyer","line1":"Bajkowa 2 / 5,","line2":"Case postale 12","city":"Warsaw","state":"","postal_code":"00800","country_code":"PL"},"country_code":"PL"}},"transactions":[{"amount":{"total":"1.00","currency":"USD","details":{}},"payee":{"merchant_id":"BRFC73UKGWAAJ","email":"sampleEmail@gmail.com"},"description":"This is the payment description.","item_list":{"items":[{"name":"item1","sku":"item","price":"1.00","currency":"USD","quantity":1}],"shipping_address":{"recipient_name":"test buyer","line1":"Bajkowa 2 / 5,","line2":"Case postale 12","city":"Warsaw","state":"","postal_code":"00800","country_code":"PL"}},"related_resources":[{"sale":{"id":"2SP96809CC358062H","state":"completed","amount":{"total":"1.00","currency":"USD","details":{"subtotal":"1.00"}},"payment_mode":"INSTANT_TRANSFER","protection_eligibility":"ELIGIBLE","protection_eligibility_type":"ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE","transaction_fee":{"value":"0.34","currency":"USD"},"parent_payment":"PAY-43M09054456295832LC3KJEQ","create_time":"2017-03-01T10:38:33Z","update_time":"2017-03-01T10:38:33Z","links":[{"href":"https://api.sandbox.paypal.com/v1/payments/sale/2SP96809CC358062H","rel":"self","method":"GET"},{"href":"https://api.sandbox.paypal.com/v1/payments/sale/2SP96809CC358062H/refund","rel":"refund","method":"POST"},{"href":"https://api.sandbox.paypal.com/v1/payments/payment/PAY-43M09054456295832LC3KJEQ","rel":"parent_payment","method":"GET"}]}}]}],"create_time":"2017-03-01T10:38:34Z","links":[{"href":"https://api.sandbox.paypal.com/v1/payments/payment/PAY-43M09054456295832LC3KJEQ","rel":"self","method":"GET"}],"httpStatusCode":200}'
-
exit_code: 404
description: Failed
example: "{ response: { name: 'INVALID_RESOURCE_ID', message: 'Requested resource ID was not found.', information_link: 'https://developer.paypal.com/webapps/developer/docs/api/#INVALID_RESOURCE_ID', debug_id: 'e72115d78f2fb', httpStatusCode: 404 }, httpStatusCode: 404 }"
payments_list:
description: Get list of all payments with basic informations
file: scripts/payments_list.js
response:
mimetype: application/json
examples:
-
exit_code: 201
description: Success
example: "[ { id: 'PAY-64644582DN4640416LC2DLSI', create_time: '2017-02-27T14:20:57Z', update_time: '2017-02-27T14:20:57Z', intent: 'sale', state: 'approved' }, { id: 'PAY-20M87407NB324994SLC2DKDQ', create_time: '2017-02-27T14:17:50Z', update_time: '2017-02-27T14:17:50Z', intent: 'sale', state: 'approved' } ]"
-
exit_code: 404
description: Failed
example: "{ response: { name: 'INVALID_RESOURCE_ID', message: 'Requested resource ID was not found.', information_link: 'https://developer.paypal.com/webapps/developer/docs/api/#INVALID_RESOURCE_ID', debug_id: 'e72115d78f2fb', httpStatusCode: 404 }, httpStatusCode: 404 }"
payment_details:
description: Get all information about payment based on ID
file: scripts/payment_details.js
parameters:
paymentId:
type: string
description: "Payment ID"
example: "PAY-64644582DN4640416LC2DLSI"
response:
mimetype: application/json
examples:
-
exit_code: 201
description: Success
example: "{ id: 'PAY-64644582DN4640416LC2DLSI', state: 'approved', cart: '290534519S964102S', payer: { payment_method: 'paypal', status: 'VERIFIED', payer_info: { email: 'sampleEmail-buyer@gmail.com', first_name: 'test', last_name: 'buyer', payer_id: '4TYTMXM27QEF6', phone: '2269420414', country_code: 'PL' } } }"
-
exit_code: 404
description: Failed
example: "{ response: { name: 'INVALID_RESOURCE_ID', message: 'Requested resource ID was not found.', information_link: 'https://developer.paypal.com/webapps/developer/docs/api/#INVALID_RESOURCE_ID', debug_id: 'e72115d78f2fb', httpStatusCode: 404 }, httpStatusCode: 404 }"
payout_create:
description: Create payout with paypal
file: scripts/payout_create.js
parameters:
senderBatchId:
type: string
description: "Batch ID"
example: "gtmigymsoxfglj714i"
response:
mimetype: application/json
examples:
-
exit_code: 201
description: Success
example: "{ batch_header: { payout_batch_id: '4W466DWNNJ59S', batch_status: 'PENDING', sender_batch_header: { email_subject: 'You have a payment', sender_batch_id: 'gtmigymsoxfglj714i' } }, links: [ { href: 'https://api.sandbox.paypal.com/v1/payments/payouts/4W466DWNNJ59S', rel: 'self', method: 'GET' } ], httpStatusCode: 201 }"
-
exit_code: 404
description: Failed
example: "{ response: { name: 'INVALID_RESOURCE_ID', message: 'Requested resource ID was not found.', information_link: 'https://developer.paypal.com/webapps/developer/docs/api/#INVALID_RESOURCE_ID', debug_id: 'e72115d78f2fb', httpStatusCode: 404 }, httpStatusCode: 404 }"
payout_get:
description: Get all information about payout based on ID
file: scripts/payout_get.js
parameters:
payoutId:
type: string
description: "Payout ID"
example: "4W466DWNNJ59S"
response:
mimetype: application/json
examples:
-
exit_code: 201
description: Success
example: '{"batch_header":{"payout_batch_id":"4W466DWNNJ59S","batch_status":"SUCCESS","time_created":"2017-02-28T12:49:22Z","time_completed":"2017-02-28T12:49:43Z","sender_batch_header":{"email_subject":"You have a payment","sender_batch_id":"gtmigymsoxfglj714i"},"amount":{"currency":"USD","value":"7.68"},"fees":{"currency":"USD","value":"0.0"}},"items":[{"payout_item_id":"G9FNRPPPRKMZL","transaction_status":"FAILED","payout_item_fee":{"currency":"USD","value":"0.0"},"payout_batch_id":"4W466DWNNJ59S","payout_item":{"amount":{"currency":"USD","value":"7.68"},"note":"Thank you.","receiver":"danielsiwek95@gmail.com","recipient_type":"EMAIL","sender_item_id":"item_1"},"time_processed":"2017-02-28T12:49:33Z","errors":{"name":"TRANSACTION_LIMIT_EXCEEDED","message":"Either the sender or receiver exceeded the transaction limit","information_link":"https://developer.paypal.com/docs/api/payments.payouts-batch/#errors"},"links":[{"href":"https://api.sandbox.paypal.com/v1/payments/payouts-item/G9FNRPPPRKMZL","rel":"item","method":"GET"}]}],"links":[{"href":"https://api.sandbox.paypal.com/v1/payments/payouts/4W466DWNNJ59S","rel":"self","method":"GET"}],"httpStatusCode":200}'
-
exit_code: 404
description: Failed
example: "{ response: { name: 'INVALID_RESOURCE_ID', message: 'Requested resource ID was not found.', information_link: 'https://developer.paypal.com/webapps/developer/docs/api/#INVALID_RESOURCE_ID', debug_id: 'e72115d78f2fb', httpStatusCode: 404 }, httpStatusCode: 404 }"
config:
client_id:
value: <Your client_id in Paypal>
description: "You can get this value in paypal developer dashboard in 'My Apps & Credentials' section. For more informations see https://developer.paypal.com/docs/integration/direct/make-your-first-call/"
prompt: true
client_secret:
value: <Your client_secret in Paypal>
description: "You can get this value in paypal developer dashboard in 'My Apps & Credentials' section. For more informations see https://developer.paypal.com/docs/integration/direct/make-your-first-call/"
prompt: true