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

stripe / stripe-php / 9308609267

30 May 2024 08:13PM UTC coverage: 60.343% (-1.0%) from 61.377%
9308609267

push

github

web-flow
Merge pull request #1699 from stripe/latest-codegen-beta

Update generated code for beta

1080 of 1830 new or added lines in 117 files covered. (59.02%)

15 existing lines in 3 files now uncovered.

3486 of 5777 relevant lines covered (60.34%)

2.19 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 $amazon_pay
31
 * @property null|\Stripe\StripeObject $apple_pay
32
 * @property null|string $application For child configs, the Connect application associated with the configuration.
33
 * @property null|\Stripe\StripeObject $au_becs_debit
34
 * @property null|\Stripe\StripeObject $bacs_debit
35
 * @property null|\Stripe\StripeObject $bancontact
36
 * @property null|\Stripe\StripeObject $blik
37
 * @property null|\Stripe\StripeObject $boleto
38
 * @property null|\Stripe\StripeObject $card
39
 * @property null|\Stripe\StripeObject $cartes_bancaires
40
 * @property null|\Stripe\StripeObject $cashapp
41
 * @property null|\Stripe\StripeObject $customer_balance
42
 * @property null|\Stripe\StripeObject $eps
43
 * @property null|\Stripe\StripeObject $fpx
44
 * @property null|\Stripe\StripeObject $giropay
45
 * @property null|\Stripe\StripeObject $google_pay
46
 * @property null|\Stripe\StripeObject $grabpay
47
 * @property null|\Stripe\StripeObject $ideal
48
 * @property bool $is_default The default configuration is used whenever a payment method configuration is not specified.
49
 * @property null|\Stripe\StripeObject $jcb
50
 * @property null|\Stripe\StripeObject $klarna
51
 * @property null|\Stripe\StripeObject $konbini
52
 * @property null|\Stripe\StripeObject $link
53
 * @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.
54
 * @property null|\Stripe\StripeObject $mobilepay
55
 * @property null|\Stripe\StripeObject $multibanco
56
 * @property string $name The configuration's name.
57
 * @property null|\Stripe\StripeObject $oxxo
58
 * @property null|\Stripe\StripeObject $p24
59
 * @property null|string $parent For child configs, the configuration's parent configuration.
60
 * @property null|\Stripe\StripeObject $paynow
61
 * @property null|\Stripe\StripeObject $paypal
62
 * @property null|\Stripe\StripeObject $promptpay
63
 * @property null|\Stripe\StripeObject $revolut_pay
64
 * @property null|\Stripe\StripeObject $sepa_debit
65
 * @property null|\Stripe\StripeObject $sofort
66
 * @property null|\Stripe\StripeObject $swish
67
 * @property null|\Stripe\StripeObject $us_bank_account
68
 * @property null|\Stripe\StripeObject $wechat_pay
69
 * @property null|\Stripe\StripeObject $zip
70
 */
71
class PaymentMethodConfiguration extends ApiResource
72
{
73
    const OBJECT_NAME = 'payment_method_configuration';
74

75
    use ApiOperations\Update;
76

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

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

NEW
96
        return $obj;
×
97
    }
98

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

NEW
113
        return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
×
114
    }
115

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

NEW
132
        return $instance;
×
133
    }
134

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

NEW
151
        list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
×
NEW
152
        $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
×
NEW
153
        $obj->setLastResponse($response);
×
154

NEW
155
        return $obj;
×
156
    }
157
}
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