diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76ed4832b..549921226 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 61bd3c16e..6f7da2a4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # 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` @@ -7,6 +12,13 @@ * 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` diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 849d00a97..e5991fae3 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v582 \ No newline at end of file +v597 \ No newline at end of file diff --git a/composer.json b/composer.json index 8cda6ef6c..1e4dd7cbb 100644 --- a/composer.json +++ b/composer.json @@ -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": { diff --git a/init.php b/init.php index 75fe5a7e8..9e18b0d77 100644 --- a/init.php +++ b/init.php @@ -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'; @@ -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'; @@ -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'; @@ -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'; diff --git a/lib/AccountNotice.php b/lib/AccountNotice.php new file mode 100644 index 000000000..dfbf60855 --- /dev/null +++ b/lib/AccountNotice.php @@ -0,0 +1,41 @@ +guide to send notices 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 true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs 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 regulated customer notices 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'; +} diff --git a/lib/BalanceTransaction.php b/lib/BalanceTransaction.php index 97ee2a593..eac933859 100644 --- a/lib/BalanceTransaction.php +++ b/lib/BalanceTransaction.php @@ -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 amount - fee - * @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 reporting categories 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 available or pending. * @property string $type Transaction type: adjustment, advance, advance_funding, anticipation_repayment, application_fee, application_fee_refund, charge, connect_collection_transfer, contribution, issuing_authorization_hold, issuing_authorization_release, issuing_dispute, issuing_transaction, obligation_inbound, obligation_outbound, obligation_reversal_inbound, obligation_reversal_outbound, obligation_payout, obligation_payout_failure, payment, payment_failure_refund, payment_refund, payment_reversal, payout, payout_cancel, payout_failure, refund, refund_failure, reserve_transaction, reserved_funds, stripe_fee, stripe_fx_fee, tax_fee, topup, topup_reversal, transfer, transfer_cancel, transfer_failure, or transfer_refund. Learn more about balance transaction types and what they represent. To classify transactions for accounting purposes, consider reporting_category instead. diff --git a/lib/Checkout/Session.php b/lib/Checkout/Session.php index 302191c6f..5b0b0e974 100644 --- a/lib/Checkout/Session.php +++ b/lib/Checkout/Session.php @@ -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 consent_collection 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. @@ -58,6 +59,8 @@ * @property string $payment_status The payment status of the Checkout Session, one of paid, unpaid, or no_payment_required. 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 ui_mode: embedded. By default, Stripe will always redirect to your return_url after a successful confirmation. If you set redirect_on_completion: 'if_required', then we will only redirect if your user chooses a redirect-based payment method. + * @property null|string $return_url Applies to Checkout Sessions with ui_mode: embedded. 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 setup 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. @@ -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 hosted (default) or embedded. * @property null|string $url The URL to the Checkout Session. Redirect customers to this URL to take them to Checkout. If you’re using Custom Domains, the URL will use your subdomain. Otherwise, it’ll use checkout.stripe.com. This value is only present when the session is active. */ class Session extends \Stripe\ApiResource @@ -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'; @@ -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 diff --git a/lib/Event.php b/lib/Event.php index 876a0e9e5..cf22519c9 100644 --- a/lib/Event.php +++ b/lib/Event.php @@ -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'; @@ -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'; diff --git a/lib/Issuing/CreditUnderwritingRecord.php b/lib/Issuing/CreditUnderwritingRecord.php new file mode 100644 index 000000000..c78999e02 --- /dev/null +++ b/lib/Issuing/CreditUnderwritingRecord.php @@ -0,0 +1,104 @@ +Follow the guide 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 true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs 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; + } +} diff --git a/lib/Service/AccountNoticeService.php b/lib/Service/AccountNoticeService.php new file mode 100644 index 000000000..242aa4001 --- /dev/null +++ b/lib/Service/AccountNoticeService.php @@ -0,0 +1,57 @@ +AccountNotice objects. The objects are sorted + * in descending order by creation date, with the most-recently-created object + * appearing first. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\AccountNotice> + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/account_notices', $params, $opts); + } + + /** + * Retrieves an AccountNotice object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\AccountNotice + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/account_notices/%s', $id), $params, $opts); + } + + /** + * Updates an AccountNotice object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\AccountNotice + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/account_notices/%s', $id), $params, $opts); + } +} diff --git a/lib/Service/CoreServiceFactory.php b/lib/Service/CoreServiceFactory.php index 653aacf6e..1132665e8 100644 --- a/lib/Service/CoreServiceFactory.php +++ b/lib/Service/CoreServiceFactory.php @@ -8,6 +8,7 @@ * @property OAuthService $oauth * // Doc: The beginning of the section generated from our OpenAPI spec * @property AccountLinkService $accountLinks + * @property AccountNoticeService $accountNotices * @property AccountService $accounts * @property AccountSessionService $accountSessions * @property ApplePayDomainService $applePayDomains @@ -84,6 +85,7 @@ class CoreServiceFactory extends \Stripe\Service\AbstractServiceFactory 'oauth' => OAuthService::class, // Class Map: The beginning of the section generated from our OpenAPI spec 'accountLinks' => AccountLinkService::class, + 'accountNotices' => AccountNoticeService::class, 'accounts' => AccountService::class, 'accountSessions' => AccountSessionService::class, 'applePayDomains' => ApplePayDomainService::class, diff --git a/lib/Service/Issuing/CreditUnderwritingRecordService.php b/lib/Service/Issuing/CreditUnderwritingRecordService.php new file mode 100644 index 000000000..5f3b531c9 --- /dev/null +++ b/lib/Service/Issuing/CreditUnderwritingRecordService.php @@ -0,0 +1,106 @@ +CreditUnderwritingRecord objects. The objects + * are sorted in descending order by creation date, with the most-recently-created + * object appearing first. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Issuing\CreditUnderwritingRecord> + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/issuing/credit_underwriting_records', $params, $opts); + } + + /** + * Update a CreditUnderwritingRecord object to correct mistakes. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\CreditUnderwritingRecord + */ + public function correct($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/credit_underwriting_records/%s/correct', $id), $params, $opts); + } + + /** + * Creates a CreditUnderwritingRecord object with information about a + * credit application submission. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\CreditUnderwritingRecord + */ + public function createFromApplication($params = null, $opts = null) + { + return $this->request('post', '/v1/issuing/credit_underwriting_records/create_from_application', $params, $opts); + } + + /** + * Creates a CreditUnderwritingRecord object from an underwriting + * decision coming from a proactive review of an existing accountholder. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\CreditUnderwritingRecord + */ + public function createFromProactiveReview($params = null, $opts = null) + { + return $this->request('post', '/v1/issuing/credit_underwriting_records/create_from_proactive_review', $params, $opts); + } + + /** + * Update a CreditUnderwritingRecord object from an decision made on a + * credit application. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\CreditUnderwritingRecord + */ + public function reportDecision($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/credit_underwriting_records/%s/report_decision', $id), $params, $opts); + } + + /** + * Retrieves a CreditUnderwritingRecord object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\CreditUnderwritingRecord + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/issuing/credit_underwriting_records/%s', $id), $params, $opts); + } +} diff --git a/lib/Service/Issuing/IssuingServiceFactory.php b/lib/Service/Issuing/IssuingServiceFactory.php index 852351d2b..5ed8e7f0c 100644 --- a/lib/Service/Issuing/IssuingServiceFactory.php +++ b/lib/Service/Issuing/IssuingServiceFactory.php @@ -10,6 +10,7 @@ * @property AuthorizationService $authorizations * @property CardholderService $cardholders * @property CardService $cards + * @property CreditUnderwritingRecordService $creditUnderwritingRecords * @property DisputeService $disputes * @property PersonalizationDesignService $personalizationDesigns * @property PhysicalBundleService $physicalBundles @@ -25,6 +26,7 @@ class IssuingServiceFactory extends \Stripe\Service\AbstractServiceFactory 'authorizations' => AuthorizationService::class, 'cardholders' => CardholderService::class, 'cards' => CardService::class, + 'creditUnderwritingRecords' => CreditUnderwritingRecordService::class, 'disputes' => DisputeService::class, 'personalizationDesigns' => PersonalizationDesignService::class, 'physicalBundles' => PhysicalBundleService::class, diff --git a/lib/Service/SetupIntentService.php b/lib/Service/SetupIntentService.php index e7f84d7ca..17927a0f1 100644 --- a/lib/Service/SetupIntentService.php +++ b/lib/Service/SetupIntentService.php @@ -22,11 +22,11 @@ public function all($params = null, $opts = null) } /** - * A SetupIntent object can be canceled when it is in one of these statuses: + * You can cancel a SetupIntent object when it’s in one of these statuses: * requires_payment_method, requires_confirmation, or * requires_action. * - * Once canceled, setup is abandoned and any operations on the SetupIntent will + * After you cancel it, setup is abandoned and any operations on the SetupIntent * fail with an error. * * @param string $id diff --git a/lib/Service/SubscriptionService.php b/lib/Service/SubscriptionService.php index 31e2aa51c..131a138d1 100644 --- a/lib/Service/SubscriptionService.php +++ b/lib/Service/SubscriptionService.php @@ -155,11 +155,52 @@ public function search($params = null, $opts = null) } /** - * Updates an existing subscription on a customer to match the specified - * parameters. When changing plans or quantities, we will optionally prorate the - * price we charge next month to make up for any price changes. To preview how the - * proration will be calculated, use the upcoming - * invoice endpoint. + * Updates an existing subscription to match the specified parameters. When + * changing prices or quantities, we optionally prorate the price we charge next + * month to make up for any price changes. To preview how the proration is + * calculated, use the upcoming invoice + * endpoint. + * + * By default, we prorate subscription changes. For example, if a customer signs up + * on May 1 for a 100 price, they’ll be billed + * 100 immediately. If on May 15 they switch to a + * 200 price, then on June 1 they’ll be billed + * 250 (200 for a renewal of her + * subscription, plus a 50 prorating adjustment for half of + * the previous month’s 100 difference). Similarly, a + * downgrade generates a credit that is applied to the next invoice. We also + * prorate when you make quantity changes. + * + * Switching prices does not normally change the billing date or generate an + * immediate charge unless: + * + * + * + * In these cases, we apply a credit for the unused time on the previous price, + * immediately charge the customer using the new price, and reset the billing date. + * + * If you want to charge for an upgrade immediately, pass + * proration_behavior as always_invoice to create + * prorations, automatically invoice the customer for those proration adjustments, + * and attempt to collect payment. If you pass create_prorations, the + * prorations are created but not automatically invoiced. If you want to bill the + * customer for the prorations before the subscription’s renewal date, you need to + * manually invoice the customer. + * + * If you don’t want to prorate, set the proration_behavior option to + * none. With this option, the customer is billed + * 100 on May 1 and 200 on June 1. + * Similarly, if you set proration_behavior to none when + * switching between different billing intervals (for example, from monthly to + * yearly), we don’t generate any credits for the old subscription’s unused time. + * We still reset the billing date and bill immediately for the new subscription. + * + * Updating the quantity on a subscription many times in an hour may result in rate limiting. If you need to bill for a frequently + * changing quantity, consider integrating usage-based billing instead. * * @param string $id * @param null|array $params diff --git a/lib/StripeClient.php b/lib/StripeClient.php index 76d8d0044..3be83dd9a 100644 --- a/lib/StripeClient.php +++ b/lib/StripeClient.php @@ -8,6 +8,7 @@ * @property \Stripe\Service\OAuthService $oauth * // The beginning of the section generated from our OpenAPI spec * @property \Stripe\Service\AccountLinkService $accountLinks + * @property \Stripe\Service\AccountNoticeService $accountNotices * @property \Stripe\Service\AccountService $accounts * @property \Stripe\Service\AccountSessionService $accountSessions * @property \Stripe\Service\ApplePayDomainService $applePayDomains diff --git a/lib/Terminal/Configuration.php b/lib/Terminal/Configuration.php index 09a9d44df..9bc709eeb 100644 --- a/lib/Terminal/Configuration.php +++ b/lib/Terminal/Configuration.php @@ -12,6 +12,7 @@ * @property null|\Stripe\StripeObject $bbpos_wisepos_e * @property null|bool $is_account_default Whether this Configuration is the default for your account * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $offline * @property null|\Stripe\StripeObject $tipping * @property null|\Stripe\StripeObject $verifone_p400 */ diff --git a/lib/Util/ObjectTypes.php b/lib/Util/ObjectTypes.php index ec4e96048..e059c413b 100644 --- a/lib/Util/ObjectTypes.php +++ b/lib/Util/ObjectTypes.php @@ -16,6 +16,7 @@ class ObjectTypes // The beginning of the section generated from our OpenAPI spec \Stripe\Account::OBJECT_NAME => \Stripe\Account::class, \Stripe\AccountLink::OBJECT_NAME => \Stripe\AccountLink::class, + \Stripe\AccountNotice::OBJECT_NAME => \Stripe\AccountNotice::class, \Stripe\AccountSession::OBJECT_NAME => \Stripe\AccountSession::class, \Stripe\ApplePayDomain::OBJECT_NAME => \Stripe\ApplePayDomain::class, \Stripe\ApplicationFee::OBJECT_NAME => \Stripe\ApplicationFee::class, @@ -67,6 +68,7 @@ class ObjectTypes \Stripe\Issuing\Authorization::OBJECT_NAME => \Stripe\Issuing\Authorization::class, \Stripe\Issuing\Card::OBJECT_NAME => \Stripe\Issuing\Card::class, \Stripe\Issuing\Cardholder::OBJECT_NAME => \Stripe\Issuing\Cardholder::class, + \Stripe\Issuing\CreditUnderwritingRecord::OBJECT_NAME => \Stripe\Issuing\CreditUnderwritingRecord::class, \Stripe\Issuing\Dispute::OBJECT_NAME => \Stripe\Issuing\Dispute::class, \Stripe\Issuing\PersonalizationDesign::OBJECT_NAME => \Stripe\Issuing\PersonalizationDesign::class, \Stripe\Issuing\PhysicalBundle::OBJECT_NAME => \Stripe\Issuing\PhysicalBundle::class,