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 Reporting
8
{
9
    /**
10
     * @return array
11
     */
12
    private function mockListTransactionsResponse(): array
13
    {
14
        return Utils::jsonDecode('{
15
  "transaction_details": [
16
    {
17
      "transaction_info": {
18
        "paypal_account_id": "6STWC2LSUYYYE",
19
        "transaction_id": "5TY05013RG002845M",
20
        "transaction_event_code": "T0006",
21
        "transaction_initiation_date": "2014-07-11T04:03:52+0000",
22
        "transaction_updated_date": "2014-07-11T04:03:52+0000",
23
        "transaction_amount": {
24
          "currency_code": "USD",
25
          "value": "465.00"
26
        },
27
        "fee_amount": {
28
          "currency_code": "USD",
29
          "value": "-13.79"
30
        },
31
        "insurance_amount": {
32
          "currency_code": "USD",
33
          "value": "15.00"
34
        },
35
        "shipping_amount": {
36
          "currency_code": "USD",
37
          "value": "30.00"
38
        },
39
        "shipping_discount_amount": {
40
          "currency_code": "USD",
41
          "value": "10.00"
42
        },
43
        "transaction_status": "S",
44
        "transaction_subject": "Bill for your purchase",
45
        "transaction_note": "Check out the latest sales",
46
        "invoice_id": "Invoice-005",
47
        "custom_field": "Thank you for your business",
48
        "protection_eligibility": "01"
49
      },
50
      "payer_info": {
51
        "account_id": "6STWC2LSUYYYE",
52
        "email_address": "consumer@example.com",
53
        "address_status": "Y",
54
        "payer_status": "Y",
55
        "payer_name": {
56
          "given_name": "test",
57
          "surname": "consumer",
58
          "alternate_full_name": "test consumer"
59
        },
60
        "country_code": "US"
61
      },
62
      "shipping_info": {
63
        "name": "Sowmith",
64
        "address": {
65
          "line1": "Eco Space, bellandur",
66
          "line2": "OuterRingRoad",
67
          "city": "Bangalore",
68
          "country_code": "IN",
69
          "postal_code": "560103"
70
        }
71
      },
72
      "cart_info": {
73
        "item_details": [
74
          {
75
            "item_code": "ItemCode-1",
76
            "item_name": "Item1 - radio",
77
            "item_description": "Radio",
78
            "item_quantity": "2",
79
            "item_unit_price": {
80
              "currency_code": "USD",
81
              "value": "50.00"
82
            },
83
            "item_amount": {
84
              "currency_code": "USD",
85
              "value": "100.00"
86
            },
87
            "tax_amounts": [
88
              {
89
                "tax_amount": {
90
                  "currency_code": "USD",
91
                  "value": "20.00"
92
                }
93
              }
94
            ],
95
            "total_item_amount": {
96
              "currency_code": "USD",
97
              "value": "120.00"
98
            },
99
            "invoice_number": "Invoice-005"
100
          },
101
          {
102
            "item_code": "ItemCode-2",
103
            "item_name": "Item2 - Headset",
104
            "item_description": "Headset",
105
            "item_quantity": "3",
106
            "item_unit_price": {
107
              "currency_code": "USD",
108
              "value": "100.00"
109
            },
110
            "item_amount": {
111
              "currency_code": "USD",
112
              "value": "300.00"
113
            },
114
            "tax_amounts": [
115
              {
116
                "tax_amount": {
117
                  "currency_code": "USD",
118
                  "value": "60.00"
119
                }
120
              }
121
            ],
122
            "total_item_amount": {
123
              "currency_code": "USD",
124
              "value": "360.00"
125
            },
126
            "invoice_number": "Invoice-005"
127
          },
128
          {
129
            "item_name": "3",
130
            "item_quantity": "1",
131
            "item_unit_price": {
132
              "currency_code": "USD",
133
              "value": "-50.00"
134
            },
135
            "item_amount": {
136
              "currency_code": "USD",
137
              "value": "-50.00"
138
            },
139
            "total_item_amount": {
140
              "currency_code": "USD",
141
              "value": "-50.00"
142
            },
143
            "invoice_number": "Invoice-005"
144
          }
145
        ]
146
      },
147
      "store_info": {},
148
      "auction_info": {},
149
      "incentive_info": {}
150
    }
151
  ],
152
  "account_number": "XZXSPECPDZHZU",
153
  "last_refreshed_datetime": "2017-01-02T06:59:59+0000",
154
  "page": 1,
155
  "total_items": 1,
156
  "total_pages": 1,
157
  "links": [
158
    {
159
      "href": "https://api-m.sandbox.paypal.com/v1/reporting/transactions?start_date=2014-07-01T00:00:00-0700&end_date=2014-07-30T23:59:59-0700&transaction_id=5TY05013RG002845M&fields=all&page_size=100&page=1",
160
      "rel": "self",
161
      "method": "GET"
162
    }
163
  ]
164
}', true);
165
    }
166
 
167
    /**
168
     * @return array
169
     */
170
    private function mockListBalancesResponse(): array
171
    {
172
        return Utils::jsonDecode('{
173
  "balance": {
174
    "currency": "USD",
175
    "primary": true,
176
    "total_balance": {
177
      "currency_code": "USD",
178
      "value": "300.00"
179
    },
180
    "available_balance": {
181
      "currency_code": "USD",
182
      "value": "100.00"
183
    },
184
    "withheld_balance": {
185
      "currency_code": "USD",
186
      "value": "200.00"
187
    }
188
  },
189
  "account_id": "QCXKLSS8GWT22",
190
  "as_of_time": "2016-10-15T13:07:00Z",
191
  "last_refresh_time": "2017-02-17T05:59:59Z"
192
}', true);
193
    }
194
}