PaymentExperienceWebProfiles.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?php
  2. namespace Srmklive\PayPal\Tests\Mocks\Requests;
  3. use GuzzleHttp\Utils;
  4. trait PaymentExperienceWebProfiles
  5. {
  6. /**
  7. * @return array
  8. */
  9. private function mockCreateWebProfileParams(): array
  10. {
  11. return Utils::jsonDecode('[
  12. {
  13. "id": "XP-GCUV-X35G-HNEY-5MJY",
  14. "name": "exampleProfile",
  15. "flow_config": {
  16. "landing_page_type": "billing",
  17. "bank_txn_pending_url": "https://example.com/flow_config/"
  18. },
  19. "input_fields": {
  20. "no_shipping": 1,
  21. "address_override": 1
  22. },
  23. "presentation": {
  24. "logo_image": "https://example.com/logo_image/"
  25. }
  26. },
  27. {
  28. "id": "XP-A88A-LYLW-8Y3X-E5ER",
  29. "name": "exampleProfile",
  30. "flow_config": {
  31. "landing_page_type": "billing",
  32. "bank_txn_pending_url": "https://example.com/flow_config/"
  33. },
  34. "input_fields": {
  35. "no_shipping": 1,
  36. "address_override": 1
  37. },
  38. "presentation": {
  39. "logo_image": "https://example.com/logo_image/"
  40. }
  41. },
  42. {
  43. "id": "XP-RFV4-PVD8-AGHJ-8E5J",
  44. "name": "exampleProfile",
  45. "flow_config": {
  46. "bank_txn_pending_url": "https://example.com/flow_config/"
  47. },
  48. "input_fields": {
  49. "no_shipping": 1,
  50. "address_override": 1
  51. },
  52. "presentation": {
  53. "logo_image": "https://example.com/logo_image/"
  54. }
  55. }
  56. ]', true);
  57. }
  58. /**
  59. * @return array
  60. */
  61. private function partiallyUpdateWebProfileParams(): array
  62. {
  63. return Utils::jsonDecode('[
  64. {
  65. "op": "add",
  66. "path": "/presentation/brand_name",
  67. "value": "new_brand_name"
  68. },
  69. {
  70. "op": "remove",
  71. "path": "/flow_config/landing_page_type"
  72. }
  73. ]', true);
  74. }
  75. /**
  76. * @return array
  77. */
  78. private function updateWebProfileParams(): array
  79. {
  80. return Utils::jsonDecode('{
  81. "name": "exampleProfile",
  82. "presentation": {
  83. "logo_image": "https://example.com/logo_image/"
  84. },
  85. "input_fields": {
  86. "no_shipping": 1,
  87. "address_override": 1
  88. },
  89. "flow_config": {
  90. "landing_page_type": "billing",
  91. "bank_txn_pending_url": "https://example.com/flow_config/"
  92. }
  93. }', true);
  94. }
  95. }