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

stripe / stripe-php / 9308533534

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

push

github

web-flow
Added PHPDocs for `create`, `update`, `delete`, `all`, `retrieve` methods after moving them out of traits.  (#1701)

* Demagiced crudl operation

* Improvements from codegen#1452

* Updated override to fix indents

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/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 string $name The configuration's name.
56
 * @property null|\Stripe\StripeObject $oxxo
57
 * @property null|\Stripe\StripeObject $p24
58
 * @property null|string $parent For child configs, the configuration's parent configuration.
59
 * @property null|\Stripe\StripeObject $paynow
60
 * @property null|\Stripe\StripeObject $paypal
61
 * @property null|\Stripe\StripeObject $promptpay
62
 * @property null|\Stripe\StripeObject $revolut_pay
63
 * @property null|\Stripe\StripeObject $sepa_debit
64
 * @property null|\Stripe\StripeObject $sofort
65
 * @property null|\Stripe\StripeObject $swish
66
 * @property null|\Stripe\StripeObject $us_bank_account
67
 * @property null|\Stripe\StripeObject $wechat_pay
68
 * @property null|\Stripe\StripeObject $zip
69
 */
70
class PaymentMethodConfiguration extends ApiResource
71
{
72
    const OBJECT_NAME = 'payment_method_configuration';
73

74
    use ApiOperations\Update;
75

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

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

NEW
95
        return $obj;
×
96
    }
97

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

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

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

NEW
131
        return $instance;
×
132
    }
133

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

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

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