PluginProbe ʕ •ᴥ•ʔ
WPForms – Easy Form Builder for WordPress – Contact Forms, Payment Forms, Surveys, & More / 1.10.1
WPForms – Easy Form Builder for WordPress – Contact Forms, Payment Forms, Surveys, & More v1.10.1
1.10.1.1 1.10.1 1.10.0.5 trunk 1.1.4 1.1.4.2 1.1.5 1.1.5.1 1.1.6 1.1.6.1 1.1.7 1.1.7.1 1.1.7.2 1.1.8 1.1.8.1 1.1.8.2 1.1.8.3 1.1.8.4 1.10.0.1 1.10.0.2 1.10.0.3 1.10.0.4 1.2.0 1.2.0.1 1.2.1 1.2.2 1.2.2.1 1.2.2.2 1.2.3 1.2.3.1 1.2.3.2 1.2.4 1.2.4.1 1.2.5 1.2.5.1 1.2.6 1.2.7 1.2.8 1.2.8.1 1.2.9 1.3.0 1.3.1 1.3.1.1 1.3.1.2 1.3.2 1.3.3 1.3.5 1.3.6 1.3.6.1 1.3.6.2 1.3.7.2 1.3.7.3 1.3.7.4 1.3.8 1.3.9.1 1.4.0.1 1.4.1.1 1.4.2 1.4.2.1 1.4.2.2 1.4.3 1.4.4 1.4.4.1 1.4.5 1.4.5.1 1.4.5.2 1.4.5.3 1.4.6 1.4.7.1 1.4.7.2 1.4.8.1 1.4.9 1.5.0.1 1.5.0.3 1.5.0.4 1.5.1 1.5.1.1 1.5.1.3 1.5.2.1 1.5.2.2 1.5.2.3 1.5.3 1.5.3.1 1.5.4.1 1.5.4.2 1.5.5 1.5.5.1 1.5.6 1.5.6.2 1.5.7 1.5.8.2 1.5.9.1 1.5.9.4 1.5.9.5 1.6.0.1 1.6.0.2 1.6.1 1.6.2.2 1.6.2.3 1.6.3.1 1.6.4 1.6.4.1 1.6.5 1.6.6 1.6.7 1.6.7.1 1.6.7.2 1.6.7.3 1.6.8 1.6.8.1 1.6.9 1.7.0 1.7.1.1 1.7.1.2 1.7.2 1.7.2.1 1.7.3 1.7.4 1.7.4.1 1.7.4.2 1.7.5.1 1.7.5.2 1.7.5.3 1.7.5.5 1.7.6 1.7.7 1.7.7.1 1.7.7.2 1.7.8 1.7.9 1.7.9.1 1.8.0.1 1.8.0.2 1.8.1.1 1.8.1.2 1.8.1.3 1.8.2.1 1.8.2.2 1.8.2.3 1.8.3 1.8.3.1 1.8.4 1.8.4.1 1.8.5.2 1.8.5.3 1.8.5.4 1.8.6.2 1.8.6.3 1.8.6.4 1.8.7.2 1.8.8.2 1.8.8.3 1.8.9.1 1.8.9.2 1.8.9.4 1.8.9.5 1.8.9.6 1.9.0.1 1.9.0.2 1.9.0.3 1.9.0.4 1.9.1.1 1.9.1.2 1.9.1.3 1.9.1.4 1.9.1.5 1.9.1.6 1.9.2.1 1.9.2.2 1.9.2.3 1.9.3.1 1.9.3.2 1.9.4.1 1.9.4.2 1.9.5 1.9.5.1 1.9.5.2 1.9.6 1.9.6.1 1.9.6.2 1.9.7.1 1.9.7.2 1.9.7.3 1.9.8.1 1.9.8.2 1.9.8.4 1.9.8.7 1.9.9.2 1.9.9.3 1.9.9.4
wpforms-lite / vendor_prefixed / stripe / stripe-php / lib / Plan.php
wpforms-lite / vendor_prefixed / stripe / stripe-php / lib Last commit date
ApiOperations 1 year ago Apps 1 year ago Billing 1 year ago BillingPortal 1 year ago Checkout 1 year ago Climate 1 year ago Entitlements 1 year ago EventData 1 year ago Events 1 year ago Exception 1 year ago FinancialConnections 1 year ago Forwarding 1 year ago HttpClient 1 year ago Identity 1 year ago Issuing 1 year ago Radar 1 year ago Reporting 1 year ago Service 1 year ago Sigma 1 year ago Tax 1 year ago Terminal 1 year ago TestHelpers 1 year ago Treasury 1 year ago Util 1 year ago V2 1 year ago Account.php 1 year ago AccountLink.php 1 year ago AccountSession.php 1 year ago ApiRequestor.php 1 year ago ApiResource.php 2 years ago ApiResponse.php 2 years ago ApplePayDomain.php 1 year ago Application.php 2 years ago ApplicationFee.php 1 year ago ApplicationFeeRefund.php 2 years ago Balance.php 1 year ago BalanceTransaction.php 1 year ago BankAccount.php 1 year ago BaseStripeClient.php 1 year ago BaseStripeClientInterface.php 1 year ago Capability.php 1 year ago Card.php 1 year ago CashBalance.php 2 years ago Charge.php 1 year ago Collection.php 1 year ago ConfirmationToken.php 1 year ago ConnectCollectionTransfer.php 2 years ago CountrySpec.php 1 year ago Coupon.php 1 year ago CreditNote.php 1 year ago CreditNoteLineItem.php 1 year ago Customer.php 1 year ago CustomerBalanceTransaction.php 2 years ago CustomerCashBalanceTransaction.php 2 years ago CustomerSession.php 1 year ago Discount.php 1 year ago Dispute.php 1 year ago EphemeralKey.php 1 year ago ErrorObject.php 1 year ago Event.php 1 year ago ExchangeRate.php 1 year ago File.php 1 year ago FileLink.php 1 year ago FundingInstructions.php 2 years ago Invoice.php 1 year ago InvoiceItem.php 1 year ago InvoiceLineItem.php 1 year ago InvoiceRenderingTemplate.php 1 year ago LineItem.php 1 year ago LoginLink.php 1 year ago Mandate.php 1 year ago OAuth.php 2 years ago OAuthErrorObject.php 1 year ago PaymentIntent.php 1 year ago PaymentLink.php 1 year ago PaymentMethod.php 1 year ago PaymentMethodConfiguration.php 1 year ago PaymentMethodDomain.php 1 year ago Payout.php 1 year ago Person.php 1 year ago Plan.php 1 year ago Price.php 1 year ago Product.php 1 year ago ProductFeature.php 1 year ago PromotionCode.php 1 year ago Quote.php 1 year ago Reason.php 1 year ago RecipientTransfer.php 2 years ago Refund.php 1 year ago RelatedObject.php 1 year ago RequestTelemetry.php 2 years ago ReserveTransaction.php 2 years ago Review.php 1 year ago SearchResult.php 1 year ago SetupAttempt.php 1 year ago SetupIntent.php 1 year ago ShippingRate.php 1 year ago SingletonApiResource.php 2 years ago Source.php 1 year ago SourceMandateNotification.php 2 years ago SourceTransaction.php 2 years ago Stripe.php 1 year ago StripeClient.php 1 year ago StripeClientInterface.php 2 years ago StripeObject.php 1 year ago StripeStreamingClientInterface.php 2 years ago Subscription.php 1 year ago SubscriptionItem.php 1 year ago SubscriptionSchedule.php 1 year ago TaxCode.php 1 year ago TaxDeductedAtSource.php 2 years ago TaxId.php 1 year ago TaxRate.php 1 year ago ThinEvent.php 1 year ago Token.php 1 year ago Topup.php 1 year ago Transfer.php 1 year ago TransferReversal.php 1 year ago UsageRecord.php 1 year ago UsageRecordSummary.php 1 year ago Webhook.php 1 year ago WebhookEndpoint.php 1 year ago WebhookSignature.php 2 years ago
Plan.php
151 lines
1 <?php
2
3 // File generated from our OpenAPI spec
4 namespace WPForms\Vendor\Stripe;
5
6 /**
7 * You can now model subscriptions more flexibly using the <a href="https://stripe.com/docs/api#prices">Prices API</a>. It replaces the Plans API and is backwards compatible to simplify your migration.
8 *
9 * Plans define the base price, currency, and billing cycle for recurring purchases of products.
10 * <a href="https://stripe.com/docs/api#products">Products</a> help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme.
11 *
12 * For example, you might have a single &quot;gold&quot; product that has plans for $10/month, $100/year, €9/month, and €90/year.
13 *
14 * Related guides: <a href="https://stripe.com/docs/billing/subscriptions/set-up-subscription">Set up a subscription</a> and more about <a href="https://stripe.com/docs/products-prices/overview">products and prices</a>.
15 *
16 * @property string $id Unique identifier for the object.
17 * @property string $object String representing the object's type. Objects of the same type share the same value.
18 * @property bool $active Whether the plan can be used for new purchases.
19 * @property null|string $aggregate_usage Specifies a usage aggregation strategy for plans of <code>usage_type=metered</code>. Allowed values are <code>sum</code> for summing up all usage during a period, <code>last_during_period</code> for using the last usage record reported within a period, <code>last_ever</code> for using the last usage record ever (across period bounds) or <code>max</code> which uses the usage record with the maximum reported usage during a period. Defaults to <code>sum</code>.
20 * @property null|int $amount The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. Only set if <code>billing_scheme=per_unit</code>.
21 * @property null|string $amount_decimal The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. Only set if <code>billing_scheme=per_unit</code>.
22 * @property string $billing_scheme Describes how to compute the price per period. Either <code>per_unit</code> or <code>tiered</code>. <code>per_unit</code> indicates that the fixed amount (specified in <code>amount</code>) will be charged per unit in <code>quantity</code> (for plans with <code>usage_type=licensed</code>), or per unit of total usage (for plans with <code>usage_type=metered</code>). <code>tiered</code> indicates that the unit pricing will be computed using a tiering strategy as defined using the <code>tiers</code> and <code>tiers_mode</code> attributes.
23 * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
24 * @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
25 * @property string $interval The frequency at which a subscription is billed. One of <code>day</code>, <code>week</code>, <code>month</code> or <code>year</code>.
26 * @property int $interval_count The number of intervals (specified in the <code>interval</code> attribute) between subscription billings. For example, <code>interval=month</code> and <code>interval_count=3</code> bills every 3 months.
27 * @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.
28 * @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
29 * @property null|string $meter The meter tracking the usage of a metered price
30 * @property null|string $nickname A brief description of the plan, hidden from customers.
31 * @property null|string|\Stripe\Product $product The product whose pricing this plan determines.
32 * @property null|\Stripe\StripeObject[] $tiers Each element represents a pricing tier. This parameter requires <code>billing_scheme</code> to be set to <code>tiered</code>. See also the documentation for <code>billing_scheme</code>.
33 * @property null|string $tiers_mode Defines if the tiering price should be <code>graduated</code> or <code>volume</code> based. In <code>volume</code>-based tiering, the maximum quantity within a period determines the per unit price. In <code>graduated</code> tiering, pricing can change as the quantity grows.
34 * @property null|\Stripe\StripeObject $transform_usage Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with <code>tiers</code>.
35 * @property null|int $trial_period_days Default number of trial days when subscribing a customer to this plan using <a href="https://stripe.com/docs/api#create_subscription-trial_from_plan"><code>trial_from_plan=true</code></a>.
36 * @property string $usage_type Configures how the quantity per period should be determined. Can be either <code>metered</code> or <code>licensed</code>. <code>licensed</code> automatically bills the <code>quantity</code> set when adding it to a subscription. <code>metered</code> aggregates the total usage based on usage records. Defaults to <code>licensed</code>.
37 */
38 class Plan extends ApiResource
39 {
40 const OBJECT_NAME = 'plan';
41 use ApiOperations\Update;
42 const AGGREGATE_USAGE_LAST_DURING_PERIOD = 'last_during_period';
43 const AGGREGATE_USAGE_LAST_EVER = 'last_ever';
44 const AGGREGATE_USAGE_MAX = 'max';
45 const AGGREGATE_USAGE_SUM = 'sum';
46 const BILLING_SCHEME_PER_UNIT = 'per_unit';
47 const BILLING_SCHEME_TIERED = 'tiered';
48 const INTERVAL_DAY = 'day';
49 const INTERVAL_MONTH = 'month';
50 const INTERVAL_WEEK = 'week';
51 const INTERVAL_YEAR = 'year';
52 const TIERS_MODE_GRADUATED = 'graduated';
53 const TIERS_MODE_VOLUME = 'volume';
54 const USAGE_TYPE_LICENSED = 'licensed';
55 const USAGE_TYPE_METERED = 'metered';
56 /**
57 * You can now model subscriptions more flexibly using the <a href="#prices">Prices
58 * API</a>. It replaces the Plans API and is backwards compatible to simplify your
59 * migration.
60 *
61 * @param null|array $params
62 * @param null|array|string $options
63 *
64 * @throws \Stripe\Exception\ApiErrorException if the request fails
65 *
66 * @return \Stripe\Plan the created resource
67 */
68 public static function create($params = null, $options = null)
69 {
70 self::_validateParams($params);
71 $url = static::classUrl();
72 list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
73 $obj = \WPForms\Vendor\Stripe\Util\Util::convertToStripeObject($response->json, $opts);
74 $obj->setLastResponse($response);
75 return $obj;
76 }
77 /**
78 * Deleting plans means new subscribers can’t be added. Existing subscribers aren’t
79 * affected.
80 *
81 * @param null|array $params
82 * @param null|array|string $opts
83 *
84 * @throws \Stripe\Exception\ApiErrorException if the request fails
85 *
86 * @return \Stripe\Plan the deleted resource
87 */
88 public function delete($params = null, $opts = null)
89 {
90 self::_validateParams($params);
91 $url = $this->instanceUrl();
92 list($response, $opts) = $this->_request('delete', $url, $params, $opts);
93 $this->refreshFrom($response, $opts);
94 return $this;
95 }
96 /**
97 * Returns a list of your plans.
98 *
99 * @param null|array $params
100 * @param null|array|string $opts
101 *
102 * @throws \Stripe\Exception\ApiErrorException if the request fails
103 *
104 * @return \Stripe\Collection<\Stripe\Plan> of ApiResources
105 */
106 public static function all($params = null, $opts = null)
107 {
108 $url = static::classUrl();
109 return static::_requestPage($url, \WPForms\Vendor\Stripe\Collection::class, $params, $opts);
110 }
111 /**
112 * Retrieves the plan with the given ID.
113 *
114 * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
115 * @param null|array|string $opts
116 *
117 * @throws \Stripe\Exception\ApiErrorException if the request fails
118 *
119 * @return \Stripe\Plan
120 */
121 public static function retrieve($id, $opts = null)
122 {
123 $opts = \WPForms\Vendor\Stripe\Util\RequestOptions::parse($opts);
124 $instance = new static($id, $opts);
125 $instance->refresh();
126 return $instance;
127 }
128 /**
129 * Updates the specified plan by setting the values of the parameters passed. Any
130 * parameters not provided are left unchanged. By design, you cannot change a
131 * plan’s ID, amount, currency, or billing cycle.
132 *
133 * @param string $id the ID of the resource to update
134 * @param null|array $params
135 * @param null|array|string $opts
136 *
137 * @throws \Stripe\Exception\ApiErrorException if the request fails
138 *
139 * @return \Stripe\Plan the updated resource
140 */
141 public static function update($id, $params = null, $opts = null)
142 {
143 self::_validateParams($params);
144 $url = static::resourceUrl($id);
145 list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
146 $obj = \WPForms\Vendor\Stripe\Util\Util::convertToStripeObject($response->json, $opts);
147 $obj->setLastResponse($response);
148 return $obj;
149 }
150 }
151