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 InvoicesTemplates
8
{
9
    /**
10
     * @return array
11
     */
12
    private function mockCreateInvoiceTemplateResponse(): array
13
    {
14
        return Utils::jsonDecode('{
15
  "id": "TEMP-19V05281TU309413B",
16
  "name": "reference-temp",
17
  "default_template": true,
18
  "template_info": {
19
    "configuration": {
20
      "tax_calculated_after_discount": true,
21
      "tax_inclusive": false,
22
      "allow_tip": true,
23
      "partial_payment": {
24
        "allow_partial_payment": true,
25
        "minimum_amount_due": {
26
          "currency_code": "USD",
27
          "value": "20.00"
28
        }
29
      }
30
    },
31
    "detail": {
32
      "reference": "deal-ref",
33
      "note": "Thank you for your business.",
34
      "currency_code": "USD",
35
      "terms_and_conditions": "No refunds after 30 days.",
36
      "memo": "This is a long contract",
37
      "attachments": [
38
        {
39
          "id": "Screen Shot 2018-11-23 at 16.45.01.png",
40
          "reference_url": "https://api.paypal.com/invoice/payerView/attachments/RkG9ggQbd4Mwm1tYdcF6uuixfFTFq32bBdbE1VbtQLdKSoS2ZOYpfjw9gPp7eTrZmVaFaDWzixHXm-OXWHbmigHigHzURDxJs8IIKqcqP8jawnBEZcraEAPVMULxf5iTyOSpAUc2ugW0PWdwDbM6mg-guFAUyj3Z98H7htWNjQY95jb9heOlcSXUe.sbDUR9smAszzzJoA1NXT6rEEegwQ&version=1&sig=JNODB0xEayW8txMQm6ZsIwDnd4eh3hd6ijiRLi4ipHE"
41
        }
42
      ],
43
      "payment_term": {
44
        "term_type": "NET_10"
45
      },
46
      "metadata": {
47
        "create_time": "2018-12-03T03:38:46z"
48
      }
49
    },
50
    "invoicer": {
51
      "name": {
52
        "given_name": "David",
53
        "surname": "Larusso"
54
      },
55
      "address": {
56
        "address_line_1": "1234 First Street",
57
        "address_line_2": "337673 Hillside Court",
58
        "admin_area_2": "Anytown",
59
        "admin_area_1": "CA",
60
        "postal_code": "98765",
61
        "country_code": "US"
62
      },
63
      "email_address": "merchant@example.com",
64
      "phones": [
65
        {
66
          "country_code": "001",
67
          "national_number": "4085551234",
68
          "phone_type": "MOBILE"
69
        }
70
      ],
71
      "website": "www.test.com",
72
      "tax_id": "ABcNkWSfb5ICTt73nD3QON1fnnpgNKBy-Jb5SeuGj185MNNw6g",
73
      "logo_url": "https://example.com/logo.PNG",
74
      "additional_notes": "2-4"
75
    },
76
    "primary_recipients": [
77
      {
78
        "billing_info": {
79
          "name": {
80
            "given_name": "Stephanie",
81
            "surname": "Meyers"
82
          },
83
          "address": {
84
            "address_line_1": "1234 Main Street",
85
            "admin_area_2": "Anytown",
86
            "admin_area_1": "CA",
87
            "postal_code": "98765",
88
            "country_code": "US"
89
          },
90
          "email_address": "bill-me@example.com",
91
          "phones": [
92
            {
93
              "country_code": "001",
94
              "national_number": "4884551234",
95
              "phone_type": "MOBILE"
96
            }
97
          ],
98
          "additional_info": "add-info"
99
        },
100
        "shipping_info": {
101
          "name": {
102
            "given_name": "Stephanie",
103
            "surname": "Meyers"
104
          },
105
          "address": {
106
            "address_line_1": "1234 Main Street",
107
            "admin_area_2": "Anytown",
108
            "admin_area_1": "CA",
109
            "postal_code": "98765",
110
            "country_code": "US"
111
          }
112
        }
113
      }
114
    ],
115
    "additional_recipients": [
116
      "inform-me@example.com"
117
    ],
118
    "items": [
119
      {
120
        "id": "ITEM-9R873787D1610780X",
121
        "name": "Yoga Mat",
122
        "description": "new watch",
123
        "quantity": "1",
124
        "unit_amount": {
125
          "currency_code": "USD",
126
          "value": "50.00"
127
        },
128
        "tax": {
129
          "id": "TAX-9R873787D1610780X",
130
          "name": "Sales Tax",
131
          "percent": "7.25",
132
          "amount": {
133
            "currency_code": "USD",
134
            "value": "3.27"
135
          }
136
        },
137
        "discount": {
138
          "percent": "5",
139
          "amount": {
140
            "currency_code": "USD",
141
            "value": "2.5"
142
          }
143
        },
144
        "unit_of_measure": "QUANTITY"
145
      },
146
      {
147
        "id": "ITEM-4XD34145EH4061035",
148
        "name": "Yoga T Shirt",
149
        "quantity": "1",
150
        "unit_amount": {
151
          "currency_code": "USD",
152
          "value": "10.00"
153
        },
154
        "tax": {
155
          "id": "TAX-4XD34145EH4061035",
156
          "name": "Sales Tax",
157
          "percent": "7.25",
158
          "amount": {
159
            "currency_code": "USD",
160
            "value": "0.34"
161
          }
162
        },
163
        "discount": {
164
          "amount": {
165
            "currency_code": "USD",
166
            "value": "5.00"
167
          }
168
        },
169
        "unit_of_measure": "QUANTITY"
170
      }
171
    ],
172
    "amount": {
173
      "currency_code": "USD",
174
      "value": "74.21",
175
      "breakdown": {
176
        "item_total": {
177
          "currency_code": "USD",
178
          "value": "60.00"
179
        },
180
        "custom": {
181
          "label": "Packing Charges",
182
          "amount": {
183
            "currency_code": "USD",
184
            "value": "10.00"
185
          }
186
        },
187
        "shipping": {
188
          "amount": {
189
            "currency_code": "USD",
190
            "value": "10.00"
191
          },
192
          "tax": {
193
            "name": "Sales Tax",
194
            "percent": "7.25",
195
            "amount": {
196
              "currency_code": "USD",
197
              "value": "0.73"
198
            }
199
          }
200
        },
201
        "discount": {
202
          "item_discount": {
203
            "currency_code": "USD",
204
            "value": "-7.50"
205
          },
206
          "invoice_discount": {
207
            "percent": "5",
208
            "amount": {
209
              "currency_code": "USD",
210
              "value": "-2.63"
211
            }
212
          }
213
        },
214
        "tax_total": {
215
          "currency_code": "USD",
216
          "value": "4.34"
217
        }
218
      }
219
    }
220
  },
221
  "settings": {
222
    "template_item_settings": [
223
      {
224
        "field_name": "items.date",
225
        "display_preference": {
226
          "hidden": true
227
        }
228
      },
229
      {
230
        "field_name": "items.discount",
231
        "display_preference": {
232
          "hidden": false
233
        }
234
      },
235
      {
236
        "field_name": "items.tax",
237
        "display_preference": {
238
          "hidden": false
239
        }
240
      },
241
      {
242
        "field_name": "items.description",
243
        "display_preference": {
244
          "hidden": false
245
        }
246
      },
247
      {
248
        "field_name": "items.quantity",
249
        "display_preference": {
250
          "hidden": true
251
        }
252
      }
253
    ],
254
    "template_subtotal_settings": [
255
      {
256
        "field_name": "custom",
257
        "display_preference": {
258
          "hidden": false
259
        }
260
      },
261
      {
262
        "field_name": "discount",
263
        "display_preference": {
264
          "hidden": false
265
        }
266
      },
267
      {
268
        "field_name": "shipping",
269
        "display_preference": {
270
          "hidden": false
271
        }
272
      }
273
    ]
274
  },
275
  "unit_of_measure": "QUANTITY",
276
  "standard_template": false,
277
  "links": [
278
    {
279
      "href": "https://api.paypal.com/v2/invoicing/templates/TEMP-19V05281TU309413B",
280
      "rel": "self",
281
      "method": "GET"
282
    },
283
    {
284
      "href": "https://api.paypal.com/v2/invoicing/templates/TEMP-19V05281TU309413B",
285
      "rel": "delete",
286
      "method": "DELETE"
287
    },
288
    {
289
      "href": "https://api.paypal.com/v2/invoicing/templates/TEMP-19V05281TU309413B",
290
      "rel": "replace",
291
      "method": "PUT"
292
    }
293
  ]
294
}', true);
295
    }
296
 
297
    /**
298
     * @return array
299
     */
300
    private function mockListInvoiceTemplateResponse()
301
    {
302
        return Utils::jsonDecode('{
303
  "addresses": [
304
    {
305
      "address_line_1": "1234 First Street",
306
      "address_line_2": "337673 Hillside Court",
307
      "admin_area_2": "Anytown",
308
      "admin_area_1": "CA",
309
      "postal_code": "98765",
310
      "country_code": "US"
311
    },
312
    {
313
      "address_line_1": "26303 E 8216 N",
314
      "address_line_2": "045608 Ocean Bay Plaza #02",
315
      "admin_area_2": "Garden City",
316
      "admin_area_1": "NY",
317
      "postal_code": "11530",
318
      "country_code": "US"
319
    }
320
  ],
321
  "emails": "email@example.com, email2@example.com",
322
  "phones": [
323
    {
324
      "country_code": "001",
325
      "national_number": "4085551234",
326
      "phone_type": "HOME"
327
    },
328
    {
329
      "country_code": "1",
330
      "national_number": "3477832250",
331
      "phone_type": "MOBILE"
332
    },
333
    {
334
      "country_code": "1",
335
      "national_number": "3479543267",
336
      "phone_type": "FAX"
337
    },
338
    {
339
      "country_code": "1",
340
      "national_number": "7183514942",
341
      "phone_type": "OTHER"
342
    }
343
  ],
344
  "templates": [
345
    {
346
      "id": "TEMP-19V05281TU309413B",
347
      "name": "reference-temp",
348
      "default_template": true,
349
      "template_info": {
350
        "configuration": {
351
          "tax_calculated_after_discount": true,
352
          "tax_inclusive": false,
353
          "allow_tip": true,
354
          "partial_payment": {
355
            "allow_partial_payment": true,
356
            "minimum_amount_due": {
357
              "currency_code": "USD",
358
              "value": "20.00"
359
            }
360
          }
361
        },
362
        "detail": {
363
          "reference": "deal-ref",
364
          "currency_code": "USD",
365
          "note": "Thank you for your business.",
366
          "terms_and_conditions": "No refunds after 30 days.",
367
          "memo": "This is a long contract",
368
          "attachments": [
369
            {
370
              "id": "Screen Shot 2018-11-23 at 16.45.01.png",
371
              "reference_url": "https://exxample.com/invoice/payerView/attachments/RkG9ggQbd4Mwm1tYdcF6uuixfFTFq32bBdbE1VbtQLdKSoS2ZOYpfjw9gPp7eTrZmVaFaDWzixHXm-OXWHbmigHigHzURDxJs8IIKqcqP8jawnBEZcraEAPVMULxf5iTyOSpAUc2ugW0PWdwDbM6mg-guFAUyj3Z98H7htWNjQY95jb9heOlcSXUe.sbDUR9smAszzzJoA1NXT6rEEegwQ&version=1&sig=JNODB0xEayW8txMQm6ZsIwDnd4eh3hd6ijiRLi4ipHE"
372
            }
373
          ],
374
          "payment_term": {
375
            "term_type": "NET_10"
376
          },
377
          "metadata": {
378
            "create_time": "2018-12-03T03:38:46z"
379
          }
380
        },
381
        "invoicer": {
382
          "name": {
383
            "given_name": "David",
384
            "surname": "Larusso"
385
          },
386
          "address": {
387
            "address_line_1": "1234 First Street",
388
            "address_line_2": "337673 Hillside Court",
389
            "admin_area_2": "Anytown",
390
            "admin_area_1": "CA",
391
            "postal_code": "98765",
392
            "country_code": "US"
393
          },
394
          "email_address": "merchant@example.com",
395
          "phones": [
396
            {
397
              "country_code": "001",
398
              "national_number": "4085551234",
399
              "phone_type": "MOBILE"
400
            }
401
          ],
402
          "website": "www.test.com",
403
          "tax_id": "ABcNkWSfb5ICTt73nD3QON1fnnpgNKBy-Jb5SeuGj185MNNw6g",
404
          "logo_url": "https://example.com/logo.PNG",
405
          "additional_notes": "2-4"
406
        },
407
        "primary_recipients": [
408
          {
409
            "billing_info": {
410
              "name": {
411
                "given_name": "Stephanie",
412
                "surname": "Meyers"
413
              },
414
              "address": {
415
                "address_line_1": "1234 Main Street",
416
                "admin_area_2": "Anytown",
417
                "admin_area_1": "CA",
418
                "postal_code": "98765",
419
                "country_code": "US"
420
              },
421
              "email_address": "bill-me@example.com",
422
              "phones": [
423
                {
424
                  "country_code": "001",
425
                  "national_number": "4884551234",
426
                  "phone_type": "MOBILE"
427
                }
428
              ],
429
              "additional_info": "add-info"
430
            },
431
            "shipping_info": {
432
              "name": {
433
                "given_name": "Stephanie",
434
                "surname": "Meyers"
435
              },
436
              "address": {
437
                "address_line_1": "1234 Main Street",
438
                "admin_area_2": "Anytown",
439
                "admin_area_1": "CA",
440
                "postal_code": "98765",
441
                "country_code": "US"
442
              }
443
            }
444
          }
445
        ],
446
        "additional_recipients": [
447
          "inform-me@example.com"
448
        ],
449
        "items": [
450
          {
451
            "id": "ITEM-9R873787D1610780X",
452
            "name": "Yoga Mat",
453
            "description": "new watch",
454
            "quantity": "1",
455
            "unit_amount": {
456
              "currency_code": "USD",
457
              "value": "50.00"
458
            },
459
            "tax": {
460
              "id": "TAX-9R873787D1610780X",
461
              "name": "Sales Tax",
462
              "percent": "7.25",
463
              "amount": {
464
                "currency_code": "USD",
465
                "value": "3.27"
466
              }
467
            },
468
            "discount": {
469
              "percent": "5",
470
              "amount": {
471
                "currency_code": "USD",
472
                "value": "2.5"
473
              }
474
            },
475
            "unit_of_measure": "QUANTITY"
476
          },
477
          {
478
            "id": "ITEM-4XD34145EH4061035",
479
            "name": "Yoga t-shirt",
480
            "quantity": "1",
481
            "unit_amount": {
482
              "currency_code": "USD",
483
              "value": "10.00"
484
            },
485
            "tax": {
486
              "id": "TAX-4XD34145EH4061035",
487
              "name": "Sales Tax",
488
              "percent": "7.25",
489
              "amount": {
490
                "currency_code": "USD",
491
                "value": "0.34"
492
              }
493
            },
494
            "discount": {
495
              "amount": {
496
                "currency_code": "USD",
497
                "value": "5.00"
498
              }
499
            },
500
            "unit_of_measure": "QUANTITY"
501
          }
502
        ],
503
        "amount": {
504
          "currency_code": "USD",
505
          "value": "74.21",
506
          "breakdown": {
507
            "item_total": {
508
              "currency_code": "USD",
509
              "value": "60.00"
510
            },
511
            "custom": {
512
              "label": "Packing Charges",
513
              "amount": {
514
                "currency_code": "USD",
515
                "value": "10.00"
516
              }
517
            },
518
            "shipping": {
519
              "amount": {
520
                "currency_code": "USD",
521
                "value": "10.00"
522
              },
523
              "tax": {
524
                "name": "Sales Tax",
525
                "percent": "7.25",
526
                "amount": {
527
                  "currency_code": "USD",
528
                  "value": "0.73"
529
                }
530
              }
531
            },
532
            "discount": {
533
              "item_discount": {
534
                "currency_code": "USD",
535
                "value": "-7.50"
536
              },
537
              "invoice_discount": {
538
                "percent": "5",
539
                "amount": {
540
                  "currency_code": "USD",
541
                  "value": "-2.63"
542
                }
543
              }
544
            },
545
            "tax_total": {
546
              "currency_code": "USD",
547
              "value": "4.34"
548
            }
549
          }
550
        }
551
      },
552
      "settings": {
553
        "template_item_settings": [
554
          {
555
            "field_name": "items.date",
556
            "display_preference": {
557
              "hidden": true
558
            }
559
          },
560
          {
561
            "field_name": "items.discount",
562
            "display_preference": {
563
              "hidden": false
564
            }
565
          },
566
          {
567
            "field_name": "items.tax",
568
            "display_preference": {
569
              "hidden": false
570
            }
571
          },
572
          {
573
            "field_name": "items.description",
574
            "display_preference": {
575
              "hidden": false
576
            }
577
          },
578
          {
579
            "field_name": "items.quantity",
580
            "display_preference": {
581
              "hidden": true
582
            }
583
          }
584
        ],
585
        "template_subtotal_settings": [
586
          {
587
            "field_name": "custom",
588
            "display_preference": {
589
              "hidden": false
590
            }
591
          },
592
          {
593
            "field_name": "discount",
594
            "display_preference": {
595
              "hidden": false
596
            }
597
          },
598
          {
599
            "field_name": "shipping",
600
            "display_preference": {
601
              "hidden": false
602
            }
603
          }
604
        ]
605
      },
606
      "unit_of_measure": "QUANTITY",
607
      "standard_template": false,
608
      "links": [
609
        {
610
          "href": "https://api.paypal.com/v2/invoicing/templates/TEMP-19V05281TU309413B",
611
          "rel": "self",
612
          "method": "GET"
613
        }
614
      ]
615
    },
616
    {
617
      "default_template": true,
618
      "id": "TEMP-11E67842VH3080617",
619
      "name": "Quantity",
620
      "template_info": {
621
        "invoicer": {
622
          "name": {
623
            "given_name": "David",
624
            "surname": "Larusso"
625
          },
626
          "email_address": "bill-me@example.com"
627
        },
628
        "detail": {
629
          "currency_code": "USD"
630
        }
631
      },
632
      "standard_template": false,
633
      "links": [
634
        {
635
          "href": "https://api.paypal.com/v2/invoicing/templates/TEMP-11E67842VH3080617",
636
          "rel": "self",
637
          "method": "GET"
638
        }
639
      ]
640
    },
641
    {
642
      "default_template": false,
643
      "id": "TEMP-6HC14139B8663074X",
644
      "name": "Hours",
645
      "template_info": {
646
        "invoicer": {
647
          "name": {
648
            "given_name": "David",
649
            "surname": "Larusso"
650
          },
651
          "email_address": "bill-me@example.com"
652
        },
653
        "detail": {
654
          "currency_code": "USD"
655
        }
656
      },
657
      "standard_template": false,
658
      "links": [
659
        {
660
          "href": "https://api.paypal.com/v2/invoicing/templates/TEMP-6HC14139B8663074X",
661
          "rel": "self",
662
          "method": "GET"
663
        }
664
      ]
665
    }
666
  ]
667
}', true);
668
    }
669
 
670
    /**
671
     * @return array
672
     */
673
    private function mockUpdateInvoiceTemplateResponse()
674
    {
675
        return Utils::jsonDecode('{
676
  "id": "TEMP-19V05281TU309413B",
677
  "name": "reference-temp",
678
  "default_template": true,
679
  "template_info": {
680
    "configuration": {
681
      "tax_calculated_after_discount": true,
682
      "tax_inclusive": false,
683
      "allow_tip": true,
684
      "partial_payment": {
685
        "allow_partial_payment": true,
686
        "minimum_amount_due": {
687
          "currency_code": "USD",
688
          "value": "20.00"
689
        }
690
      }
691
    },
692
    "detail": {
693
      "reference": "deal-reference-value",
694
      "currency_code": "USD",
695
      "note": "Thank you for your business.",
696
      "terms_and_conditions": "No refunds after 30 days.",
697
      "memo": "This is a long contract",
698
      "attachments": [
699
        {
700
          "id": "Screen Shot 2018-11-23 at 16.45.01.png",
701
          "reference_url": "https://api.paypal.com/invoice/payerView/attachments/RkG9ggQbd4Mwm1tYdcF6uuixfFTFq32bBdbE1VbtQLdKSoS2ZOYpfjw9gPp7eTrZmVaFaDWzixHXm-OXWHbmigHigHzURDxJs8IIKqcqP8jawnBEZcraEAPVMULxf5iTyOSpAUc2ugW0PWdwDbM6mg-guFAUyj3Z98H7htWNjQY95jb9heOlcSXUe.sbDUR9smAszzzJoA1NXT6rEEegwQ&version=1&sig=JNODB0xEayW8txMQm6ZsIwDnd4eh3hd6ijiRLi4ipHE"
702
        }
703
      ],
704
      "payment_term": {
705
        "term_type": "NET_10"
706
      },
707
      "metadata": {
708
        "create_time": "2018-12-03T03:38:46z"
709
      }
710
    },
711
    "invoicer": {
712
      "name": {
713
        "given_name": "David",
714
        "surname": "Larusso"
715
      },
716
      "address": {
717
        "address_line_1": "1234 First Street",
718
        "address_line_2": "337673 Hillside Court",
719
        "admin_area_2": "Anytown",
720
        "admin_area_1": "CA",
721
        "postal_code": "98765",
722
        "country_code": "US"
723
      },
724
      "email_address": "merchant@example.com",
725
      "phones": [
726
        {
727
          "country_code": "001",
728
          "national_number": "4085551234",
729
          "phone_type": "MOBILE"
730
        }
731
      ],
732
      "website": "www.test.com",
733
      "tax_id": "ABcNkWSfb5ICTt73nD3QON1fnnpgNKBy-Jb5SeuGj185MNNw6g",
734
      "logo_url": "https://example.com/logo.PNG",
735
      "additional_notes": "2-4"
736
    },
737
    "primary_recipients": [
738
      {
739
        "billing_info": {
740
          "name": {
741
            "given_name": "Stephanie",
742
            "surname": "Meyers"
743
          },
744
          "address": {
745
            "address_line_1": "1234 Main Street",
746
            "admin_area_2": "Anytown",
747
            "admin_area_1": "CA",
748
            "postal_code": "98765",
749
            "country_code": "US"
750
          },
751
          "email_address": "bill-me@example.com",
752
          "phones": [
753
            {
754
              "country_code": "001",
755
              "national_number": "4884551234",
756
              "phone_type": "MOBILE"
757
            }
758
          ],
759
          "additional_info": "add-info"
760
        },
761
        "shipping_info": {
762
          "name": {
763
            "given_name": "Stephanie",
764
            "surname": "Meyers"
765
          },
766
          "address": {
767
            "address_line_1": "1234 Main Street",
768
            "admin_area_2": "Anytown",
769
            "admin_area_1": "CA",
770
            "postal_code": "98765",
771
            "country_code": "US"
772
          }
773
        }
774
      }
775
    ],
776
    "additional_recipients": [
777
      "inform-me@example.com"
778
    ],
779
    "items": [
780
      {
781
        "id": "ITEM-9R873787D1610780X",
782
        "name": "Yoga Mat",
783
        "description": "new watch",
784
        "quantity": "1",
785
        "unit_amount": {
786
          "currency_code": "USD",
787
          "value": "50.00"
788
        },
789
        "tax": {
790
          "id": "TAX-9R873787D1610780X",
791
          "name": "Sales Tax",
792
          "percent": "7.25",
793
          "amount": {
794
            "currency_code": "USD",
795
            "value": "3.27"
796
          }
797
        },
798
        "discount": {
799
          "percent": "5",
800
          "amount": {
801
            "currency_code": "USD",
802
            "value": "2.5"
803
          }
804
        },
805
        "unit_of_measure": "QUANTITY"
806
      },
807
      {
808
        "id": "ITEM-4XD34145EH4061035",
809
        "name": "Yoga T Shirt",
810
        "quantity": "1",
811
        "unit_amount": {
812
          "currency_code": "USD",
813
          "value": "10.00"
814
        },
815
        "tax": {
816
          "id": "TAX-4XD34145EH4061035",
817
          "name": "Sales Tax",
818
          "percent": "7.25",
819
          "amount": {
820
            "currency_code": "USD",
821
            "value": "0.34"
822
          }
823
        },
824
        "discount": {
825
          "amount": {
826
            "currency_code": "USD",
827
            "value": "5.00"
828
          }
829
        },
830
        "unit_of_measure": "QUANTITY"
831
      }
832
    ],
833
    "amount": {
834
      "currency_code": "USD",
835
      "value": "74.21",
836
      "breakdown": {
837
        "item_total": {
838
          "currency_code": "USD",
839
          "value": "60.00"
840
        },
841
        "custom": {
842
          "label": "Packing Charges",
843
          "amount": {
844
            "currency_code": "USD",
845
            "value": "10.00"
846
          }
847
        },
848
        "shipping": {
849
          "amount": {
850
            "currency_code": "USD",
851
            "value": "10.00"
852
          },
853
          "tax": {
854
            "name": "Sales Tax",
855
            "percent": "7.25",
856
            "amount": {
857
              "currency_code": "USD",
858
              "value": "0.73"
859
            }
860
          }
861
        },
862
        "discount": {
863
          "item_discount": {
864
            "currency_code": "USD",
865
            "value": "-7.50"
866
          },
867
          "invoice_discount": {
868
            "percent": "5",
869
            "amount": {
870
              "currency_code": "USD",
871
              "value": "-2.63"
872
            }
873
          }
874
        },
875
        "tax_total": {
876
          "currency_code": "USD",
877
          "value": "4.34"
878
        }
879
      }
880
    }
881
  },
882
  "settings": {
883
    "template_item_settings": [
884
      {
885
        "field_name": "items.date",
886
        "display_preference": {
887
          "hidden": true
888
        }
889
      },
890
      {
891
        "field_name": "items.discount",
892
        "display_preference": {
893
          "hidden": false
894
        }
895
      },
896
      {
897
        "field_name": "items.tax",
898
        "display_preference": {
899
          "hidden": false
900
        }
901
      },
902
      {
903
        "field_name": "items.description",
904
        "display_preference": {
905
          "hidden": false
906
        }
907
      },
908
      {
909
        "field_name": "items.quantity",
910
        "display_preference": {
911
          "hidden": true
912
        }
913
      }
914
    ],
915
    "template_subtotal_settings": [
916
      {
917
        "field_name": "custom",
918
        "display_preference": {
919
          "hidden": false
920
        }
921
      },
922
      {
923
        "field_name": "discount",
924
        "display_preference": {
925
          "hidden": false
926
        }
927
      },
928
      {
929
        "field_name": "shipping",
930
        "display_preference": {
931
          "hidden": false
932
        }
933
      }
934
    ]
935
  },
936
  "unit_of_measure": "QUANTITY",
937
  "standard_template": false,
938
  "links": [
939
    {
940
      "href": "https://api.paypal.com/v2/invoicing/templates/TEMP-19V05281TU309413B",
941
      "rel": "self",
942
      "method": "GET"
943
    },
944
    {
945
      "href": "https://api.paypal.com/v2/invoicing/templates/TEMP-19V05281TU309413B",
946
      "rel": "delete",
947
      "method": "DELETE"
948
    },
949
    {
950
      "href": "https://api.paypal.com/v2/invoicing/templates/TEMP-19V05281TU309413B",
951
      "rel": "replace",
952
      "method": "PUT"
953
    }
954
  ]
955
}', true);
956
    }
957
 
958
    /**
959
     * @return array
960
     */
961
    private function mockGetInvoiceTemplateResponse()
962
    {
963
        return Utils::jsonDecode('{
964
  "id": "TEMP-19V05281TU309413B",
965
  "name": "reference-temp",
966
  "default_template": true,
967
  "template_info": {
968
    "configuration": {
969
      "tax_calculated_after_discount": true,
970
      "tax_inclusive": false,
971
      "allow_tip": true,
972
      "partial_payment": {
973
        "allow_partial_payment": true,
974
        "minimum_amount_due": {
975
          "currency_code": "USD",
976
          "value": "20.00"
977
        }
978
      }
979
    },
980
    "detail": {
981
      "reference": "deal-ref",
982
      "currency_code": "USD",
983
      "note": "Thank you for your business.",
984
      "terms_and_conditions": "No refunds after 30 days.",
985
      "memo": "This is a long contract",
986
      "attachments": [
987
        {
988
          "id": "Screen Shot 2018-11-23 at 16.45.01.png",
989
          "reference_url": "https://api.paypal.com/invoice/payerView/attachments/RkG9ggQbd4Mwm1tYdcF6uuixfFTFq32bBdbE1VbtQLdKSoS2ZOYpfjw9gPp7eTrZmVaFaDWzixHXm-OXWHbmigHigHzURDxJs8IIKqcqP8jawnBEZcraEAPVMULxf5iTyOSpAUc2ugW0PWdwDbM6mg-guFAUyj3Z98H7htWNjQY95jb9heOlcSXUe.sbDUR9smAszzzJoA1NXT6rEEegwQ&version=1&sig=JNODB0xEayW8txMQm6ZsIwDnd4eh3hd6ijiRLi4ipHE"
990
        }
991
      ],
992
      "payment_term": {
993
        "term_type": "NET_10"
994
      },
995
      "metadata": {
996
        "create_time": "2018-12-03T03:38:46z"
997
      }
998
    },
999
    "invoicer": {
1000
      "name": {
1001
        "given_name": "David",
1002
        "surname": "Larusso"
1003
      },
1004
      "address": {
1005
        "address_line_1": "1234 First Street",
1006
        "address_line_2": "337673 Hillside Court",
1007
        "admin_area_2": "Anytown",
1008
        "admin_area_1": "CA",
1009
        "postal_code": "98765",
1010
        "country_code": "US"
1011
      },
1012
      "email_address": "merchant@example.com",
1013
      "phones": [
1014
        {
1015
          "country_code": "001",
1016
          "national_number": "4085551234",
1017
          "phone_type": "MOBILE"
1018
        }
1019
      ],
1020
      "website": "www.test.com",
1021
      "tax_id": "ABcNkWSfb5ICTt73nD3QON1fnnpgNKBy-Jb5SeuGj185MNNw6g",
1022
      "logo_url": "https://example.com/logo.PNG",
1023
      "additional_notes": "2-4"
1024
    },
1025
    "primary_recipients": [
1026
      {
1027
        "billing_info": {
1028
          "name": {
1029
            "given_name": "Stephanie",
1030
            "surname": "Meyers"
1031
          },
1032
          "address": {
1033
            "address_line_1": "1234 Main Street",
1034
            "admin_area_2": "Anytown",
1035
            "admin_area_1": "CA",
1036
            "postal_code": "98765",
1037
            "country_code": "US"
1038
          },
1039
          "email_address": "bill-me@example.com",
1040
          "phones": [
1041
            {
1042
              "country_code": "001",
1043
              "national_number": "4884551234",
1044
              "phone_type": "MOBILE"
1045
            }
1046
          ],
1047
          "additional_info": "add-info"
1048
        },
1049
        "shipping_info": {
1050
          "name": {
1051
            "given_name": "Stephanie",
1052
            "surname": "Meyers"
1053
          },
1054
          "address": {
1055
            "address_line_1": "1234 Main Street",
1056
            "admin_area_2": "Anytown",
1057
            "admin_area_1": "CA",
1058
            "postal_code": "98765",
1059
            "country_code": "US"
1060
          }
1061
        }
1062
      }
1063
    ],
1064
    "additional_recipients": [
1065
      "inform-me@example.com"
1066
    ],
1067
    "items": [
1068
      {
1069
        "id": "ITEM-9R873787D1610780X",
1070
        "name": "Yoga Mat",
1071
        "description": "new watch",
1072
        "quantity": "1",
1073
        "unit_amount": {
1074
          "currency_code": "USD",
1075
          "value": "50.00"
1076
        },
1077
        "tax": {
1078
          "id": "TAX-9R873787D1610780X",
1079
          "name": "Sales Tax",
1080
          "percent": "7.25",
1081
          "amount": {
1082
            "currency_code": "USD",
1083
            "value": "3.27"
1084
          }
1085
        },
1086
        "discount": {
1087
          "percent": "5",
1088
          "amount": {
1089
            "currency_code": "USD",
1090
            "value": "2.5"
1091
          }
1092
        },
1093
        "unit_of_measure": "QUANTITY"
1094
      },
1095
      {
1096
        "id": "ITEM-4XD34145EH4061035",
1097
        "name": "Yoga T Shirt",
1098
        "quantity": "1",
1099
        "unit_amount": {
1100
          "currency_code": "USD",
1101
          "value": "10.00"
1102
        },
1103
        "tax": {
1104
          "id": "TAX-4XD34145EH4061035",
1105
          "name": "Sales Tax",
1106
          "percent": "7.25",
1107
          "amount": {
1108
            "currency_code": "USD",
1109
            "value": "0.34"
1110
          }
1111
        },
1112
        "discount": {
1113
          "amount": {
1114
            "currency_code": "USD",
1115
            "value": "5.00"
1116
          }
1117
        },
1118
        "unit_of_measure": "QUANTITY"
1119
      }
1120
    ],
1121
    "amount": {
1122
      "currency_code": "USD",
1123
      "value": "74.21",
1124
      "breakdown": {
1125
        "item_total": {
1126
          "currency_code": "USD",
1127
          "value": "60.00"
1128
        },
1129
        "custom": {
1130
          "label": "Packing Charges",
1131
          "amount": {
1132
            "currency_code": "USD",
1133
            "value": "10.00"
1134
          }
1135
        },
1136
        "shipping": {
1137
          "amount": {
1138
            "currency_code": "USD",
1139
            "value": "10.00"
1140
          },
1141
          "tax": {
1142
            "name": "Sales Tax",
1143
            "percent": "7.25",
1144
            "amount": {
1145
              "currency_code": "USD",
1146
              "value": "0.73"
1147
            }
1148
          }
1149
        },
1150
        "discount": {
1151
          "item_discount": {
1152
            "currency_code": "USD",
1153
            "value": "-7.50"
1154
          },
1155
          "invoice_discount": {
1156
            "percent": "5",
1157
            "amount": {
1158
              "currency_code": "USD",
1159
              "value": "-2.63"
1160
            }
1161
          }
1162
        },
1163
        "tax_total": {
1164
          "currency_code": "USD",
1165
          "value": "4.34"
1166
        }
1167
      }
1168
    }
1169
  },
1170
  "settings": {
1171
    "template_item_settings": [
1172
      {
1173
        "field_name": "items.date",
1174
        "display_preference": {
1175
          "hidden": true
1176
        }
1177
      },
1178
      {
1179
        "field_name": "items.discount",
1180
        "display_preference": {
1181
          "hidden": false
1182
        }
1183
      },
1184
      {
1185
        "field_name": "items.tax",
1186
        "display_preference": {
1187
          "hidden": false
1188
        }
1189
      },
1190
      {
1191
        "field_name": "items.description",
1192
        "display_preference": {
1193
          "hidden": false
1194
        }
1195
      },
1196
      {
1197
        "field_name": "items.quantity",
1198
        "display_preference": {
1199
          "hidden": true
1200
        }
1201
      }
1202
    ],
1203
    "template_subtotal_settings": [
1204
      {
1205
        "field_name": "custom",
1206
        "display_preference": {
1207
          "hidden": false
1208
        }
1209
      },
1210
      {
1211
        "field_name": "discount",
1212
        "display_preference": {
1213
          "hidden": false
1214
        }
1215
      },
1216
      {
1217
        "field_name": "shipping",
1218
        "display_preference": {
1219
          "hidden": false
1220
        }
1221
      }
1222
    ]
1223
  },
1224
  "unit_of_measure": "QUANTITY",
1225
  "standard_template": false,
1226
  "links": [
1227
    {
1228
      "href": "https://api.paypal.com/v2/invoicing/templates/TEMP-19V05281TU309413B",
1229
      "rel": "self",
1230
      "method": "GET"
1231
    },
1232
    {
1233
      "href": "https://api.paypal.com/v2/invoicing/templates/TEMP-19V05281TU309413B",
1234
      "rel": "delete",
1235
      "method": "DELETE"
1236
    },
1237
    {
1238
      "href": "https://api.paypal.com/v2/invoicing/templates/TEMP-19V05281TU309413B",
1239
      "rel": "replace",
1240
      "method": "PUT"
1241
    }
1242
  ]
1243
}', true);
1244
    }
1245
}