Skip to content

Commit

Permalink
Merge branch 'sdk-release/next-major' into prathmesh_remove_search_trait
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-stripe authored Mar 3, 2025
2 parents f609eb7 + 219fae0 commit bae9cce
Show file tree
Hide file tree
Showing 154 changed files with 4,440 additions and 376 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# All files should be reviewed by a member of the SDKs team
* @stripe/api-library-reviewers
11 changes: 11 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Why?
<!-- Describe why this change is being made. Briefly include history and context, high-level what this PR does, and what the world looks like afterward. -->

### What?
<!--
List out the key changes made in this PR, e.g.
- implements the antimatter particle trace in the nitronium microfilament drive
- updated tests -->

### See Also
<!-- Include any links or additional information that help explain this change. -->
40 changes: 14 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
php-cs-fixer:
name: PHP-CS-Fixer

runs-on: ubuntu-latest
runs-on: "ubuntu-24.04"

steps:
- uses: actions/checkout@v3
Expand All @@ -35,20 +35,16 @@ jobs:
phpstan:
name: PHPStan

runs-on: ubuntu-latest

strategy:
matrix:
php-version:
- "8.2"
runs-on: "ubuntu-24.04"

steps:
- uses: extractions/setup-just@v2
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
php-version: "8.2"

- name: Get Composer Cache Directory
id: composer-cache
Expand All @@ -69,19 +65,17 @@ jobs:
run: composer install --prefer-dist --no-progress

- name: Run phpstan
run: make phpstan
run: just lint

tests:
name: Tests

runs-on: ubuntu-latest
runs-on: "ubuntu-24.04"

strategy:
fail-fast: false
matrix:
env:
- AUTOLOAD=0
- AUTOLOAD=1
autoload:
- "0"
- "1"
php-version:
- "5.6"
- "7.0"
Expand All @@ -92,15 +86,16 @@ jobs:
- "8.0"
- "8.1"
- "8.2"
name: Tests (php@${{ matrix.php-version }}, AUTOLOAD=${{ matrix.autoload }})

steps:
- uses: extractions/setup-just@v2
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: xdebug

- name: Get Composer Cache Directory
id: composer-cache
Expand All @@ -125,17 +120,10 @@ jobs:
- uses: stripe/openapi/actions/stripe-mock@master

