Skip to content

Commit

Permalink
Merge pull request #1588 from stripe/latest-codegen-beta
Browse files Browse the repository at this point in the history
Update generated code for beta
  • Loading branch information
pakrym-stripe authored Oct 11, 2023
2 parents 05c237e + 58462f0 commit 8bd0acc
Show file tree
Hide file tree
Showing 19 changed files with 404 additions and 17 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ jobs:
make ci-test
- name: Coveralls
run: vendor/bin/php-coveralls -v --coverage_clover='clover.xml' --json_path='coveralls-upload.json'
if: env.COVERALLS_REPO_TOKEN && matrix.php-version == '8.2' && matrix.env == 'AUTOLOAD=1'
env:
COVERALLS_RUN_LOCALLY: 1
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
COVERALLS_FLAG_NAME: php-${{ matrix.php-version }}-${{ matrix.env }}
if: matrix.php-version == '8.2' && matrix.env == 'AUTOLOAD=1'
uses: coverallsapp/github-action@v2
with:
files: clover.xml
flag-name: php-${{ matrix.php-version }}-${{ matrix.env }}
github-token: ${{ secrets.GITHUB_TOKEN }}

publish:
# Doesn't actually publish. The publish happens via a packagist webhook configured in the Github UI. But we still display a message here
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
# Changelog

