Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated code for beta #1749

Merged
merged 7 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1268
v1278
40 changes: 40 additions & 0 deletions examples/ExampleTemplate.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

/**
* This is a template for defining new examples. It is not intended to be used directly.
*
* <describe what this example does>
*
* In this example, we:
* - <key step 1>
* - <key step 2
* - ...
*
* <describe assumptions about the user's stripe account, environment, or configuration;
* or things to watch out for when running>
*/
require 'vendor/autoload.php'; // Make sure to include Composer's autoload file
// Use this require statement to import the SDK from this repo folder
// require '../init.php';

class ExampleTemplate
{
private $apiKey;

public function __construct($apiKey)
{
$this->apiKey = $apiKey;
}

public function doSomethingGreat()
{
echo "Hello World\n";
// $client = new \Stripe\StripeClient($this->apiKey);
}
}

// Usage
$apiKey = '{{API_KEY}}';

$example = new ExampleTemplate($apiKey);
$example->doSomethingGreat();
11 changes: 11 additions & 0 deletions examples/MeterEventStream.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
<?php

/**
* Use the high-throughput MeterEventStream to report create billing meter events.
*
* In this example, we:
* - create a meter event session and store the session's authentication token
* - define an event with a payload
* - use the meterEventStream service to create an event stream that reports this event
*
* This example expects a billing meter with an event_name of 'alpaca_ai_tokens'. If you have
* a different meter event name, you can change it before running this example.
*/
require 'vendor/autoload.php'; // Make sure to include Composer's autoload file

class MeterEventStream
Expand Down
26 changes: 0 additions & 26 deletions examples/NewExample.php

This file was deleted.

11 changes: 8 additions & 3 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
From the examples folder, run:
`php your_example.php`

e.g.

`php ThinEventWebhookHandler.php`

## Adding a new example

1. Clone new_example.php
1. Clone ExampleTemplate.php
2. Implement your example
3. Run it (as per above)
4. 👍
3. Fill out the file comment. Include a description and key steps that are being demonstrated.
4. Run it (as per above)
5. 👍
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* Receive and process thin events like the v1.billing.meter.error_report_triggered event.
*
* In this example, we:
* - use parseThinEvent to parse the received thin event webhook body
* - call StripeClient.v2.core.events.retrieve to retrieve the full event object
* - if it is a V1BillingMeterErrorReportTriggeredEvent event type, call fetchRelatedObject
* to retrieve the Billing Meter object associated with the event.
*/
require 'vendor/autoload.php';

