Identity.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <?php
  2. namespace Srmklive\PayPal\Tests\Mocks\Responses;
  3. use GuzzleHttp\Utils;
  4. trait Identity
  5. {
  6. private function mockShowProfileInfoResponse(): array
  7. {
  8. return Utils::jsonDecode('{
  9. "address": {
  10. "street_address": "7917394 Annursnac Hill Road Unit 0C",
  11. "locality": "Ventura",
  12. "region": "CA",
  13. "postal_code": "93003",
  14. "country": "US"
  15. }
  16. }', true);
  17. }
  18. private function mocklistUsersResponse(): array
  19. {
  20. return Utils::jsonDecode('{
  21. "schemas": [
  22. "http://example.com"
  23. ],
  24. "startIndex": 1,
  25. "itemsPerPage": 1,
  26. "totalResults": 5000,
  27. "Resources": [
  28. {
  29. "schemas": [
  30. "http://example.com"
  31. ],
  32. "externalId": "string",
  33. "userName": "string",
  34. "name": {
  35. "familyName": "string",
  36. "givenName": "string",
  37. "middleName": "string",
  38. "honorificPrefix": "string",
  39. "honorificSuffix": "string"
  40. },
  41. "active": true,
  42. "emails": [
  43. {
  44. "type": "work",
  45. "primary": true,
  46. "value": "string"
  47. }
  48. ],
  49. "phoneNumbers": [
  50. {
  51. "value": "string",
  52. "type": "work",
  53. "primary": true
  54. }
  55. ],
  56. "addresses": [
  57. {
  58. "streetAddress": "string",
  59. "locality": "string",
  60. "region": "string",
  61. "postalCode": "string",
  62. "type": "work",
  63. "country": "string"
  64. }
  65. ],
  66. "entitlements": [
  67. {
  68. "value": "string"
  69. }
  70. ],
  71. "id": "string",
  72. "meta": {
  73. "resourceType": "User",
  74. "location": "http://example.com",
  75. "created": "string",
  76. "lastModified": "string"
  77. },
  78. "preferredLanguage": "string",
  79. "timezone": "string"
  80. }
  81. ]
  82. }', true);
  83. }
  84. private function mocklistUserResponse(): array
  85. {
  86. return Utils::jsonDecode('{
  87. "schemas": [
  88. "http://example.com"
  89. ],
  90. "externalId": "string",
  91. "userName": "string",
  92. "name": {
  93. "familyName": "string",
  94. "givenName": "string",
  95. "middleName": "string",
  96. "honorificPrefix": "string",
  97. "honorificSuffix": "string"
  98. },
  99. "active": true,
  100. "emails": [
  101. {
  102. "type": "work",
  103. "primary": true,
  104. "value": "string"
  105. }
  106. ],
  107. "phoneNumbers": [
  108. {
  109. "value": "string",
  110. "type": "work",
  111. "primary": true
  112. }
  113. ],
  114. "addresses": [
  115. {
  116. "streetAddress": "string",
  117. "locality": "string",
  118. "region": "string",
  119. "postalCode": "string",
  120. "type": "work",
  121. "country": "string"
  122. }
  123. ],
  124. "entitlements": [
  125. {
  126. "value": "string"
  127. }
  128. ],
  129. "id": "string",
  130. "meta": {
  131. "resourceType": "User",
  132. "location": "http://example.com",
  133. "created": "string",
  134. "lastModified": "string"
  135. },
  136. "preferredLanguage": "string",
  137. "timezone": "string"
  138. }', true);
  139. }
  140. private function mockCreateMerchantApplicationResponse(): array
  141. {
  142. return Utils::jsonDecode('{
  143. "client_id": "AeTeCqaPp7JZBfUUb2d21cQ2KqyQGVhonfiUOJu99kgLhFFSrE59ruvhLOT4K3NzQoErgsUH6MY9uRqD",
  144. "client_secret": "cf136dc3c1fc93f31185e5885805d",
  145. "client_id_issued_at": 2893256800,
  146. "client_secret_expires_at": 2893276800,
  147. "redirect_uris": [
  148. "https://example.com/callback",
  149. "https://example.com/callback2"
  150. ],
  151. "grant_types": [
  152. "authorization_code",
  153. "refresh_token"
  154. ],
  155. "client_name": "AGGREGATOR",
  156. "logo_uri": "https://example.com/logo.png",
  157. "contacts": [
  158. "facilitator@example.com",
  159. "merchant@example.com"
  160. ],
  161. "policy_uri": "https://example.com/policyuri",
  162. "tos_uri": "https://example.com/tosuri",
  163. "scope": "profile email address",
  164. "token_endpoint_auth_method": "client_secret_basic",
  165. "jwks_uri": "https://example.com/my_public_keys.jwks"
  166. }', true);
  167. }
  168. private function mockGetClientTokenResponse(): array
  169. {
  170. return Utils::jsonDecode('{
  171. "client_token": "eyJicmFpbnRyZWUiOnsiYXV0aG9yaXphdGlvbkZpbmdlcnByaW50IjoiYjA0MWE2M2JlMTM4M2NlZGUxZTI3OWFlNDlhMWIyNzZlY2FjOTYzOWU2NjlhMGIzODQyYTdkMTY3NzcwYmY0OHxtZXJjaGFudF9pZD1yd3dua3FnMnhnNTZobTJuJnB1YmxpY19rZXk9czlic3BuaGtxMmYzaDk0NCZjcmVhdGVkX2F0PTIwMTgtMTEtMTRUMTE6MTg6MDAuMTU3WiIsInZlcnNpb24iOiIzLXBheXBhbCJ9LCJwYXlwYWwiOnsiYWNjZXNzVG9rZW4iOiJBMjFBQUhNVExyMmctVDlhSTJacUZHUmlFZ0ZFZGRHTGwxTzRlX0lvdk9ESVg2Q3pSdW5BVy02TzI2MjdiWUJ2cDNjQ0FNWi1lTFBNc2NDWnN0bDUyNHJyUGhUQklJNlBBIn19",
  172. "expires_in": 3600
  173. }', true);
  174. }
  175. }