## 12.7.0 - 2023-10-11
* [#1589](https://github.com/stripe/stripe-php/pull/1589) Update generated code
* Add support for `client_secret`, `redirect_on_completion`, `return_url`, and `ui_mode` on `Checkout.Session`
* Add support for `offline` on `Terminal.Configuration`

## 12.7.0-beta.1 - 2023-10-05
* [#1587](https://github.com/stripe/stripe-php/pull/1587) Update generated code for beta
* Add support for `mark_draft` and `mark_stale` methods on resource `Quote`
* Remove support for `draft_quote` and `mark_stale_quote` methods on resource `Quote`
* Add support for `allow_backdated_lines` on `Quote`
* Rename `previewInvoiceLines` to `allPreviewInvoiceLines` on resource `Quote`

## 12.6.0 - 2023-10-05
* [#1586](https://github.com/stripe/stripe-php/pull/1586) Update generated code
* Add support for new resource `Issuing.Token`
* Add support for `all`, `retrieve`, and `update` methods on resource `Token`
* Add support for `token` on `Issuing.Authorization` and `Issuing.Transaction`
* [#1569](https://github.com/stripe/stripe-php/pull/1569) Fix: Do not bother removing `friendsofphp/php-cs-fixer`

## 12.6.0-beta.1 - 2023-09-28
* [#1585](https://github.com/stripe/stripe-php/pull/1585) Update generated code for beta
* Rename resources `Issuing.CardDesign` and `Issuing.CardBundle` to `Issuing.PersonalizationDesign` and `Issuing.PhysicalBundle`
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v582
v597
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
"require-dev": {
"phpunit/phpunit": "^5.7 || ^9.0",
"friendsofphp/php-cs-fixer": "3.5.0",
"phpstan/phpstan": "^1.2",
"php-coveralls/php-coveralls": "^2.5"
"phpstan/phpstan": "^1.2"
},
"autoload": {
"psr-4": {
Expand Down
4 changes: 4 additions & 0 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
// The beginning of the section generated from our OpenAPI spec
require __DIR__ . '/lib/Account.php';
require __DIR__ . '/lib/AccountLink.php';
require __DIR__ . '/lib/AccountNotice.php';
require __DIR__ . '/lib/AccountSession.php';
require __DIR__ . '/lib/ApplePayDomain.php';
require __DIR__ . '/lib/ApplicationFee.php';
Expand Down Expand Up @@ -135,6 +136,7 @@
require __DIR__ . '/lib/Issuing/Authorization.php';
require __DIR__ . '/lib/Issuing/Card.php';
require __DIR__ . '/lib/Issuing/Cardholder.php';
require __DIR__ . '/lib/Issuing/CreditUnderwritingRecord.php';
require __DIR__ . '/lib/Issuing/Dispute.php';
require __DIR__ . '/lib/Issuing/PersonalizationDesign.php';
require __DIR__ . '/lib/Issuing/PhysicalBundle.php';
Expand Down Expand Up @@ -168,6 +170,7 @@
require __DIR__ . '/lib/Reporting/ReportType.php';
require __DIR__ . '/lib/Review.php';
require __DIR__ . '/lib/Service/AccountLinkService.php';
require __DIR__ . '/lib/Service/AccountNoticeService.php';
require __DIR__ . '/lib/Service/AccountService.php';
require __DIR__ . '/lib/Service/AccountSessionService.php';
require __DIR__ . '/lib/Service/ApplePayDomainService.php';
Expand Down Expand Up @@ -214,6 +217,7 @@
require __DIR__ . '/lib/Service/Issuing/AuthorizationService.php';
require __DIR__ . '/lib/Service/Issuing/CardService.php';
require __DIR__ . '/lib/Service/Issuing/CardholderService.php';
require __DIR__ . '/lib/Service/Issuing/CreditUnderwritingRecordService.php';
require __DIR__ . '/lib/Service/Issuing/DisputeService.php';
require __DIR__ . '/lib/Service/Issuing/IssuingServiceFactory.php';
require __DIR__ . '/lib/Service/Issuing/PersonalizationDesignService.php';
Expand Down
41 changes: 41 additions & 0 deletions lib/AccountNotice.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe;

/**
* A notice to a Connected account. Notice can be sent by Stripe on your behalf or you can opt to send the notices yourself.
*
* See the <a href="https://stripe.com/docs/issuing/compliance-us/issuing-regulated-customer-notices">guide to send notices</a> to your connected accounts.
*
* @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.
* @property null|int $deadline When present, the deadline for sending the notice to meet the relevant regulations.
* @property null|\Stripe\StripeObject $email Information about the email when sent.
* @property null|\Stripe\StripeObject $linked_objects Information about objects related to the notice.
* @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 $reason Reason the notice is being sent. The reason determines what copy the notice must contain. See the <a href="https://stripe.com/docs/issuing/compliance-us/issuing-regulated-customer-notices">regulated customer notices</a> guide. All reasons might not apply to your integration, and Stripe might add new reasons in the future, so we recommend an internal warning when you receive an unknown reason.
* @property null|int $sent_at Date when the notice was sent. When absent, you must send the notice, update the content of the email and date when it was sent.
*/
class AccountNotice extends ApiResource
{
const OBJECT_NAME = 'account_notice';

use ApiOperations\All;
use ApiOperations\Retrieve;
use ApiOperations\Update;

const REASON_ISSUING_ACCOUNT_CLOSED_FOR_INACTIVITY = 'issuing.account_closed_for_inactivity';
const REASON_ISSUING_ACCOUNT_CLOSED_FOR_TERMS_OF_SERVICE_VIOLATION = 'issuing.account_closed_for_terms_of_service_violation';
const REASON_ISSUING_APPLICATION_REJECTED_FOR_FAILURE_TO_VERIFY = 'issuing.application_rejected_for_failure_to_verify';
const REASON_ISSUING_CREDIT_APPLICATION_REJECTED = 'issuing.credit_application_rejected';
const REASON_ISSUING_CREDIT_INCREASE_APPLICATION_REJECTED = 'issuing.credit_increase_application_rejected';
const REASON_ISSUING_CREDIT_LIMIT_DECREASED = 'issuing.credit_limit_decreased';
const REASON_ISSUING_CREDIT_LINE_CLOSED = 'issuing.credit_line_closed';
const REASON_ISSUING_DISPUTE_LOST = 'issuing.dispute_lost';
const REASON_ISSUING_DISPUTE_SUBMITTED = 'issuing.dispute_submitted';
const REASON_ISSUING_DISPUTE_WON = 'issuing.dispute_won';
}
2 changes: 1 addition & 1 deletion lib/BalanceTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @property int $fee Fees (in cents (or local equivalent)) paid for this transaction. Represented as a positive integer when assessed.
* @property \Stripe\StripeObject[] $fee_details Detailed breakdown of fees (in cents (or local equivalent)) paid for this transaction.
* @property int $net Net impact to a Stripe balance (in cents (or local equivalent)). A positive value represents incrementing a Stripe balance, and a negative value decrementing a Stripe balance. You can calculate the net impact of a transaction on a balance by <code>amount</code> - <code>fee</code>
* @property string $reporting_category Learn more about how [reporting categories] (https://stripe.com/docs/reports/reporting-categories) can help you understand balance transactions from an accounting perspective.
* @property string $reporting_category Learn more about how <a href="https://stripe.com/docs/reports/reporting-categories">reporting categories</a> can help you understand balance transactions from an accounting perspective.
* @property null|string|\Stripe\StripeObject $source This transaction relates to the Stripe object.
* @property string $status The transaction's net funds status in the Stripe balance, which are either <code>available</code> or <code>pending</code>.
* @property string $type Transaction type: <code>adjustment</code>, <code>advance</code>, <code>advance_funding</code>, <code>anticipation_repayment</code>, <code>application_fee</code>, <code>application_fee_refund</code>, <code>charge</code>, <code>connect_collection_transfer</code>, <code>contribution</code>, <code>issuing_authorization_hold</code>, <code>issuing_authorization_release</code>, <code>issuing_dispute</code>, <code>issuing_transaction</code>, <code>obligation_inbound</code>, <code>obligation_outbound</code>, <code>obligation_reversal_inbound</code>, <code>obligation_reversal_outbound</code>, <code>obligation_payout</code>, <code>obligation_payout_failure</code>, <code>payment</code>, <code>payment_failure_refund</code>, <code>payment_refund</code>, <code>payment_reversal</code>, <code>payout</code>, <code>payout_cancel</code>, <code>payout_failure</code>, <code>refund</code>, <code>refund_failure</code>, <code>reserve_transaction</code>, <code>reserved_funds</code>, <code>stripe_fee</code>, <code>stripe_fx_fee</code>, <code>tax_fee</code>, <code>topup</code>, <code>topup_reversal</code>, <code>transfer</code>, <code>transfer_cancel</code>, <code>transfer_failure</code>, or <code>transfer_refund</code>. Learn more about <a href="https://stripe.com/docs/reports/balance-transaction-types">balance transaction types and what they represent</a>. To classify transactions for accounting purposes, consider <code>reporting_category</code> instead.
Expand Down
11 changes: 11 additions & 0 deletions lib/Checkout/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
* @property null|string $billing_address_collection Describes whether Checkout should collect the customer's billing address.
* @property null|string $cancel_url If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website.
* @property null|string $client_reference_id A unique string to reference the Checkout Session. This can be a customer ID, a cart ID, or similar, and can be used to reconcile the Session with your internal systems.
* @property null|string $client_secret Client secret to be used when initializing Stripe.js embedded checkout.
* @property null|\Stripe\StripeObject $consent Results of <code>consent_collection</code> for this session.
* @property null|\Stripe\StripeObject $consent_collection When set, provides configuration for the Checkout Session to gather active consent from customers.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
Expand Down Expand Up @@ -58,6 +59,8 @@
* @property string $payment_status The payment status of the Checkout Session, one of <code>paid</code>, <code>unpaid</code>, or <code>no_payment_required</code>. You can use this value to decide when to fulfill your customer's order.
* @property null|\Stripe\StripeObject $phone_number_collection
* @property null|string $recovered_from The ID of the original expired Checkout Session that triggered the recovery flow.
* @property null|string $redirect_on_completion Applies to Checkout Sessions with <code>ui_mode: embedded</code>. By default, Stripe will always redirect to your return_url after a successful confirmation. If you set <code>redirect_on_completion: 'if_required'</code>, then we will only redirect if your user chooses a redirect-based payment method.
* @property null|string $return_url Applies to Checkout Sessions with <code>ui_mode: embedded</code>. The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site.
* @property null|string|\Stripe\SetupIntent $setup_intent The ID of the SetupIntent for Checkout Sessions in <code>setup</code> mode.
* @property null|\Stripe\StripeObject $shipping_address_collection When set, provides configuration for Checkout to collect a shipping address from a customer.
* @property null|\Stripe\StripeObject $shipping_cost The details of the customer cost of shipping, including the customer chosen ShippingRate.
Expand All @@ -69,6 +72,7 @@
* @property null|string $success_url The URL the customer will be directed to after the payment or subscription creation is successful.
* @property null|\Stripe\StripeObject $tax_id_collection
* @property null|\Stripe\StripeObject $total_details Tax and discount details for the computed total amount.
* @property null|string $ui_mode The UI mode of the Session. Can be <code>hosted</code> (default) or <code>embedded</code>.
* @property null|string $url The URL to the Checkout Session. Redirect customers to this URL to take them to Checkout. If you’re using <a href="https://stripe.com/docs/payments/checkout/custom-domains">Custom Domains</a>, the URL will use your subdomain. Otherwise, it’ll use <code>checkout.stripe.com.</code> This value is only present when the session is active.
*/
class Session extends \Stripe\ApiResource
Expand Down Expand Up @@ -96,6 +100,10 @@ class Session extends \Stripe\ApiResource
const PAYMENT_STATUS_PAID = 'paid';
const PAYMENT_STATUS_UNPAID = 'unpaid';

const REDIRECT_ON_COMPLETION_ALWAYS = 'always';
const REDIRECT_ON_COMPLETION_IF_REQUIRED = 'if_required';
const REDIRECT_ON_COMPLETION_NEVER = 'never';

const STATUS_COMPLETE = 'complete';
const STATUS_EXPIRED = 'expired';
const STATUS_OPEN = 'open';
Expand All @@ -105,6 +113,9 @@ class Session extends \Stripe\ApiResource
const SUBMIT_TYPE_DONATE = 'donate';
const SUBMIT_TYPE_PAY = 'pay';

const UI_MODE_EMBEDDED = 'embedded';
const UI_MODE_HOSTED = 'hosted';

/**
* @param null|array $params
* @param null|array|string $opts
Expand Down
4 changes: 4 additions & 0 deletions lib/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ class Event extends ApiResource
const ACCOUNT_EXTERNAL_ACCOUNT_CREATED = 'account.external_account.created';
const ACCOUNT_EXTERNAL_ACCOUNT_DELETED = 'account.external_account.deleted';
const ACCOUNT_EXTERNAL_ACCOUNT_UPDATED = 'account.external_account.updated';
const ACCOUNT_NOTICE_CREATED = 'account_notice.created';
const ACCOUNT_NOTICE_UPDATED = 'account_notice.updated';
const ACCOUNT_UPDATED = 'account.updated';
const APPLICATION_FEE_CREATED = 'application_fee.created';
const APPLICATION_FEE_REFUNDED = 'application_fee.refunded';
Expand Down Expand Up @@ -314,6 +316,8 @@ class Event extends ApiResource
const TYPE_ACCOUNT_EXTERNAL_ACCOUNT_CREATED = 'account.external_account.created';
const TYPE_ACCOUNT_EXTERNAL_ACCOUNT_DELETED = 'account.external_account.deleted';
const TYPE_ACCOUNT_EXTERNAL_ACCOUNT_UPDATED = 'account.external_account.updated';
const TYPE_ACCOUNT_NOTICE_CREATED = 'account_notice.created';
const TYPE_ACCOUNT_NOTICE_UPDATED = 'account_notice.updated';
const TYPE_ACCOUNT_UPDATED = 'account.updated';
const TYPE_APPLICATION_FEE_CREATED = 'application_fee.created';
const TYPE_APPLICATION_FEE_REFUNDED = 'application_fee.refunded';
Expand Down
104 changes: 104 additions & 0 deletions lib/Issuing/CreditUnderwritingRecord.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Issuing;

/**
* Every time an applicant submits an application for a Charge Card product your Platform offers, or every time your Platform takes a proactive credit decision on an existing account, you must record the decision by creating a new CreditUnderwritingRecord object on a Connected account.
*
* <a href="https://stripe.com/docs/issuing/coming_soon">Follow the guide</a> to learn about your requirements as a Platform.
*
* @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 null|\Stripe\StripeObject $application For decisions triggered by an application, details about the submission.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property string $created_from The event that triggered the underwriting.
* @property \Stripe\StripeObject $credit_user
* @property null|int $decided_at Date when a decision was made.
* @property null|\Stripe\StripeObject $decision Details about the decision.
* @property null|int $decision_deadline For underwriting initiated by an application, a decision must be taken 30 days after the submission.
* @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 null|\Stripe\StripeObject $underwriting_exception If an exception to the usual underwriting criteria was made for this application, details about the exception must be provided. Exceptions should only be granted in rare circumstances, in consultation with Stripe Compliance.
*/
class CreditUnderwritingRecord extends \Stripe\ApiResource
{
const OBJECT_NAME = 'issuing.credit_underwriting_record';

use \Stripe\ApiOperations\All;
use \Stripe\ApiOperations\Retrieve;

const CREATED_FROM_APPLICATION = 'application';
const CREATED_FROM_PROACTIVE_REVIEW = 'proactive_review';

/**
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Issuing\CreditUnderwritingRecord the corrected credit underwriting record
*/
public function correct($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/correct';
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);

return $this;
}

/**
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Issuing\CreditUnderwritingRecord the created credit underwriting record
*/
public static function createFromApplication($params = null, $opts = null)
{
$url = static::classUrl() . '/create_from_application';
list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);

return $obj;
}

/**
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Issuing\CreditUnderwritingRecord the created credit underwriting record
*/
public static function createFromProactiveReview($params = null, $opts = null)
{
$url = static::classUrl() . '/create_from_proactive_review';
list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);

return $obj;
}

/**
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Issuing\CreditUnderwritingRecord the reported credit underwriting record
*/
public function reportDecision($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/report_decision';
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);

return $this;
}
}
Loading

0 comments on commit 8bd0acc

Please sign in to comment.