| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297 |
- <?php
- namespace Srmklive\PayPal\Tests\Mocks\Responses;
- use GuzzleHttp\Utils;
- trait Payouts
- {
- /**
- * @return array
- */
- private function mockCreateBatchPayoutResponse(): array
- {
- return Utils::jsonDecode('{
- "batch_header": {
- "sender_batch_header": {
- "sender_batch_id": "Payouts_2018_100008",
- "email_subject": "You have a payout!",
- "email_message": "You have received a payout! Thanks for using our service!"
- },
- "payout_batch_id": "5UXD2E8A7EBQJ",
- "batch_status": "PENDING"
- }
- }', true);
- }
- /**
- * @return array
- */
- private function showBatchPayoutResponse(): array
- {
- return Utils::jsonDecode('{
- "batch_header": {
- "payout_batch_id": "FYXMPQTX4JC9N",
- "batch_status": "PROCESSING",
- "time_created": "2014-01-27T10:17:00Z",
- "time_completed": "2014-01-27T11:17:39.00Z",
- "sender_batch_header": {
- "sender_batch_id": "Payouts_2018_100009",
- "email_subject": "You have a payout!"
- },
- "amount": {
- "value": "438.35",
- "currency": "USD"
- },
- "fees": {
- "value": "5.84",
- "currency": "USD"
- }
- },
- "items": [
- {
- "payout_item_id": "DUCD8GC3VUKVE",
- "transaction_id": "6KA23440H1057442S",
- "transaction_status": "SUCCESS",
- "payout_batch_id": "FYXMPQTX4JC9N",
- "payout_item_fee": {
- "currency": "USD",
- "value": "1.00"
- },
- "payout_item": {
- "recipient_type": "EMAIL",
- "amount": {
- "value": "65.24",
- "currency": "USD"
- },
- "note": "Thanks for your patronage!",
- "receiver": "receiver@example.com",
- "sender_item_id": "14Feb_978"
- },
- "time_processed": "2014-01-27T10:18:32Z"
- },
- {
- "payout_item_id": "LGMEPRKTK7FQA",
- "transaction_id": "8K128187J1102003K",
- "transaction_status": "SUCCESS",
- "payout_batch_id": "FYXMPQTX4JC9N",
- "payout_item_fee": {
- "currency": "USD",
- "value": "1.00"
- },
- "payout_item": {
- "recipient_type": "EMAIL",
- "amount": {
- "value": "59.87",
- "currency": "USD"
- },
- "note": "Thanks for your patronage!",
- "receiver": "receiver2@example.com",
- "sender_item_id": "14Feb_321"
- },
- "time_processed": "2014-01-27T10:18:15Z"
- },
- {
- "payout_item_id": "BQ8GT9VG64EFS",
- "transaction_id": "57382391EC1682714",
- "transaction_status": "SUCCESS",
- "payout_batch_id": "FYXMPQTX4JC9N",
- "payout_item_fee": {
- "currency": "USD",
- "value": "1.00"
- },
- "payout_item": {
- "recipient_type": "EMAIL",
- "amount": {
- "value": "59.87",
- "currency": "USD"
- },
- "note": "Thanks for your patronage!",
- "receiver": "receiver3@example.com",
- "sender_item_id": "14Feb_239"
- },
- "time_processed": "2014-01-27T10:17:15Z"
- },
- {
- "payout_item_id": "LHKZN4VT93L2Q",
- "transaction_id": "1LG71547D1353984N",
- "transaction_status": "SUCCESS",
- "payout_batch_id": "FYXMPQTX4JC9N",
- "payout_item_fee": {
- "value": "USD",
- "currency": "0.75"
- },
- "payout_item": {
- "recipient_type": "EMAIL",
- "amount": {
- "value": "19.87",
- "currency": "USD"
- },
- "note": "Thanks for your patronage!",
- "receiver": "receiver4@example.com",
- "sender_item_id": "14Feb_235"
- },
- "time_processed": "2014-01-27T10:17:25Z"
- },
- {
- "payout_item_id": "4ZF3VZHHTQJG6",
- "transaction_id": "4BD48613EX3256543",
- "transaction_status": "SUCCESS",
- "payout_batch_id": "FYXMPQTX4JC9N",
- "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": "receiver@example.com",
- "sender_item_id": "14Feb_234"
- },
- "time_processed": "2014-01-27T10:17:37Z"
- },
- {
- "payout_item_id": "DTCJCQ6LMH8JQ",
- "transaction_id": "25F63571CL9929422",
- "transaction_status": "SUCCESS",
- "payout_item_fee": {
- "currency": "USD",
- "value": "2.35"
- },
- "payout_batch_id": "FYXMPQTX4JC9N",
- "payout_item": {
- "recipient_type": "PHONE",
- "amount": {
- "value": "112.34",
- "currency": "USD"
- },
- "note": "Thanks for your support!",
- "receiver": "91-734-234-1234",
- "sender_item_id": "14Feb_235"
- },
- "time_processed": "2014-01-27T10:17:52Z"
- },
- {
- "payout_item_id": "GSBDQHUAUD44A",
- "transaction_id": "53R03517P98080414",
- "transaction_status": "SUCCESS",
- "payout_batch_id": "FYXMPQTX4JC9N",
- "payout_item_fee": {
- "currency": "USD",
- "value": "2.5"
- },
- "payout_item": {
- "recipient_type": "PHONE",
- "amount": {
- "value": "5.32",
- "currency": "USD"
- },
- "note": "Thanks for your patronage!",
- "receiver": "408X234-1234",
- "sender_item_id": "14Feb_235"
- },
- "time_processed": "2014-01-27T10:17:41Z"
- }
- ],
- "links": [
- {
- "rel": "self",
- "href": "https://api-m.sandbox.paypal.com/v1/payments/payouts/FYXMPQTX4JC9N?page_size=1000&page=1",
- "method": "GET"
- }
- ]
- }', true);
- }
- /**
- * @return array
- */
- private function showBatchPayoutItemResponse(): array
- {
- return Utils::jsonDecode('{
- "payout_item_id": "8AELMXH8UB2P8",
- "transaction_id": "0C413693MN970190K",
- "activity_id": "0E158638XS0329106",
- "transaction_status": "SUCCESS",
- "payout_item_fee": {
- "currency": "USD",
- "value": "0.35"
- },
- "payout_batch_id": "Q8KVJG9TZTNN4",
- "payout_item": {
- "amount": {
- "value": "9.87",
- "currency": "USD"
- },
- "recipient_type": "EMAIL",
- "note": "Thanks for your patronage!",
- "receiver": "receiver@example.com",
- "sender_item_id": "14Feb_234"
- },
- "time_processed": "2018-01-27T10:17:41Z",
- "links": [
- {
- "rel": "self",
- "href": "https://api-m.sandbox.paypal.com/v1/payments/payouts-item/8AELMXH8UB2P8",
- "method": "GET"
- },
- {
- "href": "https://api-m.sandbox.paypal.com/v1/payments/payouts/Q8KVJG9TZTNN4",
- "rel": "batch",
- "method": "GET"
- }
- ]
- }', true);
- }
- /**
- * @return array
- */
- private function mockCancelUnclaimedBatchItemResponse(): array
- {
- return Utils::jsonDecode('{
- "payout_item_id": "5KUDKLF8SDC7S",
- "transaction_id": "1DG93452WK758815H",
- "activity_id": "0E158638XS0329101",
- "transaction_status": "RETURNED",
- "payout_item_fee": {
- "currency": "USD",
- "value": "0.35"
- },
- "payout_batch_id": "CQMWKDQF5GFLL",
- "sender_batch_id": "Payouts_2018_100006",
- "payout_item": {
- "recipient_type": "EMAIL",
- "amount": {
- "value": "9.87",
- "currency": "USD"
- },
- "note": "Thanks for your patronage!",
- "receiver": "receiver@example.com",
- "sender_item_id": "14Feb_234"
- },
- "time_processed": "2018-01-27T10:17:41Z",
- "errors": {
- "name": "RECEIVER_UNREGISTERED",
- "message": "Receiver is unregistered",
- "information_link": "https://developer.paypal.com/docs/api/payments.payouts-batch#errors"
- },
- "links": [
- {
- "rel": "self",
- "href": "https://api-m.sandbox.paypal.com/v1/payments/payouts-item/5KUDKLF8SDC7S",
- "method": "GET"
- },
- {
- "rel": "batch",
- "href": "https://api-m.sandbox.paypal.com/v1/payments/payouts/CQMWKDQF5GFLL",
- "method": "GET"
- }
- ]
- }', true);
- }
- }
|