forked from LiveCarta/PayPal-PHP-SDK
Enabled Payout API Support
- Includes Unit and Functional Tests - Includes Samples
This commit is contained in:
106
tests/PayPal/Test/Functional/resources/PayoutsFunctionalTest/testCreate.json
Executable file
106
tests/PayPal/Test/Functional/resources/PayoutsFunctionalTest/testCreate.json
Executable file
@@ -0,0 +1,106 @@
|
||||
{
|
||||
"description" : "Sender POSTs a batch with 1 payout request. This example is for sync_mode=true. This means an immediate response. For sync_mode=false, the output will be run in back ground and the repsonse will be different.",
|
||||
"title" : "POST batch sample",
|
||||
"runnable" : true,
|
||||
"operationId" : "payouts",
|
||||
"user" : {
|
||||
"scopes" : [ ]
|
||||
},
|
||||
"credentials" : {
|
||||
"oauth": {
|
||||
"path" : "/v1/oauth/token",
|
||||
"clientId":"",
|
||||
"clientSecret":""
|
||||
}
|
||||
},
|
||||
"request":{
|
||||
"path":"v1/payments/payouts?sync_mode=true",
|
||||
"method":"POST",
|
||||
"headers": {
|
||||
"Content-Type": "application/json",
|
||||
"Content-Encoding": "gzip"
|
||||
},
|
||||
"body":{
|
||||
"sender_batch_header":{
|
||||
"sender_batch_id":"2014021801",
|
||||
"email_subject":"You have a Payout!"
|
||||
},
|
||||
"items":[
|
||||
{
|
||||
"recipient_type":"EMAIL",
|
||||
"amount":{
|
||||
"value":"1.0",
|
||||
"currency":"USD"
|
||||
},
|
||||
"note":"Thanks for your patronage!",
|
||||
"sender_item_id":"2014031400023",
|
||||
"receiver":"shirt-supplier-one@mail.com"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"response" : {
|
||||
"status" : "201 OK",
|
||||
"headers" : {
|
||||
"Content-Type": "application/json",
|
||||
"Content-Encoding": "gzip"
|
||||
},
|
||||
"body" : {
|
||||
"batch_header": {
|
||||
"payout_batch_id": "CDZEC5MJ8R5HY",
|
||||
"batch_status": "SUCCESS",
|
||||
"time_created": "2014-46-14T06:46:22Z",
|
||||
"time_completed": "2014-46-14T06:46:23Z",
|
||||
"sender_batch_header": {
|
||||
"sender_batch_id":"2014021801",
|
||||
"email_subject": "You have a Payout!"
|
||||
},
|
||||
"amount": {
|
||||
"currency": "USD",
|
||||
"value": "1.0"
|
||||
},
|
||||
"fees": {
|
||||
"currency": "USD",
|
||||
"value": "0.02"
|
||||
}
|
||||
},
|
||||
"items": [
|
||||
{
|
||||
"payout_item_id": "VHBFGN95AWV82",
|
||||
"transaction_id": "0728664497487461D",
|
||||
"transaction_status": "SUCCESS",
|
||||
"payout_item_fee": {
|
||||
"currency": "USD",
|
||||
"value": "0.02"
|
||||
},
|
||||
"payout_batch_id": "CDZEC5MJ8R5HY",
|
||||
"payout_item": {
|
||||
"amount": {
|
||||
"currency": "USD",
|
||||
"value": "1.0"
|
||||
},
|
||||
"note": "Thanks for your patronage!",
|
||||
"receiver": "anybody01@gmail.com",
|
||||
"recipient_type": "EMAIL",
|
||||
"sender_item_id": "201403140001"
|
||||
},
|
||||
"time_processed": "2014-46-14T06:46:23Z",
|
||||
"links": [
|
||||
{
|
||||
"href": "https://api.sandbox.paypal.com/v1/payments/payouts-item/VHBFGN95AWV82",
|
||||
"rel": "item",
|
||||
"method": "GET"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
{
|
||||
"href": "https://api.sandbox.paypal.com/v1/payments/payouts/CDZEC5MJ8R5HY",
|
||||
"rel": "self",
|
||||
"method": "GET"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
223
tests/PayPal/Test/Functional/resources/PayoutsFunctionalTest/testGet.json
Executable file
223
tests/PayPal/Test/Functional/resources/PayoutsFunctionalTest/testGet.json
Executable file
@@ -0,0 +1,223 @@
|
||||
{
|
||||
"description" : "GET of a batch with multiple items.",
|
||||
"title" : "GET batch with multiple items",
|
||||
"runnable" : true,
|
||||
"operationId" : "payouts.get",
|
||||
"user" : {
|
||||
"scopes" : [ ]
|
||||
},
|
||||
"credentials" : {
|
||||
"oauth": {
|
||||
"path" : "/v1/oauth/token",
|
||||
"clientId":"",
|
||||
"clientSecret":""
|
||||
},
|
||||
"login" : { },
|
||||
"openIdConnect" : { }
|
||||
},
|
||||
"request" : {
|
||||
"path" : "v1/payments/payouts/12345678",
|
||||
"method" : "GET",
|
||||
"headers" : {
|
||||
"Content-Type": "application/json",
|
||||
"Content-Encoding": "gzip"
|
||||
},
|
||||
"body":{
|
||||
}
|
||||
},
|
||||
"response" : {
|
||||
"status" : "200 OK",
|
||||
"headers" : {
|
||||
"Content-Type": "application/json",
|
||||
"Content-Encoding": "gzip"
|
||||
},
|
||||
"body":{
|
||||
"batch_header":{
|
||||
"payout_batch_id":"12345678",
|
||||
"batch_status":"PROCESSING",
|
||||
"sender_batch_id":"2014021801123",
|
||||
"time_created":"2014-01-27T10:17:00Z",
|
||||
"time_completed":"2014-01-27T11:17:39.00Z",
|
||||
"sender_batch_header":{
|
||||
"sender_batch_id":"2014021801",
|
||||
"email_subject":"You have a Payout!"
|
||||
},
|
||||
"amount":{
|
||||
"value":"435.85",
|
||||
"currency":"USD"
|
||||
},
|
||||
"fees":{
|
||||
"value":"5.84",
|
||||
"currency":"USD"
|
||||
}
|
||||
},
|
||||
"items":[
|
||||
{
|
||||
"payout_item_id":"452176",
|
||||
"transaction_id":"434176",
|
||||
"transaction_status":"SUCCESS",
|
||||
"payout_batch_id":"12345678",
|
||||
"sender_batch_id":"2014021887",
|
||||
"payout_item_fee":{
|
||||
"currency":"USD",
|
||||
"value":"1.00"
|
||||
},
|
||||
"payout_item":{
|
||||
"recipient_type":"EMAIL",
|
||||
"amount":{
|
||||
"value":"65.24",
|
||||
"currency":"EUR"
|
||||
},
|
||||
"note":"Thanks for your patronage!",
|
||||
"receiver":"anybody77@gmail.com",
|
||||
"payouts_item_id":"1421388",
|
||||
"sender_item_id":"14Feb_978"
|
||||
},
|
||||
"time_created":"2014-01-27T10:17:00:00Z",
|
||||
"time_processed":"2014-01-27T10:18:32Z"
|
||||
},
|
||||
{
|
||||
"payout_item_id":"452123",
|
||||
"transaction_id":"434123",
|
||||
"transaction_status":"SUCCESS",
|
||||
"payout_batch_id":"12345678",
|
||||
"sender_batch_id":"2014021802",
|
||||
"payout_item_fee":{
|
||||
"currency":"USD",
|
||||
"value":"1.00"
|
||||
},
|
||||
"payout_item":{
|
||||
"recipient_type":"EMAIL",
|
||||
"amount":{
|
||||
"value":"59.87",
|
||||
"currency":"EUR"
|
||||
},
|
||||
"note":"Thanks for your patronage!",
|
||||
"receiver":"anybody34@gmail.com",
|
||||
"payouts_item_id":"1421345",
|
||||
"sender_item_id":"14Feb_321"
|
||||
},
|
||||
"time_created":"2014-01-27T10:17:00Z",
|
||||
"time_processed":"2014-01-27T10:18:15Z"
|
||||
},
|
||||
{
|
||||
"payout_item_id":"452323",
|
||||
"transaction_id":"434543",
|
||||
"transaction_status":"SUCCESS",
|
||||
"payout_batch_id":"12345678",
|
||||
"sender_batch_id":"2014021802",
|
||||
"payout_item_fee":{
|
||||
"currency":"USD",
|
||||
"value":"1.00"
|
||||
},
|
||||
"payout_item":{
|
||||
"recipient_type":"EMAIL",
|
||||
"amount":{
|
||||
"value":"59.87",
|
||||
"currency":"EUR"
|
||||
},
|
||||
"note":"Thanks for your patronage!",
|
||||
"receiver":"anybody03@gmail.com",
|
||||
"payouts_item_id":"1421355",
|
||||
"sender_item_id":"14Feb_239"
|
||||
},
|
||||
"time_created":"2014-01-27T10:17:00Z",
|
||||
"time_processed":"2014-01-27T10:17:15Z"
|
||||
},
|
||||
{
|
||||
"payout_item_id":"452350",
|
||||
"transaction_id":"434543",
|
||||
"transaction_status":"SUCCESS",
|
||||
"payout_batch_id":"12345678",
|
||||
"sender_batch_id":"2014021801",
|
||||
"payout_item_fee":{
|
||||
"currency":"USD",
|
||||
"value":"0.75"
|
||||
},
|
||||
"payout_item":{
|
||||
"recipient_type":"EMAIL",
|
||||
"amount":{
|
||||
"value":"19.87",
|
||||
"currency":"USD"
|
||||
},
|
||||
"note":"Thanks for your patronage!",
|
||||
"receiver":"anybody02@gmail.com",
|
||||
"payouts_item_id":"1421332",
|
||||
"sender_item_id":"14Feb_235"
|
||||
},
|
||||
"time_created":"2014-01-27T10:17:00Z",
|
||||
"time_processed":"2014-01-27T10:17:25Z"
|
||||
},
|
||||
{
|
||||
"payout_item_id":"452345",
|
||||
"transaction_id":"4345",
|
||||
"transaction_status":"SUCCESS",
|
||||
"payout_batch_id":"12345678",
|
||||
"sender_batch_id":"2014021801",
|
||||
"payout_item_fee":{
|
||||
"currency":"USD",
|
||||
"value":"0.75"
|
||||
},
|
||||
"payout_item":{
|
||||
"recipient_type":"EMAIL",
|
||||
"amount":{
|
||||
"value":"9.87",
|
||||
"currency":"USD"
|
||||
},
|
||||
"note":"Thanks for your patronage!",
|
||||
"receiver":"anybody01@gmail.com",
|
||||
"payouts_item_id":"1421342",
|
||||
"sender_item_id":"14Feb_234"
|
||||
},
|
||||
"time_created":"2014-01-27T10:17:00Z",
|
||||
"time_processed":"2014-01-27T10:17:37Z"
|
||||
},
|
||||
{
|
||||
"payout_item_id":"4782902",
|
||||
"transaction_id":"6456456",
|
||||
"transaction_status":"SUCCESS",
|
||||
"payout_item_fee":{
|
||||
"currency":"USD",
|
||||
"value":"2.35"
|
||||
},
|
||||
"payout_batch_id":"12345678",
|
||||
"sender_batch_id":"2014021801",
|
||||
"payout_item":{
|
||||
"recipient_type":"PHONE",
|
||||
"amount":{
|
||||
"value":"112.34",
|
||||
"currency":"EUR"
|
||||
},
|
||||
"note":"Thanks for your support!",
|
||||
"receiver":"91-734-234-1234",
|
||||
"payouts_item_id":"1421343",
|
||||
"sender_item_id":"14Feb_235"
|
||||
},
|
||||
"time_created":"2014-01-27T10:17:00Z",
|
||||
"time_processed":"2014-01-27T10:17:52Z"
|
||||
},
|
||||
{
|
||||
"payout_item_id":"4782902",
|
||||
"transaction_id":"",
|
||||
"transaction_status":"PROCESSING",
|
||||
"payout_batch_id":"12345678",
|
||||
"sender_batch_id":"2014021801",
|
||||
"payout_item":{
|
||||
"recipient_type":"PHONE",
|
||||
"amount":{
|
||||
"value":"5.32",
|
||||
"currency":"USD"
|
||||
},
|
||||
"note":"Thanks for your patronage!",
|
||||
"receiver":"408X234-1234",
|
||||
"payouts_item_id":"1421344",
|
||||
"sender_item_id":"14Feb_235"
|
||||
},
|
||||
"time_created":"2014-01-27T10:17:00Z",
|
||||
"time_processed":"2014-01-27T10:17:41Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"description" : "Sender needs status of one item.",
|
||||
"title" : "GET item sample",
|
||||
"runnable" : true,
|
||||
"operationId" : "payouts.item",
|
||||
"user" : {
|
||||
"scopes" : [ ]
|
||||
},
|
||||
"credentials" : {
|
||||
"oauth": {
|
||||
"path" : "/v1/oauth/token",
|
||||
"clientId":"",
|
||||
"clientSecret":""
|
||||
}
|
||||
},
|
||||
"request" : {
|
||||
"path" : "v1/payments/payouts-item/452345",
|
||||
"method" : "GET",
|
||||
"headers" : {
|
||||
"Content-Type": "application/json",
|
||||
"Content-Encoding": "gzip"
|
||||
},
|
||||
"body" : {}
|
||||
},
|
||||
"response" : {
|
||||
"status" : "200 OK",
|
||||
"headers" : {
|
||||
"Content-Type": "application/json",
|
||||
"Content-Encoding": "gzip"
|
||||
},
|
||||
"body" : {
|
||||
"items":[
|
||||
{
|
||||
"payout_item_id":"1421342",
|
||||
"transaction_id":"4345",
|
||||
"transaction_status":"SUCCESS",
|
||||
"payout_item_fee":{"currency":"USD","value":"0.35"},
|
||||
"payout_batch_id":"20140724",
|
||||
"sender_batch_id":"2014021801",
|
||||
"payout_item":{
|
||||
"recipient_type":"EMAIL",
|
||||
"amount":{ "value":"9.87", "currency":"USD"},
|
||||
"note":"Thanks for your patronage!",
|
||||
"receiver":"anybody01@gmail.com",
|
||||
"payouts_item_id":"1421342",
|
||||
"sender_item_id":"14Feb_234"
|
||||
},
|
||||
"time_created":"2014-01-27T10:17:00Z",
|
||||
"time_processed":"2014-01-27T10:17:41Z",
|
||||
"links": [
|
||||
{
|
||||
"rel": "self",
|
||||
"href": "payouts-batch/{payout_batch_id}",
|
||||
"method": "GET"
|
||||
},
|
||||
{
|
||||
"rel": "self",
|
||||
"href": "payouts-item/{payout_item_id}",
|
||||
"method": "GET"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user