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 Invoices
8
{
9
    /**
10
     * @return array
11
     */
12
    private function mockGenerateInvoiceNumberResponse(): array
13
    {
14
        return Utils::jsonDecode('{
15
  "invoice_number": "ee0044"
16
}', true);
17
    }
18
 
19
    /**
20
     * @return array
21
     */
22
    private function mockCreateInvoicesResponse(): array
23
    {
24
        return Utils::jsonDecode('{
25
  "id": "INV2-Z56S-5LLA-Q52L-CPZ5",
26
  "status": "DRAFT",
27
  "detail": {
28
    "invoice_number": "#123",
29
    "reference": "deal-ref",
30
    "invoice_date": "2018-11-12",
31
    "currency_code": "USD",
32
    "note": "Thank you for your business.",
33
    "term": "No refunds after 30 days.",
34
    "memo": "This is a long contract",
35
    "payment_term": {
36
      "term_type": "NET_10",
37
      "due_date": "2018-11-22"
38
    },
39
    "metadata": {
40
      "create_time": "2018-11-12T08:00:20Z",
41
      "recipient_view_url": "https://www.api.paypal.com/invoice/p#Z56S5LLAQ52LCPZ5",
42
      "invoicer_view_url": "https://www.api.paypal.com/invoice/details/INV2-Z56S-5LLA-Q52L-CPZ5"
43
    }
44
  },
45
  "invoicer": {
46
    "name": {
47
      "given_name": "David",
48
      "surname": "Larusso"
49
    },
50
    "address": {
51
      "address_line_1": "1234 First Street",
52
      "address_line_2": "337673 Hillside Court",
53
      "admin_area_2": "Anytown",
54
      "admin_area_1": "CA",
55
      "postal_code": "98765",
56
      "country_code": "US"
57
    },
58
    "email_address": "merchant@example.com",
59
    "phones": [
60
      {
61
        "country_code": "001",
62
        "national_number": "4085551234",
63
        "phone_type": "MOBILE"
64
      }
65
    ],
66
    "website": "https://example.com",
67
    "tax_id": "ABcNkWSfb5ICTt73nD3QON1fnnpgNKBy-Jb5SeuGj185MNNw6g",
68
    "logo_url": "https://example.com/logo.PNG",
69
    "additional_notes": "2-4"
70
  },
71
  "primary_recipients": [
72
    {
73
      "billing_info": {
74
        "name": {
75
          "given_name": "Stephanie",
76
          "surname": "Meyers"
77
        },
78
        "address": {
79
          "address_line_1": "1234 Main Street",
80
          "admin_area_2": "Anytown",
81
          "admin_area_1": "CA",
82
          "postal_code": "98765",
83
          "country_code": "US"
84
        },
85
        "email_address": "bill-me@example.com",
86
        "phones": [
87
          {
88
            "country_code": "001",
89
            "national_number": "4884551234",
90
            "phone_type": "HOME"
91
          }
92
        ],
93
        "additional_info_value": "add-info"
94
      },
95
      "shipping_info": {
96
        "name": {
97
          "given_name": "Stephanie",
98
          "surname": "Meyers"
99
        },
100
        "address": {
101
          "address_line_1": "1234 Main Street",
102
          "admin_area_2": "Anytown",
103
          "admin_area_1": "CA",
104
          "postal_code": "98765",
105
          "country_code": "US"
106
        }
107
      }
108
    }
109
  ],
110
  "items": [
111
    {
112
      "name": "Yoga Mat",
113
      "description": "Elastic mat to practice yoga.",
114
      "quantity": "1",
115
      "unit_amount": {
116
        "currency_code": "USD",
117
        "value": "50.00"
118
      },
119
      "tax": {
120
        "name": "Sales Tax",
121
        "percent": "7.25",
122
        "amount": {
123
          "currency_code": "USD",
124
          "value": "3.27"
125
        }
126
      },
127
      "discount": {
128
        "percent": "5",
129
        "amount": {
130
          "currency_code": "USD",
131
          "value": "2.5"
132
        }
133
      },
134
      "unit_of_measure": "QUANTITY"
135
    },
136
    {
137
      "name": "Yoga T Shirt",
138
      "quantity": "1",
139
      "unit_amount": {
140
        "currency_code": "USD",
141
        "value": "10.00"
142
      },
143
      "tax": {
144
        "name": "Sales Tax",
145
        "percent": "7.25",
146
        "amount": {
147
          "currency_code": "USD",
148
          "value": "0.34"
149
        }
150
      },
151
      "discount": {
152
        "amount": {
153
          "currency_code": "USD",
154
          "value": "5.00"
155
        }
156
      },
157
      "unit_of_measure": "QUANTITY"
158
    }
159
  ],
160
  "configuration": {
161
    "partial_payment": {
162
      "allow_partial_payment": true,
163
      "minimum_amount_due": {
164
        "currency_code": "USD",
165
        "value": "20.00"
166
      }
167
    },
168
    "allow_tip": true,
169
    "tax_calculated_after_discount": true,
170
    "tax_inclusive": false,
171
    "template_id": "TEMP-19V05281TU309413B"
172
  },
173
  "amount": {
174
    "currency_code": "USD",
175
    "value": "74.21",
176
    "breakdown": {
177
      "item_total": {
178
        "currency_code": "USD",
179
        "value": "60.00"
180
      },
181
      "custom": {
182
        "label": "Packing Charges",
183
        "amount": {
184
          "currency_code": "USD",
185
          "value": "10.00"
186
        }
187
      },
188
      "shipping": {
189
        "amount": {
190
          "currency_code": "USD",
191
          "value": "10.00"
192
        },
193
        "tax": {
194
          "name": "Sales Tax",
195
          "percent": "7.25",
196
          "amount": {
197
            "currency_code": "USD",
198
            "value": "0.73"
199
          }
200
        }
201
      },
202
      "discount": {
203
        "item_discount": {
204
          "currency_code": "USD",
205
          "value": "-7.50"
206
        },
207
        "invoice_discount": {
208
          "percent": "5",
209
          "amount": {
210
            "currency_code": "USD",
211
            "value": "-2.63"
212
          }
213
        }
214
      },
215
      "tax_total": {
216
        "currency_code": "USD",
217
        "value": "4.34"
218
      }
219
    }
220
  },
221
  "due_amount": {
222
    "currency_code": "USD",
223
    "value": "74.21"
224
  },
225
  "links": [
226
    {
227
      "href": "https://api.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5",
228
      "rel": "self",
229
      "method": "GET"
230
    },
231
    {
232
      "href": "https://api.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5/send",
233
      "rel": "send",
234
      "method": "POST"
235
    },
236
    {
237
      "href": "https://api.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5/update",
238
      "rel": "replace",
239
      "method": "PUT"
240
    },
241
    {
242
      "href": "https://api.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5",
243
      "rel": "delete",
244
      "method": "DELETE"
245
    },
246
    {
247
      "href": "https://api.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5/payments",
248
      "rel": "record-payment",
249
      "method": "POST"
250
    },
251
    {
252
      "href": "https://api.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5/generate-qr-code",
253
      "rel": "qr-code",
254
      "method": "POST"
255
    }
256
  ]
257
}', true);
258
    }
259
 
260
    /**
261
     * @return array
262
     */
263
    private function mockListInvoicesResponse(): array
264
    {
265
        return Utils::jsonDecode('{
266
  "total_items": 2,
267
  "total_pages": 1,
268
  "items": [
269
    {
270
      "id": "INV2-Z56S-5LLA-Q52L-CPZ5",
271
      "status": "DRAFT",
272
      "detail": {
273
        "invoice_number": "#123",
274
        "reference": "deal-ref",
275
        "invoice_date": "2018-11-12",
276
        "currency_code": "USD",
277
        "note": "Thank you for your business.",
278
        "term": "No refunds after 30 days.",
279
        "memo": "This is a long contract",
280
        "payment_term": {
281
          "term_type": "NET_10",
282
          "due_date": "2018-11-22"
283
        },
284
        "metadata": {
285
          "create_time": "2018-11-12T08:00:20Z",
286
          "recipient_view_url": "https://www.paypal.com/invoice/p/#Z56S5LLAQ52LCPZ5",
287
          "invoicer_view_url": "https://www.paypal.com/invoice/details/INV2-Z56S-5LLA-Q52L-CPZ5"
288
        }
289
      },
290
      "invoicer": {
291
        "email_address": "merchant@example.com"
292
      },
293
      "primary_recipients": [
294
        {
295
          "billing_info": {
296
            "email_address": "bill-me@example.com"
297
          }
298
        }
299
      ],
300
      "amount": {
301
        "currency_code": "USD",
302
        "value": "74.21"
303
      },
304
      "links": [
305
        {
306
          "href": "https://api.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5",
307
          "rel": "self",
308
          "method": "GET"
309
        },
310
        {
311
          "href": "https://api.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5/send",
312
          "rel": "send",
313
          "method": "POST"
314
        },
315
        {
316
          "href": "https://api.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5",
317
          "rel": "replace",
318
          "method": "PUT"
319
        },
320
        {
321
          "href": "https://api.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5",
322
          "rel": "delete",
323
          "method": "DELETE"
324
        }
325
      ]
326
    },
327
    {
328
      "id": "INV2-NP6M-C9A8-ZBDA-3TEX",
329
      "status": "SCHEDULED",
330
      "detail": {
331
        "invoice_number": "0001",
332
        "invoice_date": "2018-05-14",
333
        "currency_code": "USD",
334
        "payment_term": {
335
          "due_date": "2018-05-15"
336
        },
337
        "metadata": {
338
          "create_time": "2018-05-15T17:24:12Z"
339
        }
340
      },
341
      "invoicer": {
342
        "email_address": "merchant@example.com"
343
      },
344
      "primary_recipients": [
345
        {
346
          "billing_info": {
347
            "email_address": "recipient@example.com"
348
          }
349
        }
350
      ],
351
      "amount": {
352
        "currency_code": "USD",
353
        "value": "32.00"
354
      },
355
      "links": [
356
        {
357
          "href": "https://api.paypal.com/v2/invoicing/invoices/INV2-NP6M-C9A8-ZBDA-3TEX",
358
          "rel": "self",
359
          "method": "GET"
360
        },
361
        {
362
          "href": "https://api.paypal.com/v2/invoicing/invoices/INV2-NP6M-C9A8-ZBDA-3TEX",
363
          "rel": "replace",
364
          "method": "PUT"
365
        },
366
        {
367
          "href": "https://api.paypal.com/v2/invoicing/invoices/INV2-NP6M-C9A8-ZBDA-3TEX",
368
          "rel": "delete",
369
          "method": "DELETE"
370
        },
371
        {
372
          "href": "https://api.paypal.com/v2/invoicing/invoices/INV2-NP6M-C9A8-ZBDA-3TEX/payments",
373
          "rel": "record-payment",
374
          "method": "POST"
375
        }
376
      ]
377
    }
378
  ],
379
  "links": [
380
    {
381
      "href": "https://api.paypal.com/v2/invoicing/invoices?page=1&page_size=20&total_required=false",
382
      "rel": "self",
383
      "method": "GET"
384
    }
385
  ]
386
}', true);
387
    }
388
 
389
    /**
390
     * @return array
391
     */
392
    private function mockUpdateInvoicesResponse(): array
393
    {
394
        return Utils::jsonDecode('{
395
  "id": "INV2-C82X-JNN9-Y6S5-CNXW",
396
  "status": "DRAFT",
397
  "detail": {
398
    "invoice_number": "#123",
399
    "reference": "deal-refernce-update",
400
    "invoice_date": "2018-11-12",
401
    "currency_code": "USD",
402
    "note": "Thank you for your business.",
403
    "term": "No refunds after 30 days.",
404
    "memo": "This is a long contract",
405
    "payment_term": {
406
      "term_type": "NET_10",
407
      "due_date": "2018-11-22"
408
    },
409
    "metadata": {
410
      "create_time": "2018-11-12T08:00:20Z",
411
      "recipient_view_url": "https://www.api.paypal.com/invoice/p#Z56S5LLAQ52LCPZ5",
412
      "invoicer_view_url": "https://www.api.paypal.com/invoice/details/INV2-Z56S-5LLA-Q52L-CPZ5"
413
    }
414
  },
415
  "invoicer": {
416
    "name": {
417
      "given_name": "David",
418
      "surname": "Larusso"
419
    },
420
    "address": {
421
      "address_line_1": "1234 First Street",
422
      "address_line_2": "337673 Hillside Court",
423
      "admin_area_2": "Anytown",
424
      "admin_area_1": "CA",
425
      "postal_code": "98765",
426
      "country_code": "US"
427
    },
428
    "email_address": "merchant@example.com",
429
    "phones": [
430
      {
431
        "country_code": "001",
432
        "national_number": "4085551234",
433
        "phone_type": "MOBILE"
434
      }
435
    ],
436
    "website": "https://example.com",
437
    "tax_id": "ABcNkWSfb5ICTt73nD3QON1fnnpgNKBy-Jb5SeuGj185MNNw6g",
438
    "logo_url": "https://example.com/logo.PNG",
439
    "additional_notes": "2-4"
440
  },
441
  "primary_recipients": [
442
    {
443
      "billing_info": {
444
        "name": {
445
          "given_name": "Stephanie",
446
          "surname": "Meyers"
447
        },
448
        "address": {
449
          "address_line_1": "1234 Main Street",
450
          "admin_area_2": "Anytown",
451
          "admin_area_1": "CA",
452
          "postal_code": "98765",
453
          "country_code": "US"
454
        },
455
        "email_address": "bill-me@example.com",
456
        "phones": [
457
          {
458
            "country_code": "001",
459
            "national_number": "4884551234",
460
            "phone_type": "HOME"
461
          }
462
        ],
463
        "additional_info_value": "add-info"
464
      },
465
      "shipping_info": {
466
        "name": {
467
          "given_name": "Stephanie",
468
          "surname": "Meyers"
469
        },
470
        "address": {
471
          "address_line_1": "1234 Main Street",
472
          "admin_area_2": "Anytown",
473
          "admin_area_1": "CA",
474
          "postal_code": "98765",
475
          "country_code": "US"
476
        }
477
      }
478
    }
479
  ],
480
  "items": [
481
    {
482
      "name": "Yoga Mat",
483
      "description": "Elastic mat to practice yoga.",
484
      "quantity": "1",
485
      "unit_amount": {
486
        "currency_code": "USD",
487
        "value": "50.00"
488
      },
489
      "tax": {
490
        "name": "Sales Tax",
491
        "percent": "7.25",
492
        "amount": {
493
          "currency_code": "USD",
494
          "value": "3.27"
495
        }
496
      },
497
      "discount": {
498
        "percent": "5",
499
        "amount": {
500
          "currency_code": "USD",
501
          "value": "2.5"
502
        }
503
      },
504
      "unit_of_measure": "QUANTITY"
505
    },
506
    {
507
      "name": "Yoga t-shirt",
508
      "quantity": "1",
509
      "unit_amount": {
510
        "currency_code": "USD",
511
        "value": "10.00"
512
      },
513
      "tax": {
514
        "name": "Sales Tax",
515
        "percent": "7.25",
516
        "amount": {
517
          "currency_code": "USD",
518
          "value": "0.34"
519
        }
520
      },
521
      "discount": {
522
        "amount": {
523
          "currency_code": "USD",
524
          "value": "5.00"
525
        }
526
      },
527
      "unit_of_measure": "QUANTITY"
528
    }
529
  ],
530
  "configuration": {
531
    "partial_payment": {
532
      "allow_partial_payment": true,
533
      "minimum_amount_due": {
534
        "currency_code": "USD",
535
        "value": "20.00"
536
      }
537
    },
538
    "allow_tip": true,
539
    "tax_calculated_after_discount": true,
540
    "tax_inclusive": false,
541
    "template_id": "TEMP-19V05281TU309413B"
542
  },
543
  "amount": {
544
    "currency_code": "USD",
545
    "value": "74.21",
546
    "breakdown": {
547
      "item_total": {
548
        "currency_code": "USD",
549
        "value": "60.00"
550
      },
551
      "custom": {
552
        "label": "Packing Charges",
553
        "amount": {
554
          "currency_code": "USD",
555
          "value": "10.00"
556
        }
557
      },
558
      "shipping": {
559
        "amount": {
560
          "currency_code": "USD",
561
          "value": "10.00"
562
        },
563
        "tax": {
564
          "name": "Sales Tax",
565
          "percent": "7.25",
566
          "amount": {
567
            "currency_code": "USD",
568
            "value": "0.73"
569
          }
570
        }
571
      },
572
      "discount": {
573
        "item_discount": {
574
          "currency_code": "USD",
575
          "value": "-7.50"
576
        },
577
        "invoice_discount": {
578
          "percent": "5",
579
          "amount": {
580
            "currency_code": "USD",
581
            "value": "-2.63"
582
          }
583
        }
584
      },
585
      "tax_total": {
586
        "currency_code": "USD",
587
        "value": "4.34"
588
      }
589
    }
590
  },
591
  "due_amount": {
592
    "currency_code": "USD",
593
    "value": "74.21"
594
  },
595
  "links": [
596
    {
597
      "href": "https://api.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5",
598
      "rel": "self",
599
      "method": "GET"
600
    },
601
    {
602
      "href": "https://api.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5/send",
603
      "rel": "send",
604
      "method": "POST"
605
    },
606
    {
607
      "href": "https://api.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5/update",
608
      "rel": "replace",
609
      "method": "PUT"
610
    },
611
    {
612
      "href": "https://api.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5",
613
      "rel": "delete",
614
      "method": "DELETE"
615
    }
616
  ]
617
}', true);
618
    }
619
 
620
    /**
621
     * @return array
622
     */
623
    private function mockGetInvoicesResponse(): array
624
    {
625
        return Utils::jsonDecode('{
626
  "id": "INV2-Z56S-5LLA-Q52L-CPZ5",
627
  "status": "DRAFT",
628
  "detail": {
629
    "invoice_number": "#123",
630
    "reference": "deal-ref",
631
    "invoice_date": "2018-11-12",
632
    "currency_code": "USD",
633
    "note": "Thank you for your business.",
634
    "term": "No refunds after 30 days.",
635
    "memo": "This is a long contract",
636
    "payment_term": {
637
      "term_type": "NET_10",
638
      "due_date": "2018-11-22"
639
    },
640
    "metadata": {
641
      "create_time": "2018-11-12T08:00:20Z",
642
      "recipient_view_url": "https://www.paypal.com/invoice/p/#Z56S5LLAQ52LCPZ5",
643
      "invoicer_view_url": "https://www.paypal.com/invoice/details/INV2-Z56S-5LLA-Q52L-CPZ5"
644
    }
645
  },
646
  "invoicer": {
647
    "name": {
648
      "given_name": "David",
649
      "surname": "Larusso"
650
    },
651
    "address": {
652
      "address_line_1": "1234 First Street",
653
      "address_line_2": "337673 Hillside Court",
654
      "admin_area_2": "Anytown",
655
      "admin_area_1": "CA",
656
      "postal_code": "98765",
657
      "country_code": "US"
658
    },
659
    "email_address": "merchant@example.com",
660
    "phones": [
661
      {
662
        "country_code": "001",
663
        "national_number": "4085551234",
664
        "phone_type": "MOBILE"
665
      }
666
    ],
667
    "website": "https://example.com",
668
    "tax_id": "ABcNkWSfb5ICTt73nD3QON1fnnpgNKBy-Jb5SeuGj185MNNw6g",
669
    "logo_url": "https://example.com/logo.PNG",
670
    "additional_notes": "2-4"
671
  },
672
  "primary_recipients": [
673
    {
674
      "billing_info": {
675
        "name": {
676
          "given_name": "Stephanie",
677
          "surname": "Meyers"
678
        },
679
        "address": {
680
          "address_line_1": "1234 Main Street",
681
          "admin_area_2": "Anytown",
682
          "admin_area_1": "CA",
683
          "postal_code": "98765",
684
          "country_code": "US"
685
        },
686
        "email_address": "bill-me@example.com",
687
        "phones": [
688
          {
689
            "country_code": "001",
690
            "national_number": "4884551234",
691
            "phone_type": "HOME"
692
          }
693
        ],
694
        "additional_info_value": "add-info"
695
      },
696
      "shipping_info": {
697
        "name": {
698
          "given_name": "Stephanie",
699
          "surname": "Meyers"
700
        },
701
        "address": {
702
          "address_line_1": "1234 Main Street",
703
          "admin_area_2": "Anytown",
704
          "admin_area_1": "CA",
705
          "postal_code": "98765",
706
          "country_code": "US"
707
        }
708
      }
709
    }
710
  ],
711
  "items": [
712
    {
713
      "name": "Yoga Mat",
714
      "description": "Elastic mat to practice yoga.",
715
      "quantity": "1",
716
      "unit_amount": {
717
        "currency_code": "USD",
718
        "value": "50.00"
719
      },
720
      "tax": {
721
        "name": "Sales Tax",
722
        "percent": "7.25",
723
        "amount": {
724
          "currency_code": "USD",
725
          "value": "3.27"
726
        }
727
      },
728
      "discount": {
729
        "percent": "5",
730
        "amount": {
731
          "currency_code": "USD",
732
          "value": "2.5"
733
        }
734
      },
735
      "unit_of_measure": "QUANTITY"
736
    },
737
    {
738
      "name": "Yoga T Shirt",
739
      "quantity": "1",
740
      "unit_amount": {
741
        "currency_code": "USD",
742
        "value": "10.00"
743
      },
744
      "tax": {
745
        "name": "Sales Tax",
746
        "percent": "7.25",
747
        "amount": {
748
          "currency_code": "USD",
749
          "value": "0.34"
750
        }
751
      },
752
      "discount": {
753
        "amount": {
754
          "currency_code": "USD",
755
          "value": "5.00"
756
        }
757
      },
758
      "unit_of_measure": "QUANTITY"
759
    }
760
  ],
761
  "configuration": {
762
    "partial_payment": {
763
      "allow_partial_payment": true,
764
      "minimum_amount_due": {
765
        "currency_code": "USD",
766
        "value": "20.00"
767
      }
768
    },
769
    "allow_tip": true,
770
    "tax_calculated_after_discount": true,
771
    "tax_inclusive": false,
772
    "template_id": "TEMP-19V05281TU309413B"
773
  },
774
  "amount": {
775
    "currency_code": "USD",
776
    "value": "74.21",
777
    "breakdown": {
778
      "item_total": {
779
        "currency_code": "USD",
780
        "value": "60.00"
781
      },
782
      "custom": {
783
        "label": "Packing Charges",
784
        "amount": {
785
          "currency_code": "USD",
786
          "value": "10.00"
787
        }
788
      },
789
      "shipping": {
790
        "amount": {
791
          "currency_code": "USD",
792
          "value": "10.00"
793
        },
794
        "tax": {
795
          "name": "Sales Tax",
796
          "percent": "7.25",
797
          "amount": {
798
            "currency_code": "USD",
799
            "value": "0.73"
800
          }
801
        }
802
      },
803
      "discount": {
804
        "item_discount": {
805
          "currency_code": "USD",
806
          "value": "-7.50"
807
        },
808
        "invoice_discount": {
809
          "percent": "5",
810
          "amount": {
811
            "currency_code": "USD",
812
            "value": "-2.63"
813
          }
814
        }
815
      },
816
      "tax_total": {
817
        "currency_code": "USD",
818
        "value": "4.34"
819
      }
820
    }
821
  },
822
  "due_amount": {
823
    "currency_code": "USD",
824
    "value": "74.21"
825
  },
826
  "links": [
827
    {
828
      "href": "https://api.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5",
829
      "rel": "self",
830
      "method": "GET"
831
    },
832
    {
833
      "href": "https://api.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5/send",
834
      "rel": "send",
835
      "method": "POST"
836
    },
837
    {
838
      "href": "https://api.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5",
839
      "rel": "replace",
840
      "method": "PUT"
841
    },
842
    {
843
      "href": "https://api.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5",
844
      "rel": "delete",
845
      "method": "DELETE"
846
    },
847
    {
848
      "href": "https://api.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5/payments",
849
      "rel": "record-payment",
850
      "method": "POST"
851
    },
852
    {
853
      "href": "https://api.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5/generate-qr-code",
854
      "rel": "qr-code",
855
      "method": "POST"
856
    }
857
  ]
858
}', true);
859
    }
860
 
861
    /**
862
     * @return string
863
     */
864
    private function mockGenerateInvoiceQRCodeResponse(): string
865
    {
866
        return '--95dbdbed-7536-4c24-b5ca-bcdbc0006612 Content-Disposition: form-data; name="image" Content-Type: application/octet-stream iVBORw0KGgoAAAANSUhEUgAAAJYAAACWAQAAAAAUekxPAAABxUlEQVR42u2WMY7kIBBFq0VA1n0BS1yDjCvZF7DxBdxXIuMaSFzAzgiQaz6t9mxLm1AbrCYYy4H1AlT1f9XHxH89lX7Z/2KJKN3CMIW6FCInYplLPtisoU6FTyHzti6RN5tPm+5ixrtTp0uP8g8s744eMS1yxvikNEOJz966GPTLaOL1fmjaxfAkaLCy2t2Hl10sPUIaNY1araFhCat3TbODDPkZ68Ii1sqfX62c1rzP62W8uWG0aiMaxSyvpS4hez2MzXkZg+FL4NNCwku/XtZ8g/Be550+Pe9jWj0x41rt1ngZyxzYa+NpmDjNMlYx1yhhs2glM8vY3IQ3qGWz9Tqvk7F3cGyYNd3KQDKGSWFGDjFNIZ8yhuWgR8gb5jR8+9bJ8rPUCd3oYbY4VcQqaWSYWRGcdnhnSS+D6lhKJIE5+JrTXtaquDtzuuypXrV0stRKwLAUzFodnYjxERP28ihtLw8WsbQE7JbxCD9SmxMxfsUYpiZ7lxYWMewltzuqKMz4n13tYi3vl6jW2FJQynBH+Za7Zie6sZRhNVXLTkqTmGUE5xSRu5dv3Qz3uYdj0bwkFLGWfxxoJMXx28tO9vu/9oPYF0bR/hBeOiwMAAAAAElFTkSuQmCC --95dbdbed-7536-4c24-b5ca-bcdbc0006612--';
867
    }
868
 
869
    /**
870
     * @return array
871
     */
872
    private function mockInvoiceRegisterPaymentResponse(): array
873
    {
874
        return Utils::jsonDecode('{
875
  "payment_id": "EXTR-86F38350LX4353815"
876
}', true);
877
    }
878
 
879
    /**
880
     * @return array
881
     */
882
    private function mockInvoiceRefundPaymentResponse(): array
883
    {
884
        return Utils::jsonDecode('{
885
  "refund_id": "EXTR-2LG703375E477444T"
886
}', true);
887
    }
888
}