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\Requests;
4
 
5
use GuzzleHttp\Utils;
6
 
7
trait BillingPlans
8
{
9
    /**
10
     * @return array
11
     */
12
    private function createPlanParams(): array
13
    {
14
        return Utils::jsonDecode('{
15
  "product_id": "PROD-XXCD1234QWER65782",
16
  "name": "Video Streaming Service Plan",
17
  "description": "Video Streaming Service basic plan",
18
  "status": "ACTIVE",
19
  "billing_cycles": [
20
    {
21
      "frequency": {
22
        "interval_unit": "MONTH",
23
        "interval_count": 1
24
      },
25
      "tenure_type": "TRIAL",
26
      "sequence": 1,
27
      "total_cycles": 2,
28
      "pricing_scheme": {
29
        "fixed_price": {
30
          "value": "3",
31
          "currency_code": "USD"
32
        }
33
      }
34
    },
35
    {
36
      "frequency": {
37
        "interval_unit": "MONTH",
38
        "interval_count": 1
39
      },
40
      "tenure_type": "TRIAL",
41
      "sequence": 2,
42
      "total_cycles": 3,
43
      "pricing_scheme": {
44
        "fixed_price": {
45
          "value": "6",
46
          "currency_code": "USD"
47
        }
48
      }
49
    },
50
    {
51
      "frequency": {
52
        "interval_unit": "MONTH",
53
        "interval_count": 1
54
      },
55
      "tenure_type": "REGULAR",
56
      "sequence": 3,
57
      "total_cycles": 12,
58
      "pricing_scheme": {
59
        "fixed_price": {
60
          "value": "10",
61
          "currency_code": "USD"
62
        }
63
      }
64
    }
65
  ],
66
  "payment_preferences": {
67
    "auto_bill_outstanding": true,
68
    "setup_fee": {
69
      "value": "10",
70
      "currency_code": "USD"
71
    },
72
    "setup_fee_failure_action": "CONTINUE",
73
    "payment_failure_threshold": 3
74
  },
75
  "taxes": {
76
    "percentage": "10",
77
    "inclusive": false
78
  }
79
}', true);
80
    }
81
 
82
    /**
83
     * @return array
84
     */
85
    private function updatePlanParams(): array
86
    {
87
        return Utils::jsonDecode('[
88
  {
89
    "op": "replace",
90
    "path": "/payment_preferences/payment_failure_threshold",
91
    "value": 7
92
  }
93
]', true);
94
    }
95
 
96
    /**
97
     * @return array
98
     */
99
    private function updatePlanPricingParams(): array
100
    {
101
        return Utils::jsonDecode('{
102
  "pricing_schemes": [
103
    {
104
      "billing_cycle_sequence": 2,
105
      "pricing_scheme": {
106
        "fixed_price": {
107
          "value": "50",
108
          "currency_code": "USD"
109
        }
110
      }
111
    }
112
  ]
113
}', true);
114
    }
115
}