Orders.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace Srmklive\PayPal\Tests\Mocks\Requests;
  3. use GuzzleHttp\Utils;
  4. trait Orders
  5. {
  6. /*
  7. * @return array
  8. */
  9. private function createOrderParams(): array
  10. {
  11. return Utils::jsonDecode('{
  12. "intent": "CAPTURE",
  13. "purchase_units": [
  14. {
  15. "amount": {
  16. "currency_code": "USD",
  17. "value": "100.00"
  18. }
  19. }
  20. ]
  21. }', true);
  22. }
  23. /*
  24. * @return array
  25. */
  26. private function updateOrderParams(): array
  27. {
  28. return Utils::jsonDecode('[
  29. {
  30. "op": "replace",
  31. "path": "/purchase_units/@reference_id==\'PUHF\'/shipping/address",
  32. "value": {
  33. "address_line_1": "123 Townsend St",
  34. "address_line_2": "Floor 6",
  35. "admin_area_2": "San Francisco",
  36. "admin_area_1": "CA",
  37. "postal_code": "94107",
  38. "country_code": "US"
  39. }
  40. }
  41. ]', true);
  42. }
  43. }