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 PartnerReferrals
8
{
9
    private function mockCreatePartnerReferralsResponse(): array
10
    {
11
        return Utils::jsonDecode('{
12
  "links": [
13
    {
14
      "href": "https://uri.paypal.com/v2/customer/partner-referrals/ZjcyODU4ZWYtYTA1OC00ODIwLTk2M2EtOTZkZWQ4NmQwYzI3RU12cE5xa0xMRmk1NWxFSVJIT1JlTFdSbElCbFU1Q3lhdGhESzVQcU9iRT0=",
15
      "rel": "self",
16
      "method": "GET"
17
    },
18
    {
19
      "href": "https://www.paypal.com/merchantsignup/partner/onboardingentry?token=ZjcyODU4ZWYtYTA1OC00ODIwLTk2M2EtOTZkZWQ4NmQwYzI3RU12cE5xa0xMRmk1NWxFSVJIT1JlTFdSbElCbFU1Q3lhdGhESzVQcU9iRT0=",
20
      "rel": "action_url",
21
      "method": "GET"
22
    }
23
  ]
24
}', true);
25
    }
26
 
27
    private function mockShowReferralDataResponse(): array
28
    {
29
        return Utils::jsonDecode('{
30
  "partner_referral_id": "ZjcyODU4ZWYtYTA1OC00ODIwLTk2M2EtOTZkZWQ4NmQwYzI3RU12cE5xa0xMRmk1NWxFSVJIT1JlTFdSbElCbFU1Q3lhdGhESzVQcU9iRT0=",
31
  "submitter_payer_id": "RFYUH2QQDGUQU",
32
  "referral_data": {
33
    "individual_owners": [
34
      {
35
        "names": [
36
          {
37
            "prefix": "Mr.",
38
            "given_name": "John",
39
            "surname": "Doe",
40
            "middle_name": "Middle",
41
            "suffix": "Jr.",
42
            "full_name": "John Middle Doe Jr.",
43
            "type": "LEGAL"
44
          }
45
        ],
46
        "citizenship": "US",
47
        "addresses": [
48
          {
49
            "address_line_1": "One Washington Square",
50
            "address_line_2": "Apt 123",
51
            "admin_area_2": "San Jose",
52
            "admin_area_1": "CA",
53
            "postal_code": "95112",
54
            "country_code": "US",
55
            "type": "HOME"
56
          }
57
        ],
58
        "phones": [
59
          {
60
            "country_code": "1",
61
            "national_number": "6692468839",
62
            "extension_number": "1234",
63
            "type": "MOBILE"
64
          }
65
        ],
66
        "birth_details": {
67
          "date_of_birth": "1955-12-29"
68
        },
69
        "type": "PRIMARY"
70
      }
71
    ],
72
    "business_entity": {
73
      "business_type": {
74
        "type": "INDIVIDUAL",
75
        "subtype": "ASSO_TYPE_INCORPORATED"
76
      },
77
      "business_industry": {
78
        "category": "1004",
79
        "mcc_code": "2025",
80
        "subcategory": "8931"
81
      },
82
      "business_incorporation": {
83
        "incorporation_country_code": "US",
84
        "incorporation_date": "1986-12-29"
85
      },
86
      "names": [
87
        {
88
          "business_name": "Test Enterprise",
89
          "type": "LEGAL_NAME"
90
        }
91
      ],
92
      "emails": [
93
        {
94
          "type": "CUSTOMER_SERVICE",
95
          "email": "customerservice@example.com"
96
        }
97
      ],
98
      "website": "https://mystore.testenterprises.com",
99
      "addresses": [
100
        {
101
          "address_line_1": "One Washington Square",
102
          "address_line_2": "Apt 123",
103
          "admin_area_2": "San Jose",
104
          "admin_area_1": "CA",
105
          "postal_code": "95112",
106
          "country_code": "US",
107
          "type": "WORK"
108
        }
109
      ],
110
      "phones": [
111
        {
112
          "country_code": "1",
113
          "national_number": "6692478833",
114
          "extension_number": "1234",
115
          "type": "CUSTOMER_SERVICE"
116
        }
117
      ],
118
      "beneficial_owners": {
119
        "individual_beneficial_owners": [
120
          {
121
            "names": [
122
              {
123
                "prefix": "Mr.",
124
                "given_name": "John",
125
                "surname": "Doe",
126
                "middle_name": "Middle",
127
                "suffix": "Jr.",
128
                "full_name": "John Middle Doe Jr.",
129
                "type": "LEGAL"
130
              }
131
            ],
132
            "citizenship": "US",
133
            "addresses": [
134
              {
135
                "address_line_1": "One Washington Square",
136
                "address_line_2": "Apt 123",
137
                "admin_area_2": "San Jose",
138
                "admin_area_1": "CA",
139
                "postal_code": "95112",
140
                "country_code": "US",
141
                "type": "HOME"
142
              }
143
            ],
144
            "phones": [
145
              {
146
                "country_code": "1",
147
                "national_number": "6692468839",
148
                "extension_number": "1234",
149
                "type": "MOBILE"
150
              }
151
            ],
152
            "birth_details": {
153
              "date_of_birth": "1955-12-29"
154
            },
155
            "percentage_of_ownership": "50"
156
          }
157
        ],
158
        "business_beneficial_owners": [
159
          {
160
            "business_type": {
161
              "type": "INDIVIDUAL",
162
              "subtype": "ASSO_TYPE_INCORPORATED"
163
            },
164
            "business_industry": {
165
              "category": "1004",
166
              "mcc_code": "2025",
167
              "subcategory": "8931"
168
            },
169
            "business_incorporation": {
170
              "incorporation_country_code": "US",
171
              "incorporation_date": "1986-12-29"
172
            },
173
            "names": [
174
              {
175
                "business_name": "Test Enterprise",
176
                "type": "LEGAL_NAME"
177
              }
178
            ],
179
            "emails": [
180
              {
181
                "type": "CUSTOMER_SERVICE",
182
                "email": "customerservice@example.com"
183
              }
184
            ],
185
            "website": "https://mystore.testenterprises.com",
186
            "addresses": [
187
              {
188
                "address_line_1": "One Washington Square",
189
                "address_line_2": "Apt 123",
190
                "admin_area_2": "San Jose",
191
                "admin_area_1": "CA",
192
                "postal_code": "95112",
193
                "country_code": "US",
194
                "type": "WORK"
195
              }
196
            ],
197
            "phones": [
198
              {
199
                "country_code": "1",
200
                "national_number": "6692478833",
201
                "extension_number": "1234",
202
                "type": "CUSTOMER_SERVICE"
203
              }
204
            ],
205
            "percentage_of_ownership": "50"
206
          }
207
        ]
208
      },
209
      "office_bearers": [
210
        {
211
          "names": [
212
            {
213
              "prefix": "Mr.",
214
              "given_name": "John",
215
              "surname": "Doe",
216
              "middle_name": "Middle",
217
              "suffix": "Jr.",
218
              "full_name": "John Middle Doe Jr.",
219
              "type": "LEGAL"
220
            }
221
          ],
222
          "citizenship": "US",
223
          "addresses": [
224
            {
225
              "address_line_1": "One Washington Square",
226
              "address_line_2": "Apt 123",
227
              "admin_area_2": "San Jose",
228
              "admin_area_1": "CA",
229
              "postal_code": "95112",
230
              "country_code": "US",
231
              "type": "HOME"
232
            }
233
          ],
234
          "phones": [
235
            {
236
              "country_code": "1",
237
              "national_number": "6692468839",
238
              "extension_number": "1234",
239
              "type": "MOBILE"
240
            }
241
          ],
242
          "birth_details": {
243
            "date_of_birth": "1955-12-29"
244
          },
245
          "role": "DIRECTOR"
246
        }
247
      ],
248
      "annual_sales_volume_range": {
249
        "minimum_amount": {
250
          "currency_code": "USD",
251
          "value": "10000"
252
        },
253
        "maximum_amount": {
254
          "currency_code": "USD",
255
          "value": "50000"
256
        }
257
      },
258
      "average_monthly_volume_range": {
259
        "minimum_amount": {
260
          "currency_code": "USD",
261
          "value": "1000"
262
        },
263
        "maximum_amount": {
264
          "currency_code": "USD",
265
          "value": "50000"
266
        }
267
      },
268
      "purpose_code": "P0104"
269
    },
270
    "email": "accountemail@example.com",
271
    "preferred_language_code": "en-US",
272
    "tracking_id": "testenterprices123122",
273
    "partner_config_override": {
274
      "partner_logo_url": "https://www.paypalobjects.com/webstatic/mktg/logo/pp_cc_mark_111x69.jpg",
275
      "return_url": "https://testenterprises.com/merchantonboarded",
276
      "return_url_description": "the url to return the merchant after the paypal onboarding process.",
277
      "action_renewal_url": "https://testenterprises.com/renew-exprired-url",
278
      "show_add_credit_card": true
279
    },
280
    "operations": [
281
      {
282
        "operation": "API_INTEGRATION",
283
        "api_integration_preference": {
284
          "classic_api_integration": {
285
            "integration_type": "THIRD_PARTY",
286
            "third_party_details": {
287
              "permissions": [
288
                "EXPRESS_CHECKOUT",
289
                "REFUND",
290
                "DIRECT_PAYMENT",
291
                "AUTH_CAPTURE",
292
                "BUTTON_MANAGER",
293
                "ACCOUNT_BALANCE",
294
                "TRANSACTION_DETAILS"
295
              ]
296
            },
297
            "first_party_details": "CERTIFICATE"
298
          },
299
          "rest_api_integration": {
300
            "integration_method": "PAYPAL",
301
            "integration_type": "THIRD_PARTY",
302
            "third_party_details": {
303
              "features": [
304
                "PAYMENT",
305
                "REFUND",
306
                "PARTNER_FEE"
307
              ]
308
            }
309
          }
310
        },
311
        "billing_agreement": {
312
          "description": "Billing Agreement Description Field",
313
          "billing_experience_preference": {
314
            "experience_id": "string",
315
            "billing_context_set": true
316
          },
317
          "merchant_custom_data": "PatnerMERCHANT23124",
318
          "approval_url": "wttps://www.paypal.com/agreements/approve?ba_token=BA-67944913LE886121E",
319
          "ec_token": "EC-1S970363DB536864M"
320
        }
321
      }
322
    ],
323
    "products": [
324
      "EXPRESS_CHECKOUT"
325
    ],
326
    "legal_consents": [
327
      {
328
        "type": "SHARE_DATA_CONSENT",
329
        "granted": true
330
      }
331
    ]
332
  },
333
  "links": [
334
    {
335
      "href": "https://uri.paypal.com/v2/customer/partner-referrals/ZjcyODU4ZWYtYTA1OC00ODIwLTk2M2EtOTZkZWQ4NmQwYzI3RU12cE5xa0xMRmk1NWxFSVJIT1JlTFdSbElCbFU1Q3lhdGhESzVQcU9iRT0=",
336
      "rel": "self",
337
      "method": "GET"
338
    },
339
    {
340
      "href": "https://www.paypal.com/merchantsignup/partner/onboardingentry?token=ZjcyODU4ZWYtYTA1OC00ODIwLTk2M2EtOTZkZWQ4NmQwYzI3RU12cE5xa0xMRmk1NWxFSVJIT1JlTFdSbElCbFU1Q3lhdGhESzVQcU9iRT0=",
341
      "rel": "action_url",
342
      "method": "GET"
343
    }
344
  ]
345
}', true);
346
    }
347
}