• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stripe / stripe-php / 9308192295

30 May 2024 07:35PM UTC coverage: 65.24% (-0.9%) from 66.176%
9308192295

Pull #1701

github

web-flow
Merge cd30bb2f4 into 901f195e4
Pull Request #1701: Demagiced crudl operation

1080 of 1682 new or added lines in 106 files covered. (64.21%)

15 existing lines in 3 files now uncovered.

3444 of 5279 relevant lines covered (65.24%)

2.29 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/lib/PaymentMethodDomain.php
1
<?php
2

3
// File generated from our OpenAPI spec
4

5
namespace Stripe;
6

7
/**
8
 * A payment method domain represents a web domain that you have registered with Stripe.
9
 * Stripe Elements use registered payment method domains to control where certain payment methods are shown.
10
 *
11
 * Related guides: <a href="https://stripe.com/docs/payments/payment-methods/pmd-registration">Payment method domains</a>.
12
 *
13
 * @property string $id Unique identifier for the object.
14
 * @property string $object String representing the object's type. Objects of the same type share the same value.
15
 * @property \Stripe\StripeObject $apple_pay Indicates the status of a specific payment method on a payment method domain.
16
 * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
17
 * @property string $domain_name The domain name that this payment method domain object represents.
18
 * @property bool $enabled Whether this payment method domain is enabled. If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements.
19
 * @property \Stripe\StripeObject $google_pay Indicates the status of a specific payment method on a payment method domain.
20
 * @property \Stripe\StripeObject $link Indicates the status of a specific payment method on a payment method domain.
21
 * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
22
 * @property \Stripe\StripeObject $paypal Indicates the status of a specific payment method on a payment method domain.
23
 */
24
class PaymentMethodDomain extends ApiResource
25
{
26
    const OBJECT_NAME = 'payment_method_domain';
27

28
    use ApiOperations\Update;
29

30
    /**
31
     * Creates a payment method domain.
32
     *
33
     * @param null|array $params
34
     * @param null|array|string $options
35
     *
36
     * @throws \Stripe\Exception\ApiErrorException if the request fails
37
     *
38
     * @return \Stripe\PaymentMethodDomain the created resource
39
     */
NEW
40
    public static function create($params = null, $options = null)
×
41
    {
NEW
42
        self::_validateParams($params);
×
NEW
43
        $url = static::classUrl();
×
44

NEW
45
        list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
×
NEW
46
        $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
×
NEW
47
        $obj->setLastResponse($response);
×
48

NEW
49
        return $obj;
×
50
    }
51

52
    /**
53
     * Lists the details of existing payment method domains.
54
     *
55
     * @param null|array $params
56
     * @param null|array|string $opts
57
     *
58
     * @throws \Stripe\Exception\ApiErrorException if the request fails
59
     *
60
     * @return \Stripe\Collection<\Stripe\PaymentMethodDomain> of ApiResources
61
     */
NEW
62
    public static function all($params = null, $opts = null)
×
63
    {
NEW
64
        $url = static::classUrl();
×
65

NEW
66
        return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
×
67
    }
68

69
    /**
70
     * Retrieves the details of an existing payment method domain.
71
     *
72
     * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
73
     * @param null|array|string $opts
74
     *
75
     * @throws \Stripe\Exception\ApiErrorException if the request fails
76
     *
77
     * @return \Stripe\PaymentMethodDomain
78
     */
NEW
79
    public static function retrieve($id, $opts = null)
×
80
    {
NEW
81
        $opts = \Stripe\Util\RequestOptions::parse($opts);
×
NEW
82
        $instance = new static($id, $opts);
×
NEW
83
        $instance->refresh();
×
84

NEW
85
        return $instance;
×
86
    }
87

88
    /**
89
     * Updates an existing payment method domain.
90
     *
91
     * @param string $id the ID of the resource to update
92
     * @param null|array $params
93
     * @param null|array|string $opts
94
     *
95
     * @throws \Stripe\Exception\ApiErrorException if the request fails
96
     *
97
     * @return \Stripe\PaymentMethodDomain the updated resource
98
     */
NEW
99
    public static function update($id, $params = null, $opts = null)
×
100
    {
NEW
101
        self::_validateParams($params);
×
NEW
102
        $url = static::resourceUrl($id);
×
103

NEW
104
        list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
×
NEW
105
        $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
×
NEW
106
        $obj->setLastResponse($response);
×
107

NEW
108
        return $obj;
×
109
    }
110

111
    /**
112
     * @param null|array $params
113
     * @param null|array|string $opts
114
     *
115
     * @throws \Stripe\Exception\ApiErrorException if the request fails
116
     *
117
     * @return \Stripe\PaymentMethodDomain the validated payment method domain
118
     */
119
    public function validate($params = null, $opts = null)
×
120
    {
121
        $url = $this->instanceUrl() . '/validate';
×
122
        list($response, $opts) = $this->_request('post', $url, $params, $opts);
×
123
        $this->refreshFrom($response, $opts);
×
124

125
        return $this;
×
126
    }
127
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2024 Coveralls, Inc