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

stripe / stripe-php / 11409488101

18 Oct 2024 07:03PM UTC coverage: 58.28%. Remained the same
11409488101

push

github

xavdid-stripe
Bump version to 16.2.0-beta.3

3558 of 6105 relevant lines covered (58.28%)

2.29 hits per line

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

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

3
// File generated from our OpenAPI spec
4

5
namespace Stripe;
6

7
/**
8
 * PaymentMethodConfigurations control which payment methods are displayed to your customers when you don't explicitly specify payment method types. You can have multiple configurations with different sets of payment methods for different scenarios.
9
 *
10
 * There are two types of PaymentMethodConfigurations. Which is used depends on the <a href="https://stripe.com/docs/connect/charges">charge type</a>:
11
 *
12
 * <strong>Direct</strong> configurations apply to payments created on your account, including Connect destination charges, Connect separate charges and transfers, and payments not involving Connect.
13
 *
14
 * <strong>Child</strong> configurations apply to payments created on your connected accounts using direct charges, and charges with the on_behalf_of parameter.
15
 *
16
 * Child configurations have a <code>parent</code> that sets default values and controls which settings connected accounts may override. You can specify a parent ID at payment time, and Stripe will automatically resolve the connected account’s associated child configuration. Parent configurations are <a href="https://dashboard.stripe.com/settings/payment_methods/connected_accounts">managed in the dashboard</a> and are not available in this API.
17
 *
18
 * Related guides:
19
 * - <a href="https://stripe.com/docs/connect/payment-method-configurations">Payment Method Configurations API</a>
20
 * - <a href="https://stripe.com/docs/payments/multiple-payment-method-configs">Multiple configurations on dynamic payment methods</a>
21
 * - <a href="https://stripe.com/docs/connect/multiple-payment-method-configurations">Multiple configurations for your Connect accounts</a>
22
 *
23
 * @property string $id Unique identifier for the object.
24
 * @property string $object String representing the object's type. Objects of the same type share the same value.
25
 * @property null|\Stripe\StripeObject $acss_debit
26
 * @property bool $active Whether the configuration can be used for new payments.
27
 * @property null|\Stripe\StripeObject $affirm
28
 * @property null|\Stripe\StripeObject $afterpay_clearpay
29
 * @property null|\Stripe\StripeObject $alipay
30
 * @property null|\Stripe\StripeObject $alma
31
 * @property null|\Stripe\StripeObject $amazon_pay
32
 * @property null|\Stripe\StripeObject $apple_pay
33
 * @property null|string $application For child configs, the Connect application associated with the configuration.
34
 * @property null|\Stripe\StripeObject $au_becs_debit
35
 * @property null|\Stripe\StripeObject $bacs_debit
36
 * @property null|\Stripe\StripeObject $bancontact
37
 * @property null|\Stripe\StripeObject $blik
38
 * @property null|\Stripe\StripeObject $boleto
39
 * @property null|\Stripe\StripeObject $card
40
 * @property null|\Stripe\StripeObject $cartes_bancaires
41
 * @property null|\Stripe\StripeObject $cashapp
42
 * @property null|\Stripe\StripeObject $customer_balance
43
 * @property null|\Stripe\StripeObject $eps
44
 * @property null|\Stripe\StripeObject $fpx
45
 * @property null|\Stripe\StripeObject $giropay
46
 * @property null|\Stripe\StripeObject $google_pay
47
 * @property null|\Stripe\StripeObject $grabpay
48
 * @property null|\Stripe\StripeObject $ideal
49
 * @property bool $is_default The default configuration is used whenever a payment method configuration is not specified.
50
 * @property null|\Stripe\StripeObject $jcb
51
 * @property null|\Stripe\StripeObject $klarna
52
 * @property null|\Stripe\StripeObject $konbini
53
 * @property null|\Stripe\StripeObject $link
54
 * @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.
55
 * @property null|\Stripe\StripeObject $mobilepay
56
 * @property null|\Stripe\StripeObject $multibanco
57
 * @property string $name The configuration's name.
58
 * @property null|\Stripe\StripeObject $oxxo
59
 * @property null|\Stripe\StripeObject $p24
60
 * @property null|string $parent For child configs, the configuration's parent configuration.
61
 * @property null|\Stripe\StripeObject $paynow
62
 * @property null|\Stripe\StripeObject $paypal
63
 * @property null|\Stripe\StripeObject $payto
64
 * @property null|\Stripe\StripeObject $promptpay
65
 * @property null|\Stripe\StripeObject $revolut_pay
66
 * @property null|\Stripe\StripeObject $sepa_debit
67
 * @property null|\Stripe\StripeObject $sofort
68
 * @property null|\Stripe\StripeObject $swish
69
 * @property null|\Stripe\StripeObject $twint
70
 * @property null|\Stripe\StripeObject $us_bank_account
71
 * @property null|\Stripe\StripeObject $wechat_pay
72
 * @property null|\Stripe\StripeObject $zip
73
 */
74
class PaymentMethodConfiguration extends ApiResource
75
{
76
    const OBJECT_NAME = 'payment_method_configuration';
77

78
    use ApiOperations\Update;
79

80
    /**
81
     * Creates a payment method configuration.
82
     *
83
     * @param null|array $params
84
     * @param null|array|string $options
85
     *
86
     * @throws \Stripe\Exception\ApiErrorException if the request fails
87
     *
88
     * @return \Stripe\PaymentMethodConfiguration the created resource
89
     */
90
    public static function create($params = null, $options = null)
×
91
    {
92
        self::_validateParams($params);
×
93
        $url = static::classUrl();
×
94

95
        list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
×
96
        $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
×
97
        $obj->setLastResponse($response);
×
98

99
        return $obj;
×
100
    }
101

102
    /**
103
     * List payment method configurations.
104
     *
105
     * @param null|array $params
106
     * @param null|array|string $opts
107
     *
108
     * @throws \Stripe\Exception\ApiErrorException if the request fails
109
     *
110
     * @return \Stripe\Collection<\Stripe\PaymentMethodConfiguration> of ApiResources
111
     */
112
    public static function all($params = null, $opts = null)
×
113
    {
114
        $url = static::classUrl();
×
115

116
        return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
×
117
    }
118

119
    /**
120
     * Retrieve payment method configuration.
121
     *
122
     * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
123
     * @param null|array|string $opts
124
     *
125
     * @throws \Stripe\Exception\ApiErrorException if the request fails
126
     *
127
     * @return \Stripe\PaymentMethodConfiguration
128
     */
129
    public static function retrieve($id, $opts = null)
×
130
    {
131
        $opts = \Stripe\Util\RequestOptions::parse($opts);
×
132
        $instance = new static($id, $opts);
×
133
        $instance->refresh();
×
134

135
        return $instance;
×
136
    }
137

138
    /**
139
     * Update payment method configuration.
140
     *
141
     * @param string $id the ID of the resource to update
142
     * @param null|array $params
143
     * @param null|array|string $opts
144
     *
145
     * @throws \Stripe\Exception\ApiErrorException if the request fails
146
     *
147
     * @return \Stripe\PaymentMethodConfiguration the updated resource
148
     */
149
    public static function update($id, $params = null, $opts = null)
×
150
    {
151
        self::_validateParams($params);
×
152
        $url = static::resourceUrl($id);
×
153

154
        list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
×
155
        $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
×
156
        $obj->setLastResponse($response);
×
157

158
        return $obj;
×
159
    }
160
}
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

© 2026 Coveralls, Inc