Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
676 lars 1
<?php
2
 
3
namespace Srmklive\PayPal\Tests\Mocks\Responses;
4
 
5
use GuzzleHttp\Utils;
6
 
7
trait Payouts
8
{
9
    /**
10
     * @return array
11
     */
12
    private function mockCreateBatchPayoutResponse(): array
13
    {
14
        return Utils::jsonDecode('{
15
  "batch_header": {
16
    "sender_batch_header": {
17
      "sender_batch_id": "Payouts_2018_100008",
18
      "email_subject": "You have a payout!",
19
      "email_message": "You have received a payout! Thanks for using our service!"
20
    },
21
    "payout_batch_id": "5UXD2E8A7EBQJ",
22
    "batch_status": "PENDING"
23
  }
24
}', true);
25
    }
26
 
27
    /**
28
     * @return array
29
     */
30
    private function showBatchPayoutResponse(): array
31
    {
32
        return Utils::jsonDecode('{
33
  "batch_header": {
34
    "payout_batch_id": "FYXMPQTX4JC9N",
35
    "batch_status": "PROCESSING",
36
    "time_created": "2014-01-27T10:17:00Z",
37
    "time_completed": "2014-01-27T11:17:39.00Z",
38
    "sender_batch_header": {
39
      "sender_batch_id": "Payouts_2018_100009",
40
      "email_subject": "You have a payout!"
41
    },
42
    "amount": {
43
      "value": "438.35",
44
      "currency": "USD"
45
    },
46
    "fees": {
47
      "value": "5.84",
48
      "currency": "USD"
49
    }
50
  },
51
  "items": [
52
    {
53
      "payout_item_id": "DUCD8GC3VUKVE",
54
      "transaction_id": "6KA23440H1057442S",
55
      "transaction_status": "SUCCESS",
56
      "payout_batch_id": "FYXMPQTX4JC9N",
57
      "payout_item_fee": {
58
        "currency": "USD",
59
        "value": "1.00"
60
      },
61
      "payout_item": {
62
        "recipient_type": "EMAIL",
63
        "amount": {
64
          "value": "65.24",
65
          "currency": "USD"
66
        },
67
        "note": "Thanks for your patronage!",
68
        "receiver": "receiver@example.com",
69
        "sender_item_id": "14Feb_978"
70
      },
71
      "time_processed": "2014-01-27T10:18:32Z"
72
    },
73
    {
74
      "payout_item_id": "LGMEPRKTK7FQA",
75
      "transaction_id": "8K128187J1102003K",
76
      "transaction_status": "SUCCESS",
77
      "payout_batch_id": "FYXMPQTX4JC9N",
78
      "payout_item_fee": {
79
        "currency": "USD",
80
        "value": "1.00"
81
      },
82
      "payout_item": {
83
        "recipient_type": "EMAIL",
84
        "amount": {
85
          "value": "59.87",
86
          "currency": "USD"
87
        },
88
        "note": "Thanks for your patronage!",
89
        "receiver": "receiver2@example.com",
90
        "sender_item_id": "14Feb_321"
91
      },
92
      "time_processed": "2014-01-27T10:18:15Z"
93
    },
94
    {
95
      "payout_item_id": "BQ8GT9VG64EFS",
96
      "transaction_id": "57382391EC1682714",
97
      "transaction_status": "SUCCESS",
98
      "payout_batch_id": "FYXMPQTX4JC9N",
99
      "payout_item_fee": {
100
        "currency": "USD",
101
        "value": "1.00"
102
      },
103
      "payout_item": {
104
        "recipient_type": "EMAIL",
105
        "amount": {
106
          "value": "59.87",
107
          "currency": "USD"
108
        },
109
        "note": "Thanks for your patronage!",
110
        "receiver": "receiver3@example.com",
111
        "sender_item_id": "14Feb_239"
112
      },
113
      "time_processed": "2014-01-27T10:17:15Z"
114
    },
115
    {
116
      "payout_item_id": "LHKZN4VT93L2Q",
117
      "transaction_id": "1LG71547D1353984N",
118
      "transaction_status": "SUCCESS",
119
      "payout_batch_id": "FYXMPQTX4JC9N",
120
      "payout_item_fee": {
121
        "value": "USD",
122
        "currency": "0.75"
123
      },
124
      "payout_item": {
125
        "recipient_type": "EMAIL",
126
        "amount": {
127
          "value": "19.87",
128
          "currency": "USD"
129
        },
130
        "note": "Thanks for your patronage!",
131
        "receiver": "receiver4@example.com",
132
        "sender_item_id": "14Feb_235"
133
      },
134
      "time_processed": "2014-01-27T10:17:25Z"
135
    },
136
    {
137
      "payout_item_id": "4ZF3VZHHTQJG6",
138
      "transaction_id": "4BD48613EX3256543",
139
      "transaction_status": "SUCCESS",
140
      "payout_batch_id": "FYXMPQTX4JC9N",
141
      "payout_item_fee": {
142
        "currency": "USD",
143
        "value": "0.75"
144
      },
145
      "payout_item": {
146
        "recipient_type": "EMAIL",
147
        "amount": {
148
          "value": "9.87",
149
          "currency": "USD"
150
        },
151
        "note": "Thanks for your patronage!",
152
        "receiver": "receiver@example.com",
153
        "sender_item_id": "14Feb_234"
154
      },
155
      "time_processed": "2014-01-27T10:17:37Z"
156
    },
157
    {
158
      "payout_item_id": "DTCJCQ6LMH8JQ",
159
      "transaction_id": "25F63571CL9929422",
160
      "transaction_status": "SUCCESS",
161
      "payout_item_fee": {
162
        "currency": "USD",
163
        "value": "2.35"
164
      },
165
      "payout_batch_id": "FYXMPQTX4JC9N",
166
      "payout_item": {
167
        "recipient_type": "PHONE",
168
        "amount": {
169
          "value": "112.34",
170
          "currency": "USD"
171
        },
172
        "note": "Thanks for your support!",
173
        "receiver": "91-734-234-1234",
174
        "sender_item_id": "14Feb_235"
175
      },
176
      "time_processed": "2014-01-27T10:17:52Z"
177
    },
178
    {
179
      "payout_item_id": "GSBDQHUAUD44A",
180
      "transaction_id": "53R03517P98080414",
181
      "transaction_status": "SUCCESS",
182
      "payout_batch_id": "FYXMPQTX4JC9N",
183
      "payout_item_fee": {
184
        "currency": "USD",
185
        "value": "2.5"
186
      },
187
      "payout_item": {
188
        "recipient_type": "PHONE",
189
        "amount": {
190
          "value": "5.32",
191
          "currency": "USD"
192
        },
193
        "note": "Thanks for your patronage!",
194
        "receiver": "408X234-1234",
195
        "sender_item_id": "14Feb_235"
196
      },
197
      "time_processed": "2014-01-27T10:17:41Z"
198
    }
199
  ],
200
  "links": [
201
    {
202
      "rel": "self",
203
      "href": "https://api-m.sandbox.paypal.com/v1/payments/payouts/FYXMPQTX4JC9N?page_size=1000&page=1",
204
      "method": "GET"
205
    }
206
  ]
207
}', true);
208
    }
209
 
210
    /**
211
     * @return array
212
     */
213
    private function showBatchPayoutItemResponse(): array
214
    {
215
        return Utils::jsonDecode('{
216
  "payout_item_id": "8AELMXH8UB2P8",
217
  "transaction_id": "0C413693MN970190K",
218
  "activity_id": "0E158638XS0329106",
219
  "transaction_status": "SUCCESS",
220
  "payout_item_fee": {
221
    "currency": "USD",
222
    "value": "0.35"
223
  },
224
  "payout_batch_id": "Q8KVJG9TZTNN4",
225
  "payout_item": {
226
    "amount": {
227
      "value": "9.87",
228
      "currency": "USD"
229
    },
230
    "recipient_type": "EMAIL",
231
    "note": "Thanks for your patronage!",
232
    "receiver": "receiver@example.com",
233
    "sender_item_id": "14Feb_234"
234
  },
235
  "time_processed": "2018-01-27T10:17:41Z",
236
  "links": [
237
    {
238
      "rel": "self",
239
      "href": "https://api-m.sandbox.paypal.com/v1/payments/payouts-item/8AELMXH8UB2P8",
240
      "method": "GET"
241
    },
242
    {
243
      "href": "https://api-m.sandbox.paypal.com/v1/payments/payouts/Q8KVJG9TZTNN4",
244
      "rel": "batch",
245
      "method": "GET"
246
    }
247
  ]
248
}', true);
249
    }
250
 
251
    /**
252
     * @return array
253
     */
254
    private function mockCancelUnclaimedBatchItemResponse(): array
255
    {
256
        return Utils::jsonDecode('{
257
  "payout_item_id": "5KUDKLF8SDC7S",
258
  "transaction_id": "1DG93452WK758815H",
259
  "activity_id": "0E158638XS0329101",
260
  "transaction_status": "RETURNED",
261
  "payout_item_fee": {
262
    "currency": "USD",
263
    "value": "0.35"
264
  },
265
  "payout_batch_id": "CQMWKDQF5GFLL",
266
  "sender_batch_id": "Payouts_2018_100006",
267
  "payout_item": {
268
    "recipient_type": "EMAIL",
269
    "amount": {
270
      "value": "9.87",
271
      "currency": "USD"
272
    },
273
    "note": "Thanks for your patronage!",
274
    "receiver": "receiver@example.com",
275
    "sender_item_id": "14Feb_234"
276
  },
277
  "time_processed": "2018-01-27T10:17:41Z",
278
  "errors": {
279
    "name": "RECEIVER_UNREGISTERED",
280
    "message": "Receiver is unregistered",
281
    "information_link": "https://developer.paypal.com/docs/api/payments.payouts-batch#errors"
282
  },
283
  "links": [
284
    {
285
      "rel": "self",
286
      "href": "https://api-m.sandbox.paypal.com/v1/payments/payouts-item/5KUDKLF8SDC7S",
287
      "method": "GET"
288
    },
289
    {
290
      "rel": "batch",
291
      "href": "https://api-m.sandbox.paypal.com/v1/payments/payouts/CQMWKDQF5GFLL",
292
      "method": "GET"
293
    }
294
  ]
295
}', true);
296
    }
297
}