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 PaymentCaptures
8
{
9
    /**
10
     * @return array
11
     */
12
    private function mockGetCapturedPaymentDetailsResponse(): array
13
    {
14
        return Utils::jsonDecode('{
15
  "id": "2GG279541U471931P",
16
  "status": "COMPLETED",
17
  "status_details": {},
18
  "amount": {
19
    "total": "10.99",
20
    "currency": "USD"
21
  },
22
  "final_capture": true,
23
  "seller_protection": {
24
    "status": "ELIGIBLE",
25
    "dispute_categories": [
26
      "ITEM_NOT_RECEIVED",
27
      "UNAUTHORIZED_TRANSACTION"
28
    ]
29
  },
30
  "seller_receivable_breakdown": {
31
    "gross_amount": {
32
      "total": "10.99",
33
      "currency": "USD"
34
    },
35
    "paypal_fee": {
36
      "value": "0.33",
37
      "currency": "USD"
38
    },
39
    "net_amount": {
40
      "value": "10.66",
41
      "currency": "USD"
42
    }
43
  },
44
  "invoice_id": "INVOICE-123",
45
  "create_time": "2017-09-11T23:24:01Z",
46
  "update_time": "2017-09-11T23:24:01Z",
47
  "links": [
48
    {
49
      "href": "https://api.paypal.com/v2/payments/captures/2GG279541U471931P",
50
      "rel": "self",
51
      "method": "GET"
52
    },
53
    {
54
      "href": "https://api.paypal.com/v2/payments/captures/2GG279541U471931P/refund",
55
      "rel": "refund",
56
      "method": "POST"
57
    },
58
    {
59
      "href": "https://api.paypal.com/v2/payments/authorizations/0VF52814937998046",
60
      "rel": "up",
61
      "method": "GET"
62
    }
63
  ]
64
}', true);
65
    }
66
 
67
    /**
68
     * @return array
69
     */
70
    private function mockRefundCapturedPaymentResponse(): array
71
    {
72
        return Utils::jsonDecode('{
73
  "id": "1JU08902781691411",
74
  "status": "COMPLETED",
75
  "links": [
76
    {
77
      "rel": "self",
78
      "method": "GET",
79
      "href": "https://api.paypal.com/v2/payments/refunds/1JU08902781691411"
80
    },
81
    {
82
      "rel": "up",
83
      "method": "GET",
84
      "href": "https://api.paypal.com/v2/payments/captures/2GG279541U471931P"
85
    }
86
  ]
87
}', true);
88
    }
89
}