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 PaymentAuthorizations
8
{
9
    /**
10
     * @return array
11
     */
12
    private function mockGetAuthorizedPaymentDetailsResponse(): array
13
    {
14
        return Utils::jsonDecode('{
15
  "id": "0VF52814937998046",
16
  "status": "AUTHORIZED",
17
  "amount": {
18
    "total": "10.99",
19
    "currency": "USD"
20
  },
21
  "invoice_id": "INVOICE-123",
22
  "seller_protection": {
23
    "status": "ELIGIBLE",
24
    "dispute_categories": [
25
      "ITEM_NOT_RECEIVED",
26
      "UNAUTHORIZED_TRANSACTION"
27
    ]
28
  },
29
  "expiration_time": "2017-10-10T23:23:45Z",
30
  "create_time": "2017-09-11T23:23:45Z",
31
  "update_time": "2017-09-11T23:23:45Z",
32
  "links": [
33
    {
34
      "rel": "self",
35
      "method": "GET",
36
      "href": "https://api.paypal.com/v2/payments/authorizations/0VF52814937998046"
37
    },
38
    {
39
      "rel": "capture",
40
      "method": "POST",
41
      "href": "https://api.paypal.com/v2/payments/authorizations/0VF52814937998046/capture"
42
    },
43
    {
44
      "rel": "void",
45
      "method": "POST",
46
      "href": "https://api.paypal.com/v2/payments/authorizations/0VF52814937998046/void"
47
    },
48
    {
49
      "rel": "reauthorize",
50
      "method": "POST",
51
      "href": "https://api.paypal.com/v2/payments/authorizations/0VF52814937998046/reauthorize"
52
    }
53
  ]
54
}', true);
55
    }
56
 
57
    /**
58
     * @return array
59
     */
60
    private function mockCaptureAuthorizedPaymentResponse(): array
61
    {
62
        return Utils::jsonDecode('{
63
  "id": "2GG279541U471931P",
64
  "status": "COMPLETED",
65
  "links": [
66
    {
67
      "rel": "self",
68
      "method": "GET",
69
      "href": "https://api.paypal.com/v2/payments/captures/2GG279541U471931P"
70
    },
71
    {
72
      "rel": "refund",
73
      "method": "POST",
74
      "href": "https://api.paypal.com/v2/payments/captures/2GG279541U471931P/refund"
75
    },
76
    {
77
      "rel": "up",
78
      "method": "GET",
79
      "href": "https://api.paypal.com/v2/payments/authorizations/0VF52814937998046"
80
    }
81
  ]
82
}', true);
83
    }
84
 
85
    /**
86
     * @return array
87
     */
88
    private function mockReAuthorizeAuthorizedPaymentResponse(): array
89
    {
90
        return Utils::jsonDecode('{
91
  "id": "8AA831015G517922L",
92
  "status": "CREATED",
93
  "links": [
94
    {
95
      "rel": "self",
96
      "method": "GET",
97
      "href": "https://api.paypal.com/v2/payments/authorizations/8AA831015G517922L"
98
    },
99
    {
100
      "rel": "capture",
101
      "method": "POST",
102
      "href": "https://api.paypal.com/v2/payments/authorizations/8AA831015G517922L/capture"
103
    },
104
    {
105
      "rel": "void",
106
      "method": "POST",
107
      "href": "https://api.paypal.com/v2/payments/authorizations/8AA831015G517922L/void"
108
    },
109
    {
110
      "rel": "reauthorize",
111
      "method": "POST",
112
      "href": "https://api.paypal.com/v2/payments/authorizations/8AA831015G517922L/reauthorize"
113
    }
114
  ]
115
}', true);
116
    }
117
}