- name: Run test suite
# --yes skips the confirmation dialogue for the CI test, which modifies files
run: |
php --version
make ci-test
- name: Coveralls
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 }}
just --yes ci-test ${{ matrix.autoload }}
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 All @@ -144,7 +132,7 @@ jobs:
(github.event_name == 'workflow_dispatch' || github.event_name == 'push') &&
startsWith(github.ref, 'refs/tags/v') &&
endsWith(github.actor, '-stripe')
runs-on: ubuntu-latest
runs-on: "ubuntu-24.04"
steps:
- uses: actions/checkout@v2
- uses: stripe/openapi/actions/notify-release@master
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ build/*
# If the vendor directory isn't being commited the composer.lock file should also be ignored
composer.lock

# Ignore PHPUnit coverage file
clover.xml

# Ignore IDE's configuration files
.idea

Expand Down
158 changes: 158 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,163 @@
# Changelog

## 16.6.0 - 2025-02-24
* [#1809](https://github.com/stripe/stripe-php/pull/1809) Update generated code
* Add support for `priority` on `Billing.CreditGrant`
* Add support for `collected_information` on `Checkout.Session`
* [#1816](https://github.com/stripe/stripe-php/pull/1816) add codeowners file

## 16.5.1 - 2025-02-07
* [#1811](https://github.com/stripe/stripe-php/pull/1811) Include a useful error message when a null byte is found in the URL path
* [#1810](https://github.com/stripe/stripe-php/pull/1810) Make `httpClient()` a public, static method

## 16.5.0 - 2025-01-27
* [#1804](https://github.com/stripe/stripe-php/pull/1804) Update generated code
* Add support for `close` method on resource `Treasury.FinancialAccount`
* Add support for `discounts` on `Checkout.Session`
* Add support for new value `pay_by_bank` on enum `PaymentLink.payment_method_types[]`
* Add support for `pay_by_bank` on `PaymentMethodConfiguration` and `PaymentMethod`
* Add support for new value `pay_by_bank` on enum `PaymentMethod.type`
* Add support for `is_default` and `nickname` on `Treasury.FinancialAccount`
* [#1805](https://github.com/stripe/stripe-php/pull/1805) Restore testCoreEventsGet generated test
* [#1807](https://github.com/stripe/stripe-php/pull/1807) minor justfile fixes
* [#1806](https://github.com/stripe/stripe-php/pull/1806) Added CONTRIBUTING.md file
* [#1802](https://github.com/stripe/stripe-php/pull/1802) ensure dependencies are installed for format and test recipes
* [#1801](https://github.com/stripe/stripe-php/pull/1801) Add justfile, remove coveralls, and fix AUTOLOAD in CI
* [#1797](https://github.com/stripe/stripe-php/pull/1797) Added pull request template

## 16.4.0 - 2024-12-18
* [#1793](https://github.com/stripe/stripe-php/pull/1793) This release changes the pinned API version to `2024-12-18.acacia`.
* Add support for new values `payout_minimum_balance_hold` and `payout_minimum_balance_release` on enum `BalanceTransaction.type`
* Add support for `allow_redisplay` on `Card` and `Source`
* Add support for `regulated_status` on `Card`
* Add support for new value `request_signature` on enum `Forwarding.Request.replacements[]`
* Change type of `LineItem.description` from `string` to `nullable(string)`
* Add support for new values `al_tin`, `am_tin`, `ao_tin`, `ba_tin`, `bb_tin`, `bs_tin`, `cd_nif`, `gn_nif`, `kh_tin`, `me_pib`, `mk_vat`, `mr_nif`, `np_pan`, `sn_ninea`, `sr_fin`, `tj_tin`, `ug_tin`, `zm_tin`, and `zw_tin` on enum `TaxId.type`

## 16.3.0 - 2024-11-20
* [#1786](https://github.com/stripe/stripe-php/pull/1786) This release changes the pinned API version to `2024-11-20.acacia`.
* Add support for `respond` test helper method on resource `Issuing.Authorization`
* Add support for `adaptive_pricing` on `Checkout.Session`
* Add support for new value `subscribe` on enums `Checkout.Session.submit_type` and `PaymentLink.submit_type`
* Add support for new value `financial_account_statement` on enum `File.purpose`
* Add support for `fraud_challenges` and `verified_by_fraud_challenge` on `Issuing.Authorization`
* Add support for `trace_id` on `Payout`
* Add support for new value `li_vat` on enum `TaxId.type`
* Add support for new value `service_tax` on enum `TaxRate.tax_type`
* Change type of `Treasury.InboundTransfer.origin_payment_method` from `string` to `nullable(string)`

## 16.2.0 - 2024-10-29
* [#1772](https://github.com/stripe/stripe-php/pull/1772) This release changes the pinned API version to `2024-10-28.acacia`.
* Add support for new resource `V2.EventDestinations`
* Add support for `create`, `retrieve`, `update`, `list`, `delete`, `disable`, `enable` and `ping` methods on resource `V2.EventDestinations`
* Add support for `submit_card` test helper method on resource `Issuing.Card`
* Add support for `groups` on `Account`
* Add support for `enhanced_eligibility_types` on `Dispute`
* Add support for new values `issuing_transaction.purchase_details_receipt_updated` and `refund.failed` on enum `Event.type`
* Add support for `metadata` on `Forwarding.Request`
* Add support for new value `alma` on enum `PaymentLink.payment_method_types[]`
* Add support for `alma` on `PaymentMethodConfiguration` and `PaymentMethod`
* Add support for `kakao_pay`, `kr_card`, `naver_pay`, `payco`, and `samsung_pay` on `PaymentMethod`
* Add support for new values `alma`, `kakao_pay`, `kr_card`, `naver_pay`, `payco`, and `samsung_pay` on enum `PaymentMethod.type`
* Add support for `amazon_pay` on `PaymentMethodDomain`
* Add support for new values `by_tin`, `ma_vat`, `md_vat`, `tz_vat`, `uz_tin`, and `uz_vat` on enum `TaxId.type`
* Add support for `flat_amount` and `rate_type` on `TaxRate`
* Add support for new value `retail_delivery_fee` on enum `TaxRate.tax_type`

## 16.1.1 - 2024-10-18
* [#1775](https://github.com/stripe/stripe-php/pull/1775) Deserialize into correct v2 EventData types
* Fixes a bug where v2 EventData was not being deserialized into the appropriate type for `V1BillingMeterErrorReportTriggeredEvent` and `V1BillingMeterNoMeterFoundEvent`
* [#1776](https://github.com/stripe/stripe-php/pull/1776) update object tags for meter-related classes

- fixes a bug where the `object` property of the `MeterEvent`, `MeterEventAdjustment`, and `MeterEventSession` didn't match the server.
* [#1773](https://github.com/stripe/stripe-php/pull/1773) Clean up examples
* [#1771](https://github.com/stripe/stripe-php/pull/1771) Renamed example file names

## 16.1.0 - 2024-10-03
* [#1765](https://github.com/stripe/stripe-php/pull/1765) Update generated code
* Remove the support for resource `Margin` that was accidentally made public in the last release

## 16.0.0 - 2024-10-01
* [#1756](https://github.com/stripe/stripe-php/pull/1756) Support for APIs in the new API version 2024-09-30.acacia

This release changes the pinned API version to `2024-09-30.acacia`. Please read the [API Upgrade Guide](https://stripe.com/docs/upgrades#2024-09-30.acacia) and carefully review the API changes before upgrading.

### ⚠️ Breaking changes

* Rename `usage_threshold_config` to `usage_threshold` on `Billing.Alert`
* Remove support for `filter` on `Billing.Alert`. Use the filters on the `usage_threshold` instead


### Additions

* Add support for new value `international_transaction` on enum `Treasury.ReceivedCredit.failure_code`
* Add support for new Usage Billing APIs `Billing.MeterEvent`, `Billing.MeterEventAdjustments`, `Billing.MeterEventSession`, `Billing.MeterEventStream` and the new Events API `Core.Events` under the [v2 namespace ](https://docs.corp.stripe.com/api-v2-overview)
* Add new method `parseThinEvent()` on the `StripeClient` class to parse [thin events](https://docs.corp.stripe.com/event-destinations#events-overview).
* Add a new method [rawRequest()](https://github.com/stripe/stripe-node/tree/master?tab=readme-ov-file#custom-requests) on the `StripeClient` class that takes a HTTP method type, url and relevant parameters to make requests to the Stripe API that are not yet supported in the SDK.


## 15.10.0 - 2024-09-18
* [#1747](https://github.com/stripe/stripe-php/pull/1747) Update generated code
* Add support for new value `international_transaction` on enum `Treasury.ReceivedDebit.failure_code`
* [#1745](https://github.com/stripe/stripe-php/pull/1745) Update generated code
* Add support for new value `terminal_reader_invalid_location_for_activation` on enum `StripeError.code`
* Add support for `automatically_finalizes_at` on `Invoice`

## 15.9.0 - 2024-09-12
* [#1737](https://github.com/stripe/stripe-php/pull/1737) Update generated code
* Add support for new resource `InvoiceRenderingTemplate`
* Add support for `all`, `archive`, `retrieve`, and `unarchive` methods on resource `InvoiceRenderingTemplate`

## 15.8.0 - 2024-08-29
* [#1742](https://github.com/stripe/stripe-php/pull/1742) Generate SDK for OpenAPI spec version 1230
* Add support for new value `issuing_regulatory_reporting` on enum `File.purpose`
* Add support for new value `hr_oib` on enum `TaxId.type`
* Add support for `status_details` on `TestHelpers.TestClock`

## 15.7.0 - 2024-08-15
* [#1736](https://github.com/stripe/stripe-php/pull/1736) Update generated code


## 15.6.0 - 2024-08-08
* [#1729](https://github.com/stripe/stripe-php/pull/1729) Update generated code
* Add support for `activate`, `all`, `archive`, `create`, `deactivate`, and `retrieve` methods on resource `Billing.Alert`
* Add support for `retrieve` method on resource `Tax.Calculation`
* Add support for new value `invalid_mandate_reference_prefix_format` on enum `StripeError.code`
* Add support for `related_customer` on `Identity.VerificationSession`
* Add support for new value `financial_addresses.aba.forwarding` on enums `Treasury.FinancialAccount.active_features[]`, `Treasury.FinancialAccount.pending_features[]`, and `Treasury.FinancialAccount.restricted_features[]`

## 15.5.0 - 2024-08-01
* [#1727](https://github.com/stripe/stripe-php/pull/1727) Update generated code
* Add support for new resources `Billing.AlertTriggered` and `Billing.Alert`
* Add support for new value `charge_exceeds_transaction_limit` on enum `StripeError.code`
* Add support for new value `billing.alert.triggered` on enum `Event.type`

## 15.4.0 - 2024-07-25
* [#1726](https://github.com/stripe/stripe-php/pull/1726) Update generated code
* Add support for `update` method on resource `Checkout.Session`
* Add support for new values `invoice.overdue` and `invoice.will_be_due` on enum `Event.type`
* Add support for `twint` on `PaymentMethodConfiguration`

## 15.3.0 - 2024-07-18
* [#1724](https://github.com/stripe/stripe-php/pull/1724) Update generated code
* Add support for new value `issuing_dispute.funds_rescinded` on enum `Event.type`
* Add support for new value `stripe_s700` on enum `Terminal.Reader.device_type`
* [#1722](https://github.com/stripe/stripe-php/pull/1722) Update changelog

## 15.2.0 - 2024-07-11
* [#1721](https://github.com/stripe/stripe-php/pull/1721) Update generated code
* ⚠️ Remove support for values `billing_policy_remote_function_response_invalid`, `billing_policy_remote_function_timeout`, `billing_policy_remote_function_unexpected_status_code`, and `billing_policy_remote_function_unreachable` from enum `StripeError.code`.
* ⚠️ Remove support for value `payment_intent_fx_quote_invalid` from enum `StripeError.code`. The was mistakenly released last week.
* Add support for `payment_method_options` on `ConfirmationToken`

## 15.1.0 - 2024-07-05
* [#1718](https://github.com/stripe/stripe-php/pull/1718) Update generated code
* Add support for `add_lines`, `remove_lines`, and `update_lines` methods on resource `Invoice`
* Add support for new value `payment_intent_fx_quote_invalid` on enum `StripeError.code`
* Add support for new values `multibanco`, `twint`, and `zip` on enum `PaymentLink.payment_method_types[]`
* Add support for `posted_at` on `Tax.Transaction`
* Add support for `reboot_window` on `Terminal.Configuration`

## 15.0.0 - 2024-06-24
* [#1714](https://github.com/stripe/stripe-php/pull/1714)

Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# NOTE: this file is deprecated and slated for deletion; prefer using the equivalent `just` commands.

export PHPDOCUMENTOR_VERSION := v3.0.0

vendor: composer.json
Expand All @@ -12,6 +14,7 @@ test: vendor
.PHONY: test

ci-test: vendor
echo "calling build with $$AUTOLOAD"
./build.php $$AUTOLOAD
.PHONY: ci-test

Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1095
v1505
39 changes: 33 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
[![Latest Stable Version](https://poser.pugx.org/stripe/stripe-php/v/stable.svg)](https://packagist.org/packages/stripe/stripe-php)
[![Total Downloads](https://poser.pugx.org/stripe/stripe-php/downloads.svg)](https://packagist.org/packages/stripe/stripe-php)
[![License](https://poser.pugx.org/stripe/stripe-php/license.svg)](https://packagist.org/packages/stripe/stripe-php)
[![Code Coverage](https://coveralls.io/repos/stripe/stripe-php/badge.svg?branch=master)](https://coveralls.io/r/stripe/stripe-php?branch=master)

The Stripe PHP library provides convenient access to the Stripe API from
applications written in the PHP language. It includes a pre-defined set of
Expand Down Expand Up @@ -223,13 +222,37 @@ If your beta feature requires a `Stripe-Version` header to be sent, set the `api
Stripe::addBetaVersion("feature_beta", "v3");
```

### Custom requests

If you would like to send a request to an undocumented API (for example you are in a private beta), or if you prefer to bypass the method definitions in the library and specify your request details directly, you can use the `rawRequest` method on the StripeClient.

```php
$stripe = new \Stripe\StripeClient('sk_test_xyz');
$response = $stripe->rawRequest('post', '/v1/beta_endpoint', [
"caveat": "emptor"
], [
"stripe_version" => "2022-11_15",
]);
// $response->body is a string, you can call $stripe->deserialize to get a \Stripe\StripeObject.
$obj = $stripe->deserialize($response->body);

// For GET requests, the params argument must be null, and you should write the query string explicitly.
$get_response = $stripe->rawRequest('get', '/v1/beta_endpoint?caveat=emptor', null, [
"stripe_version" => "2022-11_15",
]);
```

## Support

New features and bug fixes are released on the latest major version of the Stripe PHP library. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates.

## Development

Get [Composer][composer]. For example, on Mac OS:
[Contribution guidelines for this project](CONTRIBUTING.md)

We use [just](https://github.com/casey/just) for conveniently running development tasks. You can use them directly, or copy the commands out of the `justfile`. To our help docs, run `just`.

To get started, install [Composer][composer]. For example, on Mac OS:

```bash
brew install composer
Expand All @@ -238,7 +261,8 @@ brew install composer
Install dependencies:

```bash
composer install
just install
# or: composer install
```

The test suite depends on [stripe-mock], so make sure to fetch and run it from a
Expand All @@ -253,13 +277,15 @@ stripe-mock
Install dependencies as mentioned above (which will resolve [PHPUnit](http://packagist.org/packages/phpunit/phpunit)), then you can run the test suite:

```bash
./vendor/bin/phpunit
just test
# or: ./vendor/bin/phpunit
```

Or to run an individual test file:

```bash
./vendor/bin/phpunit tests/Stripe/UtilTest.php
just test tests/Stripe/UtilTest.php
# or: ./vendor/bin/phpunit tests/Stripe/UtilTest.php
```

Update bundled CA certificates from the [Mozilla cURL release][curl]:
Expand All @@ -271,7 +297,8 @@ Update bundled CA certificates from the [Mozilla cURL release][curl]:
The library uses [PHP CS Fixer][php-cs-fixer] for code formatting. Code must be formatted before PRs are submitted, otherwise CI will fail. Run the formatter with:

```bash
./vendor/bin/php-cs-fixer fix -v .
just format
# or: ./vendor/bin/php-cs-fixer fix -v .
```

## Attention plugin developers
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
15.0.0
16.6.0
Loading

0 comments on commit bae9cce

Please sign in to comment.