$api_key = getenv('STRIPE_API_KEY');
Expand Down
5 changes: 3 additions & 2 deletions lib/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @property null|\Stripe\StripeObject $business_profile Business information about the account.
* @property null|string $business_type The business type. After you create an <a href="/api/account_links">Account Link</a> or <a href="/api/account_sessions">Account Session</a>, this property is only returned for accounts where <a href="/api/accounts/object#account_object-controller-requirement_collection">controller.requirement_collection</a> is <code>application</code>, which includes Custom accounts.
* @property null|\Stripe\StripeObject $capabilities
* @property null|bool $charges_enabled Whether the account can create live charges.
* @property null|bool $charges_enabled Whether the account can process charges.
* @property null|\Stripe\StripeObject $company
* @property null|\Stripe\StripeObject $controller
* @property null|string $country The account's country.
Expand All @@ -33,9 +33,10 @@
* @property null|string $email An email address associated with the account. It's not used for authentication and Stripe doesn't market to this field without explicit approval from the platform.
* @property null|\Stripe\Collection<\Stripe\BankAccount|\Stripe\Card> $external_accounts External accounts (bank accounts and debit cards) currently attached to this account. External accounts are only returned for requests where <code>controller[is_controller]</code> is true.
* @property null|\Stripe\StripeObject $future_requirements
* @property null|\Stripe\StripeObject $groups The groups associated with the account.
* @property null|\Stripe\Person $individual <p>This is an object representing a person associated with a Stripe account.</p><p>A platform cannot access a person for an account where <a href="/api/accounts/object#account_object-controller-requirement_collection">account.controller.requirement_collection</a> is <code>stripe</code>, which includes Standard and Express accounts, after creating an Account Link or Account Session to start Connect onboarding.</p><p>See the <a href="/connect/standard-accounts">Standard onboarding</a> or <a href="/connect/express-accounts">Express onboarding</a> documentation for information about prefilling information and account onboarding steps. Learn more about <a href="/connect/handling-api-verification#person-information">handling identity verification with the API</a>.</p>
* @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.
* @property null|bool $payouts_enabled Whether Stripe can send payouts to this account.
* @property null|bool $payouts_enabled Whether the funds in this account can be paid out.
* @property null|\Stripe\StripeObject $requirements
* @property null|\Stripe\StripeObject $risk_controls
* @property null|\Stripe\StripeObject $settings Options for customizing how the account functions within Stripe.
Expand Down
4 changes: 2 additions & 2 deletions lib/Billing/CreditGrant.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
* @property \Stripe\StripeObject $applicability_config
* @property string $category The category of this credit grant.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property string|\Stripe\Customer $customer Id of the customer to whom the credit was granted.
* @property string|\Stripe\Customer $customer ID of the customer to whom the credit was granted.
* @property null|int $effective_at The time when the credit becomes effective i.e when it is eligible to be used.
* @property null|int $expires_at The time when the credit will expire. If not present, the credit will never expire.
* @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.
* @property \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.
* @property null|string $name A descriptive name shown in dashboard and on invoices.
* @property null|string $name A descriptive name shown in dashboard.
* @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this credit grant belongs to.
* @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch.
* @property null|int $voided_at The time when this credit grant was voided. If not present, the credit grant hasn't been voided.
Expand Down
2 changes: 2 additions & 0 deletions lib/Billing/Meter.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
/**
* A billing meter is a resource that allows you to track usage of a particular event. For example, you might create a billing meter to track the number of API calls made by a particular user. You can then attach the billing meter to a price and attach the price to a subscription to charge the user for the number of API calls they make.
*
* Related guide: <a href="https://docs.stripe.com/billing/subscriptions/usage-based">Usage based billing</a>
*
* @property string $id Unique identifier for the object.
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
Expand Down
1 change: 1 addition & 0 deletions lib/ErrorObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ class ErrorObject extends StripeObject
const CODE_PAYMENT_METHOD_UNEXPECTED_STATE = 'payment_method_unexpected_state';
const CODE_PAYMENT_METHOD_UNSUPPORTED_TYPE = 'payment_method_unsupported_type';
const CODE_PAYOUT_RECONCILIATION_NOT_READY = 'payout_reconciliation_not_ready';
const CODE_PAYOUT_STATEMENT_DESCRIPTOR_PROFANITY = 'payout_statement_descriptor_profanity';
const CODE_PAYOUTS_LIMIT_EXCEEDED = 'payouts_limit_exceeded';
const CODE_PAYOUTS_NOT_ALLOWED = 'payouts_not_allowed';
const CODE_PLATFORM_ACCOUNT_REQUIRED = 'platform_account_required';
Expand Down
2 changes: 2 additions & 0 deletions lib/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ class Event extends ApiResource
const RADAR_EARLY_FRAUD_WARNING_CREATED = 'radar.early_fraud_warning.created';
const RADAR_EARLY_FRAUD_WARNING_UPDATED = 'radar.early_fraud_warning.updated';
const REFUND_CREATED = 'refund.created';
const REFUND_FAILED = 'refund.failed';
const REFUND_UPDATED = 'refund.updated';
const REPORTING_REPORT_RUN_FAILED = 'reporting.report_run.failed';
const REPORTING_REPORT_RUN_SUCCEEDED = 'reporting.report_run.succeeded';
Expand Down Expand Up @@ -517,6 +518,7 @@ class Event extends ApiResource
const TYPE_RADAR_EARLY_FRAUD_WARNING_CREATED = 'radar.early_fraud_warning.created';
const TYPE_RADAR_EARLY_FRAUD_WARNING_UPDATED = 'radar.early_fraud_warning.updated';
const TYPE_REFUND_CREATED = 'refund.created';
const TYPE_REFUND_FAILED = 'refund.failed';
const TYPE_REFUND_UPDATED = 'refund.updated';
const TYPE_REPORTING_REPORT_RUN_FAILED = 'reporting.report_run.failed';
const TYPE_REPORTING_REPORT_RUN_SUCCEEDED = 'reporting.report_run.succeeded';
Expand Down
1 change: 1 addition & 0 deletions lib/Forwarding/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @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.
* @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.
* @property string $payment_method The PaymentMethod to insert into the forwarded request. Forwarding previously consumed PaymentMethods is allowed.
* @property string[] $replacements The field kinds to be replaced in the forwarded request.
* @property null|\Stripe\StripeObject $request_context Context about the request from Stripe's servers to the destination endpoint.
Expand Down
2 changes: 1 addition & 1 deletion lib/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
* @property null|\Stripe\StripeObject[] $total_discount_amounts The aggregate amounts calculated per discount across all line items.
* @property null|int $total_excluding_tax The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax.
* @property null|\Stripe\StripeObject[] $total_margin_amounts The aggregate amounts calculated per margin across all line items.
* @property null|\Stripe\StripeObject[] $total_pretax_credit_amounts
* @property null|\Stripe\StripeObject[] $total_pretax_credit_amounts Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this invoice. This is a combined list of total_pretax_credit_amounts across all invoice line items.
* @property \Stripe\StripeObject[] $total_tax_amounts The aggregate amounts calculated per tax rate for all line items.
* @property null|\Stripe\StripeObject $transfer_data The account (if any) the payment will be attributed to for tax reporting, and where funds from the payment will be transferred to for the invoice.
* @property null|int $webhooks_delivered_at Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have <a href="https://stripe.com/docs/billing/webhooks#understand">been exhausted</a>. This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created.
Expand Down
2 changes: 1 addition & 1 deletion lib/InvoiceLineItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* @property \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. Note that for line items with <code>type=subscription</code>, <code>metadata</code> reflects the current metadata from the subscription associated with the line item, unless the invoice line was directly updated with different metadata after creation.
* @property \Stripe\StripeObject $period
* @property null|\Stripe\Plan $plan The plan of the subscription, if the line item is a subscription or a proration.
* @property null|\Stripe\StripeObject[] $pretax_credit_amounts
* @property null|\Stripe\StripeObject[] $pretax_credit_amounts Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this line item.
* @property null|\Stripe\Price $price The price of the line item.
* @property bool $proration Whether this is a proration.
* @property null|\Stripe\StripeObject $proration_details Additional details for proration line items
Expand Down
1 change: 1 addition & 0 deletions lib/Issuing/Authorization.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class Authorization extends \Stripe\ApiResource
const AUTHORIZATION_METHOD_SWIPE = 'swipe';

const STATUS_CLOSED = 'closed';
const STATUS_EXPIRED = 'expired';
const STATUS_PENDING = 'pending';
const STATUS_REVERSED = 'reversed';

Expand Down
10 changes: 10 additions & 0 deletions lib/PaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,20 @@
* @property null|\Stripe\StripeObject $grabpay
* @property null|\Stripe\StripeObject $ideal
* @property null|\Stripe\StripeObject $interac_present
* @property null|\Stripe\StripeObject $kakao_pay
* @property null|\Stripe\StripeObject $klarna
* @property null|\Stripe\StripeObject $konbini
* @property null|\Stripe\StripeObject $kr_card
* @property null|\Stripe\StripeObject $link
* @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.
* @property null|\Stripe\StripeObject $mb_way
* @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.
* @property null|\Stripe\StripeObject $mobilepay
* @property null|\Stripe\StripeObject $multibanco
* @property null|\Stripe\StripeObject $naver_pay
* @property null|\Stripe\StripeObject $oxxo
* @property null|\Stripe\StripeObject $p24
* @property null|\Stripe\StripeObject $payco
* @property null|\Stripe\StripeObject $paynow
* @property null|\Stripe\StripeObject $paypal
* @property null|\Stripe\StripeObject $payto
Expand All @@ -55,6 +59,7 @@
* @property null|\Stripe\StripeObject $radar_options Options to configure Radar. See <a href="https://stripe.com/docs/radar/radar-session">Radar Session</a> for more information.
* @property null|\Stripe\StripeObject $rechnung
* @property null|\Stripe\StripeObject $revolut_pay
* @property null|\Stripe\StripeObject $samsung_pay
* @property null|\Stripe\StripeObject $sepa_debit
* @property null|\Stripe\StripeObject $sofort
* @property null|\Stripe\StripeObject $swish
Expand Down Expand Up @@ -94,21 +99,26 @@ class PaymentMethod extends ApiResource
const TYPE_GRABPAY = 'grabpay';
const TYPE_IDEAL = 'ideal';
const TYPE_INTERAC_PRESENT = 'interac_present';
const TYPE_KAKAO_PAY = 'kakao_pay';
const TYPE_KLARNA = 'klarna';
const TYPE_KONBINI = 'konbini';
const TYPE_KR_CARD = 'kr_card';
const TYPE_LINK = 'link';
const TYPE_MB_WAY = 'mb_way';
const TYPE_MOBILEPAY = 'mobilepay';
const TYPE_MULTIBANCO = 'multibanco';
const TYPE_NAVER_PAY = 'naver_pay';
const TYPE_OXXO = 'oxxo';
const TYPE_P24 = 'p24';
const TYPE_PAYCO = 'payco';
const TYPE_PAYNOW = 'paynow';
const TYPE_PAYPAL = 'paypal';
const TYPE_PAYTO = 'payto';
const TYPE_PIX = 'pix';
const TYPE_PROMPTPAY = 'promptpay';
const TYPE_RECHNUNG = 'rechnung';
const TYPE_REVOLUT_PAY = 'revolut_pay';
const TYPE_SAMSUNG_PAY = 'samsung_pay';
const TYPE_SEPA_DEBIT = 'sepa_debit';
const TYPE_SOFORT = 'sofort';
const TYPE_SWISH = 'swish';
Expand Down
2 changes: 1 addition & 1 deletion lib/Person.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* @property null|string $first_name_kanji The Kanji variation of the person's first name (Japan only).
* @property null|string[] $full_name_aliases A list of alternate names or aliases that the person is known by.
* @property null|\Stripe\StripeObject $future_requirements Information about the <a href="https://stripe.com/docs/connect/custom-accounts/future-requirements">upcoming new requirements for this person</a>, including what information needs to be collected, and by when.
* @property null|string $gender The person's gender (International regulations require either &quot;male&quot; or &quot;female&quot;).
* @property null|string $gender The person's gender.
* @property null|bool $id_number_provided Whether the person's <code>id_number</code> was provided. True if either the full ID number was provided or if only the required part of the ID number was provided (ex. last four of an individual's SSN for the US indicated by <code>ssn_last_4_provided</code>).
* @property null|bool $id_number_secondary_provided Whether the person's <code>id_number_secondary</code> was provided.
* @property null|string $last_name The person's last name.
Expand Down
2 changes: 1 addition & 1 deletion lib/QuotePreviewInvoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
* @property null|\Stripe\StripeObject[] $total_discount_amounts The aggregate amounts calculated per discount across all line items.
* @property null|int $total_excluding_tax The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax.
* @property null|\Stripe\StripeObject[] $total_margin_amounts The aggregate amounts calculated per margin across all line items.
* @property null|\Stripe\StripeObject[] $total_pretax_credit_amounts
* @property null|\Stripe\StripeObject[] $total_pretax_credit_amounts Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this invoice. This is a combined list of total_pretax_credit_amounts across all invoice line items.
* @property \Stripe\StripeObject[] $total_tax_amounts The aggregate amounts calculated per tax rate for all line items.
* @property null|\Stripe\StripeObject $transfer_data The account (if any) the payment will be attributed to for tax reporting, and where funds from the payment will be transferred to for the invoice.
* @property null|int $webhooks_delivered_at Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have <a href="https://stripe.com/docs/billing/webhooks#understand">been exhausted</a>. This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created.
Expand Down
Loading
Loading