PaymentExperienceWebProfiles.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. namespace Srmklive\PayPal\Tests\Mocks\Responses;
  3. use GuzzleHttp\Utils;
  4. trait PaymentExperienceWebProfiles
  5. {
  6. /**
  7. * @return array
  8. */
  9. private function mockListWebProfilesResponse(): 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 mockWebProfileResponse(): array
  62. {
  63. return Utils::jsonDecode('{
  64. "id": "XP-RFV4-PVD8-AGHJ-8E5J",
  65. "name": "exampleProfile",
  66. "temporary": false,
  67. "presentation": {
  68. "logo_image": "https://example.com/logo_image/"
  69. },
  70. "input_fields": {
  71. "no_shipping": 1,
  72. "address_override": 1
  73. },
  74. "flow_config": {
  75. "landing_page_type": "billing",
  76. "bank_txn_pending_url": "https://example.com/flow_config/",
  77. "user_action": "commit"
  78. }
  79. }', true);
  80. }
  81. }