From 607d331696a36060a3539364cba63efc1c89cde9 Mon Sep 17 00:00:00 2001 From: "Matthew Wire (MJW Consulting)" <mjw@mjwconsult.co.uk> Date: Mon, 4 Mar 2019 00:05:31 +0000 Subject: [PATCH] Update stripe-php from 6.19.5 to 6.30.4 --- composer.lock | 13 +- vendor/composer/installed.json | 15 +- vendor/stripe/stripe-php/.coveralls.yml | 3 - .../stripe-php/.github/ISSUE_TEMPLATE.md | 5 - vendor/stripe/stripe-php/.travis.yml | 44 -- .../stripe/stripe-php/.vscode/extensions.json | 7 - .../stripe/stripe-php/.vscode/settings.json | 18 - vendor/stripe/stripe-php/CHANGELOG.md | 69 +++ vendor/stripe/stripe-php/LICENSE | 2 +- vendor/stripe/stripe-php/VERSION | 2 +- vendor/stripe/stripe-php/composer.json | 3 +- vendor/stripe/stripe-php/examples/oauth.php | 55 -- vendor/stripe/stripe-php/init.php | 10 + vendor/stripe/stripe-php/lib/Account.php | 122 +++- vendor/stripe/stripe-php/lib/AccountLink.php | 21 + .../lib/ApiOperations/NestedResource.php | 3 + vendor/stripe/stripe-php/lib/ApiRequestor.php | 53 ++ .../stripe/stripe-php/lib/ApplicationFee.php | 8 +- vendor/stripe/stripe-php/lib/Card.php | 6 +- vendor/stripe/stripe-php/lib/Charge.php | 2 + .../stripe-php/lib/Checkout/Session.php | 20 + vendor/stripe/stripe-php/lib/Collection.php | 11 +- vendor/stripe/stripe-php/lib/Customer.php | 18 +- .../stripe-php/lib/Error/OAuth/OAuthBase.php | 4 +- vendor/stripe/stripe-php/lib/Event.php | 216 ++++--- .../stripe-php/lib/HttpClient/CurlClient.php | 84 ++- vendor/stripe/stripe-php/lib/Invoice.php | 76 ++- .../stripe-php/lib/Issuing/Authorization.php | 1 - .../stripe/stripe-php/lib/PaymentIntent.php | 9 +- vendor/stripe/stripe-php/lib/Person.php | 93 +++ vendor/stripe/stripe-php/lib/Product.php | 2 +- .../stripe/stripe-php/lib/Radar/ValueList.php | 32 + .../stripe-php/lib/Radar/ValueListItem.php | 26 + vendor/stripe/stripe-php/lib/Refund.php | 7 +- .../stripe-php/lib/RequestTelemetry.php | 27 + vendor/stripe/stripe-php/lib/Review.php | 44 ++ vendor/stripe/stripe-php/lib/Source.php | 17 +- vendor/stripe/stripe-php/lib/Stripe.php | 25 +- vendor/stripe/stripe-php/lib/Subscription.php | 4 + .../stripe-php/lib/SubscriptionItem.php | 1 + .../stripe-php/lib/SubscriptionSchedule.php | 111 ++++ .../lib/SubscriptionScheduleRevision.php | 77 +++ vendor/stripe/stripe-php/lib/Transfer.php | 8 +- .../stripe-php/lib/TransferReversal.php | 2 + vendor/stripe/stripe-php/lib/Util/Util.php | 19 + .../stripe/stripe-php/lib/WebhookEndpoint.php | 29 + .../stripe/stripe-php/phpunit.no_autoload.xml | 15 - vendor/stripe/stripe-php/phpunit.xml | 15 - .../stripe-php/tests/Stripe/AccountTest.php | 388 ------------ .../tests/Stripe/AlipayAccountTest.php | 76 --- .../tests/Stripe/ApiRequestorTest.php | 573 ------------------ .../tests/Stripe/ApplePayDomainTest.php | 52 -- .../tests/Stripe/ApplicationFeeRefundTest.php | 21 - .../tests/Stripe/ApplicationFeeTest.php | 83 --- .../stripe-php/tests/Stripe/BalanceTest.php | 16 - .../tests/Stripe/BalanceTransactionTest.php | 29 - .../tests/Stripe/BankAccountTest.php | 99 --- .../tests/Stripe/BitcoinReceiverTest.php | 62 -- .../stripe-php/tests/Stripe/CardTest.php | 94 --- .../stripe-php/tests/Stripe/ChargeTest.php | 140 ----- .../tests/Stripe/CollectionTest.php | 147 ----- .../tests/Stripe/CountrySpecTest.php | 29 - .../stripe-php/tests/Stripe/CouponTest.php | 79 --- .../stripe-php/tests/Stripe/CustomerTest.php | 269 -------- .../stripe-php/tests/Stripe/DisputeTest.php | 65 -- .../tests/Stripe/EphemeralKeyTest.php | 43 -- .../tests/Stripe/Error/BaseTest.php | 36 -- .../Error/SignatureVerificationTest.php | 12 - .../stripe-php/tests/Stripe/EventTest.php | 29 - .../tests/Stripe/ExchangeRateTest.php | 54 -- .../tests/Stripe/FileCreationTest.php | 69 --- .../stripe-php/tests/Stripe/FileLinkTest.php | 65 -- .../stripe-php/tests/Stripe/FileTest.php | 45 -- .../tests/Stripe/FileUploadCreationTest.php | 69 --- .../tests/Stripe/FileUploadTest.php | 45 -- .../Stripe/HttpClient/CurlClientTest.php | 237 -------- .../tests/Stripe/InvoiceItemTest.php | 78 --- .../stripe-php/tests/Stripe/InvoiceTest.php | 87 --- .../tests/Stripe/IssuerFraudRecordTest.php | 29 - .../Stripe/Issuing/AuthorizationTest.php | 79 --- .../tests/Stripe/Issuing/CardTest.php | 66 -- .../tests/Stripe/Issuing/CardholderTest.php | 79 --- .../tests/Stripe/Issuing/DisputeTest.php | 71 --- .../tests/Stripe/Issuing/TransactionTest.php | 55 -- .../stripe-php/tests/Stripe/OAuthTest.php | 97 --- .../tests/Stripe/OrderReturnTest.php | 29 - .../stripe-php/tests/Stripe/OrderTest.php | 87 --- .../tests/Stripe/PaymentIntentTest.php | 103 ---- .../stripe-php/tests/Stripe/PayoutTest.php | 77 --- .../stripe-php/tests/Stripe/PlanTest.php | 80 --- .../stripe-php/tests/Stripe/ProductTest.php | 77 --- .../stripe-php/tests/Stripe/RecipientTest.php | 98 --- .../stripe-php/tests/Stripe/RefundTest.php | 65 -- .../tests/Stripe/Reporting/ReportRunTest.php | 47 -- .../tests/Stripe/Reporting/ReportTypeTest.php | 29 - .../stripe-php/tests/Stripe/SKUTest.php | 82 --- .../Stripe/Sigma/ScheduledQueryRunTest.php | 21 - .../stripe-php/tests/Stripe/SourceTest.php | 134 ---- .../tests/Stripe/StripeObjectTest.php | 476 --------------- .../stripe-php/tests/Stripe/StripeTest.php | 30 - .../tests/Stripe/SubscriptionItemTest.php | 94 --- .../tests/Stripe/SubscriptionTest.php | 110 ---- .../Stripe/Terminal/ConnectionTokenTest.php | 16 - .../tests/Stripe/Terminal/LocationTest.php | 84 --- .../tests/Stripe/Terminal/ReaderTest.php | 66 -- .../tests/Stripe/ThreeDSecureTest.php | 32 - .../stripe-php/tests/Stripe/TokenTest.php | 28 - .../stripe-php/tests/Stripe/TopupTest.php | 80 --- .../tests/Stripe/TransferReversalTest.php | 21 - .../stripe-php/tests/Stripe/TransferTest.php | 140 ----- .../tests/Stripe/UsageRecordTest.php | 35 -- .../tests/Stripe/Util/DefaultLoggerTest.php | 28 - .../tests/Stripe/Util/RequestOptionsTest.php | 81 --- .../stripe-php/tests/Stripe/Util/UtilTest.php | 134 ---- .../stripe-php/tests/Stripe/WebhookTest.php | 110 ---- vendor/stripe/stripe-php/tests/TestCase.php | 179 ------ .../tests/bootstrap.no_autoload.php | 5 - vendor/stripe/stripe-php/tests/bootstrap.php | 43 -- vendor/stripe/stripe-php/tests/data/test.png | Bin 95 -> 0 bytes 119 files changed, 1112 insertions(+), 6630 deletions(-) delete mode 100644 vendor/stripe/stripe-php/.coveralls.yml delete mode 100644 vendor/stripe/stripe-php/.github/ISSUE_TEMPLATE.md delete mode 100644 vendor/stripe/stripe-php/.travis.yml delete mode 100644 vendor/stripe/stripe-php/.vscode/extensions.json delete mode 100644 vendor/stripe/stripe-php/.vscode/settings.json delete mode 100644 vendor/stripe/stripe-php/examples/oauth.php create mode 100644 vendor/stripe/stripe-php/lib/AccountLink.php create mode 100644 vendor/stripe/stripe-php/lib/Checkout/Session.php create mode 100644 vendor/stripe/stripe-php/lib/Person.php create mode 100644 vendor/stripe/stripe-php/lib/Radar/ValueList.php create mode 100644 vendor/stripe/stripe-php/lib/Radar/ValueListItem.php create mode 100644 vendor/stripe/stripe-php/lib/RequestTelemetry.php create mode 100644 vendor/stripe/stripe-php/lib/Review.php create mode 100644 vendor/stripe/stripe-php/lib/SubscriptionSchedule.php create mode 100644 vendor/stripe/stripe-php/lib/SubscriptionScheduleRevision.php create mode 100644 vendor/stripe/stripe-php/lib/WebhookEndpoint.php delete mode 100644 vendor/stripe/stripe-php/phpunit.no_autoload.xml delete mode 100644 vendor/stripe/stripe-php/phpunit.xml delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/AccountTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/AlipayAccountTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/ApiRequestorTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/ApplePayDomainTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/ApplicationFeeRefundTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/ApplicationFeeTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/BalanceTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/BalanceTransactionTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/BankAccountTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/BitcoinReceiverTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/CardTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/ChargeTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/CollectionTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/CountrySpecTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/CouponTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/CustomerTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/DisputeTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/EphemeralKeyTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/Error/BaseTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/Error/SignatureVerificationTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/EventTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/ExchangeRateTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/FileCreationTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/FileLinkTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/FileTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/FileUploadCreationTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/FileUploadTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/HttpClient/CurlClientTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/InvoiceItemTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/InvoiceTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/IssuerFraudRecordTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/Issuing/AuthorizationTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/Issuing/CardTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/Issuing/CardholderTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/Issuing/DisputeTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/Issuing/TransactionTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/OAuthTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/OrderReturnTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/OrderTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/PaymentIntentTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/PayoutTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/PlanTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/ProductTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/RecipientTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/RefundTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/Reporting/ReportRunTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/Reporting/ReportTypeTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/SKUTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/Sigma/ScheduledQueryRunTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/SourceTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/StripeObjectTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/StripeTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/SubscriptionItemTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/SubscriptionTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/Terminal/ConnectionTokenTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/Terminal/LocationTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/Terminal/ReaderTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/ThreeDSecureTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/TokenTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/TopupTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/TransferReversalTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/TransferTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/UsageRecordTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/Util/DefaultLoggerTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/Util/RequestOptionsTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/Util/UtilTest.php delete mode 100644 vendor/stripe/stripe-php/tests/Stripe/WebhookTest.php delete mode 100644 vendor/stripe/stripe-php/tests/TestCase.php delete mode 100644 vendor/stripe/stripe-php/tests/bootstrap.no_autoload.php delete mode 100644 vendor/stripe/stripe-php/tests/bootstrap.php delete mode 100644 vendor/stripe/stripe-php/tests/data/test.png diff --git a/composer.lock b/composer.lock index 53f7bf8d..4282060c 100644 --- a/composer.lock +++ b/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "stripe/stripe-php", - "version": "v6.19.5", + "version": "v6.30.4", "source": { "type": "git", "url": "https://github.com/stripe/stripe-php.git", - "reference": "1ab5c54fae4c16e9cc47d60c7454e6c3b6bbcb85" + "reference": "0d9e2773b1df27d4f0c590b15bed3a1433e0414c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/stripe/stripe-php/zipball/1ab5c54fae4c16e9cc47d60c7454e6c3b6bbcb85", - "reference": "1ab5c54fae4c16e9cc47d60c7454e6c3b6bbcb85", + "url": "https://api.github.com/repos/stripe/stripe-php/zipball/0d9e2773b1df27d4f0c590b15bed3a1433e0414c", + "reference": "0d9e2773b1df27d4f0c590b15bed3a1433e0414c", "shasum": "" }, "require": { @@ -29,7 +29,8 @@ "require-dev": { "php-coveralls/php-coveralls": "1.*", "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "squizlabs/php_codesniffer": "~2.0", + "symfony/process": "~2.8" }, "type": "library", "extra": { @@ -59,7 +60,7 @@ "payment processing", "stripe" ], - "time": "2018-10-17T14:58:41+00:00" + "time": "2019-02-27T18:07:30+00:00" } ], "packages-dev": [], diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 20cb6575..de060d03 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1,17 +1,17 @@ [ { "name": "stripe/stripe-php", - "version": "v6.19.5", - "version_normalized": "6.19.5.0", + "version": "v6.30.4", + "version_normalized": "6.30.4.0", "source": { "type": "git", "url": "https://github.com/stripe/stripe-php.git", - "reference": "1ab5c54fae4c16e9cc47d60c7454e6c3b6bbcb85" + "reference": "0d9e2773b1df27d4f0c590b15bed3a1433e0414c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/stripe/stripe-php/zipball/1ab5c54fae4c16e9cc47d60c7454e6c3b6bbcb85", - "reference": "1ab5c54fae4c16e9cc47d60c7454e6c3b6bbcb85", + "url": "https://api.github.com/repos/stripe/stripe-php/zipball/0d9e2773b1df27d4f0c590b15bed3a1433e0414c", + "reference": "0d9e2773b1df27d4f0c590b15bed3a1433e0414c", "shasum": "" }, "require": { @@ -23,9 +23,10 @@ "require-dev": { "php-coveralls/php-coveralls": "1.*", "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "squizlabs/php_codesniffer": "~2.0", + "symfony/process": "~2.8" }, - "time": "2018-10-17T14:58:41+00:00", + "time": "2019-02-27T18:07:30+00:00", "type": "library", "extra": { "branch-alias": { diff --git a/vendor/stripe/stripe-php/.coveralls.yml b/vendor/stripe/stripe-php/.coveralls.yml deleted file mode 100644 index 4eecff56..00000000 --- a/vendor/stripe/stripe-php/.coveralls.yml +++ /dev/null @@ -1,3 +0,0 @@ -service_name: travis-ci -coverage_clover: clover.xml -json_path: coveralls-upload.json diff --git a/vendor/stripe/stripe-php/.github/ISSUE_TEMPLATE.md b/vendor/stripe/stripe-php/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index c200db60..00000000 --- a/vendor/stripe/stripe-php/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,5 +0,0 @@ -Please only file issues here that you believe represent actual bugs or feature requests for the Stripe PHP library. - -If you're having general trouble with your Stripe integration, please reach out to support using the form at https://support.stripe.com/ (preferred) or via email to support@stripe.com. - -If you are reporting a bug, please include your PHP version and the version of the Stripe PHP library you're using, as well as any other details that may be helpful in reproducing the problem. diff --git a/vendor/stripe/stripe-php/.travis.yml b/vendor/stripe/stripe-php/.travis.yml deleted file mode 100644 index d76ebfa1..00000000 --- a/vendor/stripe/stripe-php/.travis.yml +++ /dev/null @@ -1,44 +0,0 @@ -sudo: false - -language: php - -php: - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - 7.1 - - 7.2 - - hhvm - -env: - global: - - STRIPE_MOCK_VERSION=0.33.0 - matrix: - - AUTOLOAD=1 - - AUTOLOAD=0 - -cache: - directories: - - $HOME/.composer/cache/files - - stripe-mock - -before_install: - # Install various build dependencies. We use `travis_retry` because Composer - # will occasionally fail intermittently. - - travis_retry composer install - - # Unpack and start stripe-mock so that the test suite can talk to it - - | - if [ ! -d "stripe-mock/stripe-mock_${STRIPE_MOCK_VERSION}" ]; then - mkdir -p stripe-mock/stripe-mock_${STRIPE_MOCK_VERSION}/ - curl -L "https://github.com/stripe/stripe-mock/releases/download/v${STRIPE_MOCK_VERSION}/stripe-mock_${STRIPE_MOCK_VERSION}_linux_amd64.tar.gz" -o "stripe-mock/stripe-mock_${STRIPE_MOCK_VERSION}_linux_amd64.tar.gz" - tar -zxf "stripe-mock/stripe-mock_${STRIPE_MOCK_VERSION}_linux_amd64.tar.gz" -C "stripe-mock/stripe-mock_${STRIPE_MOCK_VERSION}/" - fi - - | - stripe-mock/stripe-mock_${STRIPE_MOCK_VERSION}/stripe-mock > /dev/null & - STRIPE_MOCK_PID=$! - -script: ./build.php ${AUTOLOAD} - -after_script: ./vendor/bin/coveralls -v diff --git a/vendor/stripe/stripe-php/.vscode/extensions.json b/vendor/stripe/stripe-php/.vscode/extensions.json deleted file mode 100644 index b5d76ac4..00000000 --- a/vendor/stripe/stripe-php/.vscode/extensions.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "recommendations": [ - "felixfbecker.php-intellisense", - "ikappas.phpcs", - "emallin.phpunit" - ] -} diff --git a/vendor/stripe/stripe-php/.vscode/settings.json b/vendor/stripe/stripe-php/.vscode/settings.json deleted file mode 100644 index 33478aa0..00000000 --- a/vendor/stripe/stripe-php/.vscode/settings.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "editor.renderWhitespace": "all", - "files.insertFinalNewline": true, - "files.trimFinalNewlines": true, - "files.trimTrailingWhitespace": true, - "[php]": { - "editor.detectIndentation": false, - "editor.insertSpaces": true, - "editor.rulers": [ - 100 - ], - "editor.tabSize": 4, - }, - - // Linting - "phpcs.enable": true, - "phpcs.standard": "PSR2" -} diff --git a/vendor/stripe/stripe-php/CHANGELOG.md b/vendor/stripe/stripe-php/CHANGELOG.md index 0161af4b..7d90527c 100644 --- a/vendor/stripe/stripe-php/CHANGELOG.md +++ b/vendor/stripe/stripe-php/CHANGELOG.md @@ -1,5 +1,74 @@ # Changelog +## 6.30.4 - 2019-02-27 +* [#602](https://github.com/stripe/stripe-php/pull/602) Add `subscription_schedule` to `Subscription` for PHPDoc. + +## 6.30.3 - 2019-02-26 +* [#603](https://github.com/stripe/stripe-php/pull/603) Improve PHPDoc on the `Source` object to cover all types of Sources currently supported. + +## 6.30.2 - 2019-02-25 +* [#601](https://github.com/stripe/stripe-php/pull/601) Fix PHPDoc across multiple resources and add support for new events. + +## 6.30.1 - 2019-02-16 +* [#599](https://github.com/stripe/stripe-php/pull/599) Fix PHPDoc for `SubscriptionSchedule` and `SubscriptionScheduleRevision` + +## 6.30.0 - 2019-02-12 +* [#590](https://github.com/stripe/stripe-php/pull/590) Add support for `SubscriptionSchedule` and `SubscriptionScheduleRevision` + +## 6.29.3 - 2019-01-31 +* [#592](https://github.com/stripe/stripe-php/pull/592) Some more PHPDoc fixes + +## 6.29.2 - 2019-01-31 +* [#591](https://github.com/stripe/stripe-php/pull/591) Fix PHPDoc for nested resources + +## 6.29.1 - 2019-01-25 +* [#566](https://github.com/stripe/stripe-php/pull/566) Fix dangling message contents +* [#586](https://github.com/stripe/stripe-php/pull/586) Don't overwrite `CURLOPT_HTTP_VERSION` option + +## 6.29.0 - 2019-01-23 +* [#579](https://github.com/stripe/stripe-php/pull/579) Rename `CheckoutSession` to `Session` and move it under the `Checkout` namespace. This is a breaking change, but we've reached out to affected merchants and all new merchants would use the new approach. + +## 6.28.1 - 2019-01-21 +* [#580](https://github.com/stripe/stripe-php/pull/580) Properly serialize `individual` on `Account` objects + +## 6.28.0 - 2019-01-03 +* [#576](https://github.com/stripe/stripe-php/pull/576) Add support for iterating directly over `Collection` instances + +## 6.27.0 - 2018-12-21 +* [#571](https://github.com/stripe/stripe-php/pull/571) Add support for the `CheckoutSession` resource + +## 6.26.0 - 2018-12-11 +* [#568](https://github.com/stripe/stripe-php/pull/568) Enable persistent connections + +## 6.25.0 - 2018-12-10 +* [#567](https://github.com/stripe/stripe-php/pull/567) Add support for account links + +## 6.24.0 - 2018-11-28 +* [#562](https://github.com/stripe/stripe-php/pull/562) Add support for the Review resource +* [#564](https://github.com/stripe/stripe-php/pull/564) Add event name constants for subscription schedule aborted/expiring + +## 6.23.0 - 2018-11-27 +* [#542](https://github.com/stripe/stripe-php/pull/542) Add support for `ValueList` and `ValueListItem` for Radar + +## 6.22.1 - 2018-11-20 +* [#561](https://github.com/stripe/stripe-php/pull/561) Add cast and some docs to telemetry introduced in 6.22.0/#549 + +## 6.22.0 - 2018-11-15 +* [#549](https://github.com/stripe/stripe-php/pull/549) Add support for client telemetry + +## 6.21.1 - 2018-11-12 +* [#548](https://github.com/stripe/stripe-php/pull/548) Don't mutate `Exception` class properties from `OAuthBase` error + +## 6.21.0 - 2018-11-08 +* [#537](https://github.com/stripe/stripe-php/pull/537) Add new API endpoints for the `Invoice` resource. + +## 6.20.1 - 2018-11-07 +* [#546](https://github.com/stripe/stripe-php/pull/546) Drop files from the Composer package that aren't needed in the release + +## 6.20.0 - 2018-10-30 +* [#536](https://github.com/stripe/stripe-php/pull/536) Add support for the `Person` resource +* [#541](https://github.com/stripe/stripe-php/pull/541) Add support for the `WebhookEndpoint` resource + ## 6.19.5 - 2018-10-17 * [#539](https://github.com/stripe/stripe-php/pull/539) Fix methods on `\Stripe\PaymentIntent` to properly pass arguments to the API. diff --git a/vendor/stripe/stripe-php/LICENSE b/vendor/stripe/stripe-php/LICENSE index a21757e4..847c705a 100644 --- a/vendor/stripe/stripe-php/LICENSE +++ b/vendor/stripe/stripe-php/LICENSE @@ -1,6 +1,6 @@ The MIT License -Copyright (c) 2010-2015 Stripe +Copyright (c) 2010-2019 Stripe, Inc. (https://stripe.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/stripe/stripe-php/VERSION b/vendor/stripe/stripe-php/VERSION index 0a61a6d5..ae24c904 100644 --- a/vendor/stripe/stripe-php/VERSION +++ b/vendor/stripe/stripe-php/VERSION @@ -1 +1 @@ -6.19.5 +6.30.4 diff --git a/vendor/stripe/stripe-php/composer.json b/vendor/stripe/stripe-php/composer.json index 47a285da..eb92b76f 100644 --- a/vendor/stripe/stripe-php/composer.json +++ b/vendor/stripe/stripe-php/composer.json @@ -23,7 +23,8 @@ "require-dev": { "phpunit/phpunit": "~4.0", "php-coveralls/php-coveralls": "1.*", - "squizlabs/php_codesniffer": "~2.0" + "squizlabs/php_codesniffer": "~2.0", + "symfony/process": "~2.8" }, "autoload": { "psr-4": { "Stripe\\" : "lib/" } diff --git a/vendor/stripe/stripe-php/examples/oauth.php b/vendor/stripe/stripe-php/examples/oauth.php deleted file mode 100644 index abde1569..00000000 --- a/vendor/stripe/stripe-php/examples/oauth.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -require('../init.php'); - -\Stripe\Stripe::setApiKey(getenv('STRIPE_SECRET_KEY')); -\Stripe\Stripe::setClientId(getenv('STRIPE_CLIENT_ID')); - - -if (isset($_GET['code'])) { - // The user was redirected back from the OAuth form with an authorization code. - $code = $_GET['code']; - - try { - $resp = \Stripe\OAuth::token([ - 'grant_type' => 'authorization_code', - 'code' => $code, - ]); - } catch (\Stripe\Error\OAuth\OAuthBase $e) { - exit("Error: " . $e->getMessage()); - } - - $accountId = $resp->stripe_user_id; - - echo "<p>Success! Account <code>$accountId</code> is connected.</p>\n"; - echo "<p>Click <a href=\"?deauth=$accountId\">here</a> to disconnect the account.</p>\n"; - -} elseif (isset($_GET['error'])) { - // The user was redirect back from the OAuth form with an error. - $error = $_GET['error']; - $error_description = $_GET['error_description']; - - echo "<p>Error: code=" . htmlspecialchars($error, ENT_QUOTES) . ", description=" . htmlspecialchars($error_description, ENT_QUOTES) . "</p>\n"; - echo "<p>Click <a href=\"?\">here</a> to restart the OAuth flow.</p>\n"; - -} elseif (isset($_GET['deauth'])) { - // Deauthorization request - $accountId = $_GET['deauth']; - - try { - \Stripe\OAuth::deauthorize([ - 'stripe_user_id' => $accountId, - ]); - } catch (\Stripe\Error\OAuth\OAuthBase $e) { - exit("Error: " . $e->getMessage()); - } - - echo "<p>Success! Account <code>" . htmlspecialchars($accountId, ENT_QUOTES) . "</code> is disconnected.</p>\n"; - echo "<p>Click <a href=\"?\">here</a> to restart the OAuth flow.</p>\n"; - -} else { - $url = \Stripe\OAuth::authorizeUrl([ - 'scope' => 'read_only', - ]); - echo "<a href=\"$url\">Connect with Stripe</a>\n"; -} diff --git a/vendor/stripe/stripe-php/init.php b/vendor/stripe/stripe-php/init.php index 1ed28257..1d4d1c36 100644 --- a/vendor/stripe/stripe-php/init.php +++ b/vendor/stripe/stripe-php/init.php @@ -49,6 +49,7 @@ require(dirname(__FILE__) . '/lib/ApiOperations/Update.php'); // Plumbing require(dirname(__FILE__) . '/lib/ApiResponse.php'); +require(dirname(__FILE__) . '/lib/RequestTelemetry.php'); require(dirname(__FILE__) . '/lib/StripeObject.php'); require(dirname(__FILE__) . '/lib/ApiRequestor.php'); require(dirname(__FILE__) . '/lib/ApiResource.php'); @@ -56,6 +57,7 @@ require(dirname(__FILE__) . '/lib/SingletonApiResource.php'); // Stripe API Resources require(dirname(__FILE__) . '/lib/Account.php'); +require(dirname(__FILE__) . '/lib/AccountLink.php'); require(dirname(__FILE__) . '/lib/AlipayAccount.php'); require(dirname(__FILE__) . '/lib/ApplePayDomain.php'); require(dirname(__FILE__) . '/lib/ApplicationFee.php'); @@ -67,6 +69,7 @@ require(dirname(__FILE__) . '/lib/BitcoinReceiver.php'); require(dirname(__FILE__) . '/lib/BitcoinTransaction.php'); require(dirname(__FILE__) . '/lib/Card.php'); require(dirname(__FILE__) . '/lib/Charge.php'); +require(dirname(__FILE__) . '/lib/Checkout/Session.php'); require(dirname(__FILE__) . '/lib/Collection.php'); require(dirname(__FILE__) . '/lib/CountrySpec.php'); require(dirname(__FILE__) . '/lib/Coupon.php'); @@ -95,19 +98,25 @@ require(dirname(__FILE__) . '/lib/OrderItem.php'); require(dirname(__FILE__) . '/lib/OrderReturn.php'); require(dirname(__FILE__) . '/lib/PaymentIntent.php'); require(dirname(__FILE__) . '/lib/Payout.php'); +require(dirname(__FILE__) . '/lib/Person.php'); require(dirname(__FILE__) . '/lib/Plan.php'); require(dirname(__FILE__) . '/lib/Product.php'); +require(dirname(__FILE__) . '/lib/Radar/ValueList.php'); +require(dirname(__FILE__) . '/lib/Radar/ValueListItem.php'); require(dirname(__FILE__) . '/lib/Recipient.php'); require(dirname(__FILE__) . '/lib/RecipientTransfer.php'); require(dirname(__FILE__) . '/lib/Refund.php'); require(dirname(__FILE__) . '/lib/Reporting/ReportRun.php'); require(dirname(__FILE__) . '/lib/Reporting/ReportType.php'); +require(dirname(__FILE__) . '/lib/Review.php'); require(dirname(__FILE__) . '/lib/SKU.php'); require(dirname(__FILE__) . '/lib/Sigma/ScheduledQueryRun.php'); require(dirname(__FILE__) . '/lib/Source.php'); require(dirname(__FILE__) . '/lib/SourceTransaction.php'); require(dirname(__FILE__) . '/lib/Subscription.php'); require(dirname(__FILE__) . '/lib/SubscriptionItem.php'); +require(dirname(__FILE__) . '/lib/SubscriptionSchedule.php'); +require(dirname(__FILE__) . '/lib/SubscriptionScheduleRevision.php'); require(dirname(__FILE__) . '/lib/Terminal/ConnectionToken.php'); require(dirname(__FILE__) . '/lib/Terminal/Location.php'); require(dirname(__FILE__) . '/lib/Terminal/Reader.php'); @@ -124,4 +133,5 @@ require(dirname(__FILE__) . '/lib/OAuth.php'); // Webhooks require(dirname(__FILE__) . '/lib/Webhook.php'); +require(dirname(__FILE__) . '/lib/WebhookEndpoint.php'); require(dirname(__FILE__) . '/lib/WebhookSignature.php'); diff --git a/vendor/stripe/stripe-php/lib/Account.php b/vendor/stripe/stripe-php/lib/Account.php index f5c450ae..5b25f6e6 100644 --- a/vendor/stripe/stripe-php/lib/Account.php +++ b/vendor/stripe/stripe-php/lib/Account.php @@ -7,35 +7,24 @@ namespace Stripe; * * @property string $id * @property string $object - * @property string $business_logo - * @property string $business_name - * @property string $business_primary_color - * @property string $business_url + * @property mixed $business_profile + * @property string $business_type + * @property mixed $capabilities * @property bool $charges_enabled + * @property mixed $company * @property string $country * @property int $created - * @property bool $debit_negative_balances - * @property mixed $decline_charge_on * @property string $default_currency * @property bool $details_submitted - * @property string $display_name * @property string $email * @property Collection $external_accounts - * @property mixed $legal_entity + * @property mixed $individual * @property StripeObject $metadata - * @property mixed $payout_schedule - * @property string $payout_statement_descriptor * @property bool $payouts_enabled - * @property string $product_description - * @property string $statement_descriptor - * @property mixed $support_address - * @property string $support_email - * @property string $support_phone - * @property string $support_url - * @property string $timezone + * @property mixed $requirements + * @property mixed $settings * @property mixed $tos_acceptance * @property string $type - * @property mixed $verification * * @package Stripe */ @@ -67,6 +56,7 @@ class Account extends ApiResource const PATH_EXTERNAL_ACCOUNTS = '/external_accounts'; const PATH_LOGIN_LINKS = '/login_links'; + const PATH_PERSONS = '/persons'; public function instanceUrl() { @@ -107,6 +97,21 @@ class Account extends ApiResource return $this; } + /** + * @param array|null $params + * @param array|string|null $options + * + * @return Collection The list of persons. + */ + public function persons($params = null, $options = null) + { + $url = $this->instanceUrl() . '/persons'; + list($response, $opts) = $this->_request('get', $url, $params, $options); + $obj = Util\Util::convertToStripeObject($response, $opts); + $obj->setLastResponse($response); + return $obj; + } + /** * @param array|null $clientId * @param array|string|null $opts @@ -123,7 +128,7 @@ class Account extends ApiResource } /** - * @param array|null $id The ID of the account on which to create the external account. + * @param string|null $id The ID of the account on which to create the external account. * @param array|null $params * @param array|string|null $opts * @@ -135,7 +140,7 @@ class Account extends ApiResource } /** - * @param array|null $id The ID of the account to which the external account belongs. + * @param string|null $id The ID of the account to which the external account belongs. * @param array|null $externalAccountId The ID of the external account to retrieve. * @param array|null $params * @param array|string|null $opts @@ -148,7 +153,7 @@ class Account extends ApiResource } /** - * @param array|null $id The ID of the account to which the external account belongs. + * @param string|null $id The ID of the account to which the external account belongs. * @param array|null $externalAccountId The ID of the external account to update. * @param array|null $params * @param array|string|null $opts @@ -161,7 +166,7 @@ class Account extends ApiResource } /** - * @param array|null $id The ID of the account to which the external account belongs. + * @param string|null $id The ID of the account to which the external account belongs. * @param array|null $externalAccountId The ID of the external account to delete. * @param array|null $params * @param array|string|null $opts @@ -174,7 +179,7 @@ class Account extends ApiResource } /** - * @param array|null $id The ID of the account on which to retrieve the external accounts. + * @param string|null $id The ID of the account on which to retrieve the external accounts. * @param array|null $params * @param array|string|null $opts * @@ -186,7 +191,7 @@ class Account extends ApiResource } /** - * @param array|null $id The ID of the account on which to create the login link. + * @param string|null $id The ID of the account on which to create the login link. * @param array|null $params * @param array|string|null $opts * @@ -197,6 +202,69 @@ class Account extends ApiResource return self::_createNestedResource($id, static::PATH_LOGIN_LINKS, $params, $opts); } + /** + * @param string|null $id The ID of the account on which to create the person. + * @param array|null $params + * @param array|string|null $opts + * + * @return Person + */ + public static function createPerson($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_PERSONS, $params, $opts); + } + + /** + * @param string|null $id The ID of the account to which the person belongs. + * @param array|null $personId The ID of the person to retrieve. + * @param array|null $params + * @param array|string|null $opts + * + * @return Person + */ + public static function retrievePerson($id, $personId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_PERSONS, $personId, $params, $opts); + } + + /** + * @param string|null $id The ID of the account to which the person belongs. + * @param array|null $personId The ID of the person to update. + * @param array|null $params + * @param array|string|null $opts + * + * @return Person + */ + public static function updatePerson($id, $personId, $params = null, $opts = null) + { + return self::_updateNestedResource($id, static::PATH_PERSONS, $personId, $params, $opts); + } + + /** + * @param string|null $id The ID of the account to which the person belongs. + * @param array|null $personId The ID of the person to delete. + * @param array|null $params + * @param array|string|null $opts + * + * @return Person + */ + public static function deletePerson($id, $personId, $params = null, $opts = null) + { + return self::_deleteNestedResource($id, static::PATH_PERSONS, $personId, $params, $opts); + } + + /** + * @param string|null $id The ID of the account on which to retrieve the persons. + * @param array|null $params + * @param array|string|null $opts + * + * @return Person + */ + public static function allPersons($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_PERSONS, $params, $opts); + } + public function serializeParameters($force = false) { $update = parent::serializeParameters($force); @@ -209,6 +277,12 @@ class Account extends ApiResource $update['legal_entity'] = $entityUpdate; } } + if (isset($this->_values['individual'])) { + $individual = $this['individual']; + if (($individual instanceof Person) && !isset($update['individual'])) { + $update['individual'] = $individual->serializeParameters($force); + } + } return $update; } diff --git a/vendor/stripe/stripe-php/lib/AccountLink.php b/vendor/stripe/stripe-php/lib/AccountLink.php new file mode 100644 index 00000000..f2975ae3 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/AccountLink.php @@ -0,0 +1,21 @@ +<?php + +namespace Stripe; + +/** + * Class AccountLink + * + * @property string $object + * @property int $created + * @property int $expires_at + * @property string $url + * + * @package Stripe + */ +class AccountLink extends ApiResource +{ + + const OBJECT_NAME = "account_link"; + + use ApiOperations\Create; +} diff --git a/vendor/stripe/stripe-php/lib/ApiOperations/NestedResource.php b/vendor/stripe/stripe-php/lib/ApiOperations/NestedResource.php index 1c3a73f4..21223543 100644 --- a/vendor/stripe/stripe-php/lib/ApiOperations/NestedResource.php +++ b/vendor/stripe/stripe-php/lib/ApiOperations/NestedResource.php @@ -60,6 +60,7 @@ trait NestedResource /** * @param string $id * @param string $nestedPath + * @param string|null $nestedId * @param array|null $params * @param array|string|null $options * @@ -74,6 +75,7 @@ trait NestedResource /** * @param string $id * @param string $nestedPath + * @param string|null $nestedId * @param array|null $params * @param array|string|null $options * @@ -88,6 +90,7 @@ trait NestedResource /** * @param string $id * @param string $nestedPath + * @param string|null $nestedId * @param array|null $params * @param array|string|null $options * diff --git a/vendor/stripe/stripe-php/lib/ApiRequestor.php b/vendor/stripe/stripe-php/lib/ApiRequestor.php index 4a147d01..7cf85187 100644 --- a/vendor/stripe/stripe-php/lib/ApiRequestor.php +++ b/vendor/stripe/stripe-php/lib/ApiRequestor.php @@ -24,6 +24,11 @@ class ApiRequestor */ private static $_httpClient; + /** + * @var RequestTelemetry + */ + private static $requestTelemetry; + /** * ApiRequestor constructor. * @@ -39,6 +44,30 @@ class ApiRequestor $this->_apiBase = $apiBase; } + /** + * Creates a telemetry json blob for use in 'X-Stripe-Client-Telemetry' headers + * @static + * + * @param RequestTelemetry $requestTelemetry + * @return string + */ + private static function _telemetryJson($requestTelemetry) + { + $payload = array( + 'last_request_metrics' => array( + 'request_id' => $requestTelemetry->requestId, + 'request_duration_ms' => $requestTelemetry->requestDuration, + )); + + $result = json_encode($payload); + if ($result != false) { + return $result; + } else { + Stripe::getLogger()->error("Serializing telemetry payload failed!"); + return "{}"; + } + } + /** * @static * @@ -332,6 +361,10 @@ class ApiRequestor $defaultHeaders['Stripe-Account'] = Stripe::$accountId; } + if (Stripe::$enableTelemetry && self::$requestTelemetry != null) { + $defaultHeaders["X-Stripe-Client-Telemetry"] = self::_telemetryJson(self::$requestTelemetry); + } + $hasFile = false; $hasCurlFile = class_exists('\CURLFile', false); foreach ($params as $k => $v) { @@ -356,6 +389,8 @@ class ApiRequestor $rawHeaders[] = $header . ': ' . $value; } + $requestStartMs = Util\Util::currentTimeMillis(); + list($rbody, $rcode, $rheaders) = $this->httpClient()->request( $method, $absUrl, @@ -363,6 +398,14 @@ class ApiRequestor $params, $hasFile ); + + if (array_key_exists('request-id', $rheaders)) { + self::$requestTelemetry = new RequestTelemetry( + $rheaders['request-id'], + Util\Util::currentTimeMillis() - $requestStartMs + ); + } + return [$rbody, $rcode, $rheaders, $myApiKey]; } @@ -442,6 +485,16 @@ class ApiRequestor self::$_httpClient = $client; } + /** + * @static + * + * Resets any stateful telemetry data + */ + public static function resetTelemetry() + { + self::$requestTelemetry = null; + } + /** * @return HttpClient\ClientInterface */ diff --git a/vendor/stripe/stripe-php/lib/ApplicationFee.php b/vendor/stripe/stripe-php/lib/ApplicationFee.php index 0ec423ea..49d2393d 100644 --- a/vendor/stripe/stripe-php/lib/ApplicationFee.php +++ b/vendor/stripe/stripe-php/lib/ApplicationFee.php @@ -47,7 +47,7 @@ class ApplicationFee extends ApiResource } /** - * @param array|null $id The ID of the application fee on which to create the refund. + * @param string|null $id The ID of the application fee on which to create the refund. * @param array|null $params * @param array|string|null $opts * @@ -59,7 +59,7 @@ class ApplicationFee extends ApiResource } /** - * @param array|null $id The ID of the application fee to which the refund belongs. + * @param string|null $id The ID of the application fee to which the refund belongs. * @param array|null $refundId The ID of the refund to retrieve. * @param array|null $params * @param array|string|null $opts @@ -72,7 +72,7 @@ class ApplicationFee extends ApiResource } /** - * @param array|null $id The ID of the application fee to which the refund belongs. + * @param string|null $id The ID of the application fee to which the refund belongs. * @param array|null $refundId The ID of the refund to update. * @param array|null $params * @param array|string|null $opts @@ -85,7 +85,7 @@ class ApplicationFee extends ApiResource } /** - * @param array|null $id The ID of the application fee on which to retrieve the refunds. + * @param string|null $id The ID of the application fee on which to retrieve the refunds. * @param array|null $params * @param array|string|null $opts * diff --git a/vendor/stripe/stripe-php/lib/Card.php b/vendor/stripe/stripe-php/lib/Card.php index 686080ee..1a18fc5a 100644 --- a/vendor/stripe/stripe-php/lib/Card.php +++ b/vendor/stripe/stripe-php/lib/Card.php @@ -16,7 +16,7 @@ namespace Stripe; * @property string $address_state * @property string $address_zip * @property string $address_zip_check - * @property array $available_payout_methods + * @property string[] $available_payout_methods * @property string $brand * @property string $country * @property string $currency @@ -82,7 +82,7 @@ class Card extends ApiResource { $msg = "Cards cannot be accessed without a customer, recipient or account ID. " . "Retrieve a card using \$customer->sources->retrieve('card_id'), " . - "\$recipient->cards->retrieve('card_id'), or"; + "\$recipient->cards->retrieve('card_id'), or " . "\$account->external_accounts->retrieve('card_id') instead."; throw new Error\InvalidRequest($msg, null); } @@ -98,7 +98,7 @@ class Card extends ApiResource { $msg = "Cards cannot be accessed without a customer, recipient or account ID. " . "Call save() on \$customer->sources->retrieve('card_id'), " . - "\$recipient->cards->retrieve('card_id'), or"; + "\$recipient->cards->retrieve('card_id'), or " . "\$account->external_accounts->retrieve('card_id') instead."; throw new Error\InvalidRequest($msg, null); } diff --git a/vendor/stripe/stripe-php/lib/Charge.php b/vendor/stripe/stripe-php/lib/Charge.php index cf82ef45..00288d6a 100644 --- a/vendor/stripe/stripe-php/lib/Charge.php +++ b/vendor/stripe/stripe-php/lib/Charge.php @@ -32,6 +32,7 @@ namespace Stripe; * @property string $payment_intent * @property string $receipt_email * @property string $receipt_number + * @property string $receipt_url * @property bool $refunded * @property Collection $refunds * @property string $review @@ -41,6 +42,7 @@ namespace Stripe; * @property string $statement_descriptor * @property string $status * @property string $transfer + * @property mixed $transfer_data * @property string $transfer_group * * @package Stripe diff --git a/vendor/stripe/stripe-php/lib/Checkout/Session.php b/vendor/stripe/stripe-php/lib/Checkout/Session.php new file mode 100644 index 00000000..02e88f8d --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Checkout/Session.php @@ -0,0 +1,20 @@ +<?php + +namespace Stripe\Checkout; + +/** + * Class Session + * + * @property string $id + * @property string $object + * @property bool $livemode + * + * @package Stripe + */ +class Session extends \Stripe\ApiResource +{ + + const OBJECT_NAME = "checkout.session"; + + use \Stripe\ApiOperations\Create; +} diff --git a/vendor/stripe/stripe-php/lib/Collection.php b/vendor/stripe/stripe-php/lib/Collection.php index 64fd9f32..986cd330 100644 --- a/vendor/stripe/stripe-php/lib/Collection.php +++ b/vendor/stripe/stripe-php/lib/Collection.php @@ -12,7 +12,7 @@ namespace Stripe; * * @package Stripe */ -class Collection extends StripeObject +class Collection extends StripeObject implements \IteratorAggregate { const OBJECT_NAME = "list"; @@ -68,6 +68,15 @@ class Collection extends StripeObject return Util\Util::convertToStripeObject($response, $opts); } + /** + * @return \ArrayIterator An iterator that can be used to iterate + * across objects in the current page. + */ + public function getIterator() + { + return new \ArrayIterator($this->data); + } + /** * @return Util\AutoPagingIterator An iterator that can be used to iterate * across all objects across all pages. As page boundaries are diff --git a/vendor/stripe/stripe-php/lib/Customer.php b/vendor/stripe/stripe-php/lib/Customer.php index 19b53b90..2d3b702b 100644 --- a/vendor/stripe/stripe-php/lib/Customer.php +++ b/vendor/stripe/stripe-php/lib/Customer.php @@ -8,7 +8,6 @@ namespace Stripe; * @property string $id * @property string $object * @property int $account_balance - * @property string $business_vat_id * @property string $created * @property string $currency * @property string $default_source @@ -17,6 +16,7 @@ namespace Stripe; * @property Discount $discount * @property string $email * @property string $invoice_prefix + * @property mixed $invoice_settings * @property bool $livemode * @property StripeObject $metadata * @property mixed $shipping @@ -141,7 +141,7 @@ class Customer extends ApiResource } /** - * @param array|null $id The ID of the customer on which to create the source. + * @param string|null $id The ID of the customer on which to create the source. * @param array|null $params * @param array|string|null $opts * @@ -153,8 +153,8 @@ class Customer extends ApiResource } /** - * @param array|null $id The ID of the customer to which the source belongs. - * @param array|null $sourceId The ID of the source to retrieve. + * @param string|null $id The ID of the customer to which the source belongs. + * @param string|null $sourceId The ID of the source to retrieve. * @param array|null $params * @param array|string|null $opts * @@ -166,8 +166,8 @@ class Customer extends ApiResource } /** - * @param array|null $id The ID of the customer to which the source belongs. - * @param array|null $sourceId The ID of the source to update. + * @param string|null $id The ID of the customer to which the source belongs. + * @param string|null $sourceId The ID of the source to update. * @param array|null $params * @param array|string|null $opts * @@ -179,8 +179,8 @@ class Customer extends ApiResource } /** - * @param array|null $id The ID of the customer to which the source belongs. - * @param array|null $sourceId The ID of the source to delete. + * @param string|null $id The ID of the customer to which the source belongs. + * @param string|null $sourceId The ID of the source to delete. * @param array|null $params * @param array|string|null $opts * @@ -192,7 +192,7 @@ class Customer extends ApiResource } /** - * @param array|null $id The ID of the customer on which to retrieve the sources. + * @param string|null $id The ID of the customer on which to retrieve the sources. * @param array|null $params * @param array|string|null $opts * diff --git a/vendor/stripe/stripe-php/lib/Error/OAuth/OAuthBase.php b/vendor/stripe/stripe-php/lib/Error/OAuth/OAuthBase.php index 2f172133..03ada1c7 100644 --- a/vendor/stripe/stripe-php/lib/Error/OAuth/OAuthBase.php +++ b/vendor/stripe/stripe-php/lib/Error/OAuth/OAuthBase.php @@ -13,11 +13,11 @@ class OAuthBase extends \Stripe\Error\Base $httpHeaders = null ) { parent::__construct($description, $httpStatus, $httpBody, $jsonBody, $httpHeaders); - $this->code = $code; + $this->errorCode = $code; } public function getErrorCode() { - return $this->code; + return $this->errorCode; } } diff --git a/vendor/stripe/stripe-php/lib/Event.php b/vendor/stripe/stripe-php/lib/Event.php index 19845c68..319cc9db 100644 --- a/vendor/stripe/stripe-php/lib/Event.php +++ b/vendor/stripe/stripe-php/lib/Event.php @@ -9,11 +9,11 @@ namespace Stripe; * @property string $object * @property string $account * @property string $api_version - * @property int $created - * @property mixed $data - * @property bool $livemode - * @property int $pending_webhooks - * @property mixed $request + * @property int $created + * @property mixed $data + * @property bool $livemode + * @property int $pending_webhooks + * @property mixed $request * @property string $type * * @package Stripe @@ -23,96 +23,128 @@ class Event extends ApiResource const OBJECT_NAME = "event"; - /** + /** * Possible string representations of event types. * @link https://stripe.com/docs/api#event_types */ - const ACCOUNT_UPDATED = 'account.updated'; - const ACCOUNT_APPLICATION_DEAUTHORIZED = 'account.application.deauthorized'; - 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 APPLICATION_FEE_CREATED = 'application_fee.created'; - const APPLICATION_FEE_REFUNDED = 'application_fee.refunded'; - const APPLICATION_FEE_REFUND_UPDATED = 'application_fee.refund.updated'; - const BALANCE_AVAILABLE = 'balance.available'; - const CHARGE_CAPTURED = 'charge.captured'; - const CHARGE_EXPIRED = 'charge.expired'; - const CHARGE_FAILED = 'charge.failed'; - const CHARGE_PENDING = 'charge.pending'; - const CHARGE_REFUNDED = 'charge.refunded'; - const CHARGE_SUCCEEDED = 'charge.succeeded'; - const CHARGE_UPDATED = 'charge.updated'; - const CHARGE_DISPUTE_CLOSED = 'charge.dispute.closed'; - const CHARGE_DISPUTE_CREATED = 'charge.dispute.created'; - const CHARGE_DISPUTE_FUNDS_REINSTATED = 'charge.dispute.funds_reinstated'; - const CHARGE_DISPUTE_FUNDS_WITHDRAWN = 'charge.dispute.funds_withdrawn'; - const CHARGE_DISPUTE_UPDATED = 'charge.dispute.updated'; - const CHARGE_REFUND_UPDATED = 'charge.refund.updated'; - const COUPON_CREATED = 'coupon.created'; - const COUPON_DELETED = 'coupon.deleted'; - const COUPON_UPDATED = 'coupon.updated'; - const CUSTOMER_CREATED = 'customer.created'; - const CUSTOMER_DELETED = 'customer.deleted'; - const CUSTOMER_UPDATED = 'customer.updated'; - const CUSTOMER_DISCOUNT_CREATED = 'customer.discount.created'; - const CUSTOMER_DISCOUNT_DELETED = 'customer.discount.deleted'; - const CUSTOMER_DISCOUNT_UPDATED = 'customer.discount.updated'; - const CUSTOMER_SOURCE_CREATED = 'customer.source.created'; - const CUSTOMER_SOURCE_DELETED = 'customer.source.deleted'; - const CUSTOMER_SOURCE_EXPIRING = 'customer.source.expiring'; - const CUSTOMER_SOURCE_UPDATED = 'customer.source.updated'; - const CUSTOMER_SUBSCRIPTION_CREATED = 'customer.subscription.created'; - const CUSTOMER_SUBSCRIPTION_DELETED = 'customer.subscription.deleted'; - const CUSTOMER_SUBSCRIPTION_TRIAL_WILL_END = 'customer.subscription.trial_will_end'; - const CUSTOMER_SUBSCRIPTION_UPDATED = 'customer.subscription.updated'; - const FILE_CREATED = 'file.created'; - const INVOICE_CREATED = 'invoice.created'; - const INVOICE_PAYMENT_FAILED = 'invoice.payment_failed'; - const INVOICE_PAYMENT_SUCCEEDED = 'invoice.payment_succeeded'; - const INVOICE_SENT = 'invoice.sent'; - const INVOICE_UPCOMING = 'invoice.upcoming'; - const INVOICE_UPDATED = 'invoice.updated'; - const INVOICEITEM_CREATED = 'invoiceitem.created'; - const INVOICEITEM_DELETED = 'invoiceitem.deleted'; - const INVOICEITEM_UPDATED = 'invoiceitem.updated'; - const ORDER_CREATED = 'order.created'; - const ORDER_PAYMENT_FAILED = 'order.payment_failed'; - const ORDER_PAYMENT_SUCCEEDED = 'order.payment_succeeded'; - const ORDER_UPDATED = 'order.updated'; - const ORDER_RETURN_CREATED = 'order_return.created'; - const PAYOUT_CANCELED = 'payout.canceled'; - const PAYOUT_CREATED = 'payout.created'; - const PAYOUT_FAILED = 'payout.failed'; - const PAYOUT_PAID = 'payout.paid'; - const PAYOUT_UPDATED = 'payout.updated'; - const PING = 'ping'; - const PLAN_CREATED = 'plan.created'; - const PLAN_DELETED = 'plan.deleted'; - const PLAN_UPDATED = 'plan.updated'; - const PRODUCT_CREATED = 'product.created'; - const PRODUCT_DELETED = 'product.deleted'; - const PRODUCT_UPDATED = 'product.updated'; - const RECIPIENT_CREATED = 'recipient.created'; - const RECIPIENT_DELETED = 'recipient.deleted'; - const RECIPIENT_UPDATED = 'recipient.updated'; - const REVIEW_CLOSED = 'review.closed'; - const REVIEW_OPENED = 'review.opened'; - const SIGMA_SCHEDULED_QUERY_RUN_CREATED = 'sigma.scheduled_query_run.created'; - const SKU_CREATED = 'sku.created'; - const SKU_DELETED = 'sku.deleted'; - const SKU_UPDATED = 'sku.updated'; - const SOURCE_CANCELED = 'source.canceled'; - const SOURCE_CHARGEABLE = 'source.chargeable'; - const SOURCE_FAILED = 'source.failed'; - const SOURCE_MANDATE_NOTIFICATION = 'source.mandate_notification'; - const SOURCE_TRANSACTION_CREATED = 'source.transaction.created'; - const TOPUP_CREATED = 'topup.created'; - const TOPUP_FAILED = 'topup.failed'; - const TOPUP_SUCCEEDED = 'topup.succeeded'; - const TRANSFER_CREATED = 'transfer.created'; - const TRANSFER_REVERSED = 'transfer.reversed'; - const TRANSFER_UPDATED = 'transfer.updated'; + const ACCOUNT_UPDATED = 'account.updated'; + const ACCOUNT_APPLICATION_AUTHORIZED = 'account.application.authorized'; + const ACCOUNT_APPLICATION_DEAUTHORIZED = 'account.application.deauthorized'; + 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 APPLICATION_FEE_CREATED = 'application_fee.created'; + const APPLICATION_FEE_REFUNDED = 'application_fee.refunded'; + const APPLICATION_FEE_REFUND_UPDATED = 'application_fee.refund.updated'; + const BALANCE_AVAILABLE = 'balance.available'; + const CHARGE_CAPTURED = 'charge.captured'; + const CHARGE_EXPIRED = 'charge.expired'; + const CHARGE_FAILED = 'charge.failed'; + const CHARGE_PENDING = 'charge.pending'; + const CHARGE_REFUNDED = 'charge.refunded'; + const CHARGE_SUCCEEDED = 'charge.succeeded'; + const CHARGE_UPDATED = 'charge.updated'; + const CHARGE_DISPUTE_CLOSED = 'charge.dispute.closed'; + const CHARGE_DISPUTE_CREATED = 'charge.dispute.created'; + const CHARGE_DISPUTE_FUNDS_REINSTATED = 'charge.dispute.funds_reinstated'; + const CHARGE_DISPUTE_FUNDS_WITHDRAWN = 'charge.dispute.funds_withdrawn'; + const CHARGE_DISPUTE_UPDATED = 'charge.dispute.updated'; + const CHARGE_REFUND_UPDATED = 'charge.refund.updated'; + const COUPON_CREATED = 'coupon.created'; + const COUPON_DELETED = 'coupon.deleted'; + const COUPON_UPDATED = 'coupon.updated'; + const CUSTOMER_CREATED = 'customer.created'; + const CUSTOMER_DELETED = 'customer.deleted'; + const CUSTOMER_UPDATED = 'customer.updated'; + const CUSTOMER_DISCOUNT_CREATED = 'customer.discount.created'; + const CUSTOMER_DISCOUNT_DELETED = 'customer.discount.deleted'; + const CUSTOMER_DISCOUNT_UPDATED = 'customer.discount.updated'; + const CUSTOMER_SOURCE_CREATED = 'customer.source.created'; + const CUSTOMER_SOURCE_DELETED = 'customer.source.deleted'; + const CUSTOMER_SOURCE_EXPIRING = 'customer.source.expiring'; + const CUSTOMER_SOURCE_UPDATED = 'customer.source.updated'; + const CUSTOMER_SUBSCRIPTION_CREATED = 'customer.subscription.created'; + const CUSTOMER_SUBSCRIPTION_DELETED = 'customer.subscription.deleted'; + const CUSTOMER_SUBSCRIPTION_TRIAL_WILL_END = 'customer.subscription.trial_will_end'; + const CUSTOMER_SUBSCRIPTION_UPDATED = 'customer.subscription.updated'; + const FILE_CREATED = 'file.created'; + const INVOICE_CREATED = 'invoice.created'; + const INVOICE_DELETED = 'invoice.deleted'; + const INVOICE_FINALIZED = 'invoice.finalized'; + const INVOICE_MARKED_UNCOLLECTIBLE = 'invoice.marked_uncollectible'; + const INVOICE_PAYMENT_FAILED = 'invoice.payment_failed'; + const INVOICE_PAYMENT_SUCCEEDED = 'invoice.payment_succeeded'; + const INVOICE_SENT = 'invoice.sent'; + const INVOICE_UPCOMING = 'invoice.upcoming'; + const INVOICE_UPDATED = 'invoice.updated'; + const INVOICE_VOIDED = 'invoice.voided'; + const INVOICEITEM_CREATED = 'invoiceitem.created'; + const INVOICEITEM_DELETED = 'invoiceitem.deleted'; + const INVOICEITEM_UPDATED = 'invoiceitem.updated'; + const ISSUER_FRAUD_RECORD_CREATED = 'issuer_fraud_record.created'; + const ISSUING_AUTHORIZATION_CREATED = 'issuing_authorization.created'; + const ISSUING_AUTHORIZATION_UPDATED = 'issuing_authorization.updated'; + const ISSUING_CARD_CREATED = 'issuing_card.created'; + const ISSUING_CARD_UPDATED = 'issuing_card.updated'; + const ISSUING_CARDHOLDER_CREATED = 'issuing_cardholder.created'; + const ISSUING_CARDHOLDER_UPDATED = 'issuing_cardholder.updated'; + const ISSUING_TRANSACTION_CREATED = 'issuing_transaction.created'; + const ISSUING_TRANSACTION_UPDATED = 'issuing_transaction.updated'; + const ORDER_CREATED = 'order.created'; + const ORDER_PAYMENT_FAILED = 'order.payment_failed'; + const ORDER_PAYMENT_SUCCEEDED = 'order.payment_succeeded'; + const ORDER_UPDATED = 'order.updated'; + const ORDER_RETURN_CREATED = 'order_return.created'; + const PAYMENT_INTENT_AMOUNT_CAPTURABLE_UPDATED = 'payment_intent.amount_capturable_updated'; + const PAYMENT_INTENT_CREATED = 'payment_intent.created'; + const PAYMENT_INTENT_FAILED = 'payment_intent.failed'; + const PAYMENT_INTENT_SUCCEEDED = 'payment_intent.succeeded'; + const PAYOUT_CANCELED = 'payout.canceled'; + const PAYOUT_CREATED = 'payout.created'; + const PAYOUT_FAILED = 'payout.failed'; + const PAYOUT_PAID = 'payout.paid'; + const PAYOUT_UPDATED = 'payout.updated'; + const PING = 'ping'; + const PLAN_CREATED = 'plan.created'; + const PLAN_DELETED = 'plan.deleted'; + const PLAN_UPDATED = 'plan.updated'; + const PRODUCT_CREATED = 'product.created'; + const PRODUCT_DELETED = 'product.deleted'; + const PRODUCT_UPDATED = 'product.updated'; + const RECIPIENT_CREATED = 'recipient.created'; + const RECIPIENT_DELETED = 'recipient.deleted'; + const RECIPIENT_UPDATED = 'recipient.updated'; + const REPORTING_REPORT_RUN_FAILED = 'reporting.report_run.failed'; + const REPORTING_REPORT_RUN_SUCCEEDED = 'reporting.report_run.succeeded'; + const REPORTING_REPORT_TYPE_UPDATED = 'reporting.report_type.updated'; + const REVIEW_CLOSED = 'review.closed'; + const REVIEW_OPENED = 'review.opened'; + const SIGMA_SCHEDULED_QUERY_RUN_CREATED = 'sigma.scheduled_query_run.created'; + const SKU_CREATED = 'sku.created'; + const SKU_DELETED = 'sku.deleted'; + const SKU_UPDATED = 'sku.updated'; + const SOURCE_CANCELED = 'source.canceled'; + const SOURCE_CHARGEABLE = 'source.chargeable'; + const SOURCE_FAILED = 'source.failed'; + const SOURCE_MANDATE_NOTIFICATION = 'source.mandate_notification'; + const SOURCE_REFUND_ATTRIBUTES_REQUIRED = 'source.refund_attributes_required'; + const SOURCE_TRANSACTION_CREATED = 'source.transaction.created'; + const SOURCE_TRANSACTION_UPDATED = 'source.transaction.updated'; + const SUBSCRIPTION_SCHEDULE_ABORTED = 'subscription_schedule.aborted'; + const SUBSCRIPTION_SCHEDULE_CANCELED = 'subscription_schedule.canceled'; + const SUBSCRIPTION_SCHEDULE_COMPLETED = 'subscription_schedule.completed'; + const SUBSCRIPTION_SCHEDULE_CREATED = 'subscription_schedule.created'; + const SUBSCRIPTION_SCHEDULE_EXPIRING = 'subscription_schedule.expiring'; + const SUBSCRIPTION_SCHEDULE_RELEASED = 'subscription_schedule.released'; + const SUBSCRIPTION_SCHEDULE_UPDATED = 'subscription_schedule.updated'; + const TOPUP_CANCELED = 'topup.canceled'; + const TOPUP_CREATED = 'topup.created'; + const TOPUP_FAILED = 'topup.failed'; + const TOPUP_REVERSED = 'topup.reversed'; + const TOPUP_SUCCEEDED = 'topup.succeeded'; + const TRANSFER_CREATED = 'transfer.created'; + const TRANSFER_REVERSED = 'transfer.reversed'; + const TRANSFER_UPDATED = 'transfer.updated'; use ApiOperations\All; use ApiOperations\Retrieve; diff --git a/vendor/stripe/stripe-php/lib/HttpClient/CurlClient.php b/vendor/stripe/stripe-php/lib/HttpClient/CurlClient.php index 51eec3e1..c9155ca6 100644 --- a/vendor/stripe/stripe-php/lib/HttpClient/CurlClient.php +++ b/vendor/stripe/stripe-php/lib/HttpClient/CurlClient.php @@ -42,6 +42,10 @@ class CurlClient implements ClientInterface protected $userAgentInfo; + protected $enablePersistentConnections = null; + + protected $curlHandle = null; + /** * CurlClient constructor. * @@ -60,6 +64,15 @@ class CurlClient implements ClientInterface $this->defaultOptions = $defaultOptions; $this->randomGenerator = $randomGenerator ?: new Util\RandomGenerator(); $this->initUserAgentInfo(); + + // TODO: curl_reset requires PHP >= 5.5.0. Once we drop support for PHP 5.4, we can simply + // initialize this to true. + $this->enablePersistentConnections = function_exists('curl_reset'); + } + + public function __destruct() + { + $this->closeCurlHandle(); } public function initUserAgentInfo() @@ -81,6 +94,22 @@ class CurlClient implements ClientInterface return $this->userAgentInfo; } + /** + * @return boolean + */ + public function getEnablePersistentConnections() + { + return $this->enablePersistentConnections; + } + + /** + * @param boolean $enable + */ + public function setEnablePersistentConnections($enable) + { + $this->enablePersistentConnections = $enable; + } + // USER DEFINED TIMEOUTS const DEFAULT_TIMEOUT = 80; @@ -199,8 +228,10 @@ class CurlClient implements ClientInterface $opts[CURLOPT_SSL_VERIFYPEER] = false; } - // For HTTPS requests, enable HTTP/2, if supported - $opts[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_2TLS; + if (!isset($opts[CURLOPT_HTTP_VERSION])) { + // For HTTPS requests, enable HTTP/2, if supported + $opts[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_2TLS; + } list($rbody, $rcode) = $this->executeRequestWithRetries($opts, $absUrl); @@ -218,17 +249,19 @@ class CurlClient implements ClientInterface $rcode = 0; $errno = 0; - $curl = curl_init(); - curl_setopt_array($curl, $opts); - $rbody = curl_exec($curl); + $this->resetCurlHandle(); + curl_setopt_array($this->curlHandle, $opts); + $rbody = curl_exec($this->curlHandle); if ($rbody === false) { - $errno = curl_errno($curl); - $message = curl_error($curl); + $errno = curl_errno($this->curlHandle); + $message = curl_error($this->curlHandle); } else { - $rcode = curl_getinfo($curl, CURLINFO_HTTP_CODE); + $rcode = curl_getinfo($this->curlHandle, CURLINFO_HTTP_CODE); + } + if (!$this->getEnablePersistentConnections()) { + $this->closeCurlHandle(); } - curl_close($curl); if ($this->shouldRetry($errno, $rcode, $numRetries)) { $numRetries += 1; @@ -340,4 +373,37 @@ class CurlClient implements ClientInterface return $sleepSeconds; } + + /** + * Initializes the curl handle. If already initialized, the handle is closed first. + */ + private function initCurlHandle() + { + $this->closeCurlHandle(); + $this->curlHandle = curl_init(); + } + + /** + * Closes the curl handle if initialized. Do nothing if already closed. + */ + private function closeCurlHandle() + { + if (!is_null($this->curlHandle)) { + curl_close($this->curlHandle); + $this->curlHandle = null; + } + } + + /** + * Resets the curl handle. If the handle is not already initialized, or if persistent + * connections are disabled, the handle is reinitialized instead. + */ + private function resetCurlHandle() + { + if (!is_null($this->curlHandle) && $this->getEnablePersistentConnections()) { + curl_reset($this->curlHandle); + } else { + $this->initCurlHandle(); + } + } } diff --git a/vendor/stripe/stripe-php/lib/Invoice.php b/vendor/stripe/stripe-php/lib/Invoice.php index 14aa9ca7..e5b16f37 100644 --- a/vendor/stripe/stripe-php/lib/Invoice.php +++ b/vendor/stripe/stripe-php/lib/Invoice.php @@ -17,15 +17,16 @@ namespace Stripe; * @property string $billing * @property string $billing_reason * @property string $charge - * @property bool $closed + * @property int $created * @property string $currency + * @property mixed $custom_fields * @property string $customer - * @property int $date + * @property string $default_source * @property string $description * @property Discount $discount * @property int $due_date * @property int $ending_balance - * @property bool $forgiven + * @property string $footer * @property string $hosted_invoice_url * @property string $invoice_pdf * @property Collection $lines @@ -39,11 +40,14 @@ namespace Stripe; * @property string $receipt_number * @property int $starting_balance * @property string $statement_descriptor + * @property string $status + * @property mixed $status_transitions * @property string $subscription * @property int $subscription_proration_date * @property int $subtotal * @property int $tax * @property float $tax_percent + * @property mixed $threshold_reason * @property int $total * @property int $webhooks_delivered_at * @@ -56,9 +60,66 @@ class Invoice extends ApiResource use ApiOperations\All; use ApiOperations\Create; + use ApiOperations\Delete; use ApiOperations\Retrieve; use ApiOperations\Update; + /** + * @param array|null $params + * @param array|string|null $opts + * + * @return Invoice The finalized invoice. + */ + public function finalizeInvoice($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/finalize'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + return $this; + } + + /** + * @param array|null $params + * @param array|string|null $opts + * + * @return Invoice The uncollectible invoice. + */ + public function markUncollectible($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/mark_uncollectible'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + return $this; + } + + /** + * @param array|null $params + * @param array|string|null $opts + * + * @return Invoice The paid invoice. + */ + public function pay($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/pay'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + return $this; + } + + /** + * @param array|null $params + * @param array|string|null $opts + * + * @return Invoice The sent invoice. + */ + public function sendInvoice($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/send'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + return $this; + } + /** * @param array|null $params * @param array|string|null $opts @@ -75,11 +136,14 @@ class Invoice extends ApiResource } /** - * @return Invoice The paid invoice. + * @param array|null $params + * @param array|string|null $opts + * + * @return Invoice The voided invoice. */ - public function pay($params = null, $opts = null) + public function voidInvoice($params = null, $opts = null) { - $url = $this->instanceUrl() . '/pay'; + $url = $this->instanceUrl() . '/void'; list($response, $opts) = $this->_request('post', $url, $params, $opts); $this->refreshFrom($response, $opts); return $this; diff --git a/vendor/stripe/stripe-php/lib/Issuing/Authorization.php b/vendor/stripe/stripe-php/lib/Issuing/Authorization.php index 373aa395..9a04063d 100644 --- a/vendor/stripe/stripe-php/lib/Issuing/Authorization.php +++ b/vendor/stripe/stripe-php/lib/Issuing/Authorization.php @@ -25,7 +25,6 @@ namespace Stripe\Issuing; * @property int $pending_held_amount * @property mixed $request_history * @property string $status - * @property mixed $request_history * @property \Stripe\Collection $transactions * @property mixed $verification_data * diff --git a/vendor/stripe/stripe-php/lib/PaymentIntent.php b/vendor/stripe/stripe-php/lib/PaymentIntent.php index 289789b5..0edf02be 100644 --- a/vendor/stripe/stripe-php/lib/PaymentIntent.php +++ b/vendor/stripe/stripe-php/lib/PaymentIntent.php @@ -7,13 +7,13 @@ namespace Stripe; * * @property string $id * @property string $object - * @property string[] $allowed_source_types * @property int $amount * @property int $amount_capturable * @property int $amount_received * @property string $application - * @property int $application_fee + * @property int $application_fee_amount * @property int $canceled_at + * @property string $cancellation_reason * @property string $capture_method * @property Collection $charges * @property string $client_secret @@ -22,12 +22,13 @@ namespace Stripe; * @property string $currency * @property string $customer * @property string $description + * @property mixed $last_payment_error * @property bool $livemode * @property StripeObject $metadata - * @property mixed $next_source_action + * @property mixed $next_action * @property string $on_behalf_of + * @property string[] $payment_method_types * @property string $receipt_email - * @property string $return_url * @property string $review * @property mixed $shipping * @property string $source diff --git a/vendor/stripe/stripe-php/lib/Person.php b/vendor/stripe/stripe-php/lib/Person.php new file mode 100644 index 00000000..500f4915 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Person.php @@ -0,0 +1,93 @@ +<?php + +namespace Stripe; + +/** + * Class Person + * + * @package Stripe + * + * @property string $id + * @property string $object + * @property string $account + * @property mixed $address + * @property mixed $address_kana + * @property mixed $address_kanji + * @property int $created + * @property bool $deleted + * @property mixed $dob + * @property string $email + * @property string $first_name + * @property string $first_name_kana + * @property string $first_name_kanji + * @property string $gender + * @property bool $id_number_provided + * @property string $last_name + * @property string $last_name_kana + * @property string $last_name_kanji + * @property string $maiden_name + * @property StripeObject $metadata + * @property string $phone + * @property mixed $relationship + * @property mixed $requirements + * @property bool $ssn_last_4_provided + * @property mixed $verification + */ +class Person extends ApiResource +{ + + const OBJECT_NAME = "person"; + + use ApiOperations\Delete; + use ApiOperations\Update; + + /** + * @return string The API URL for this Stripe account reversal. + */ + public function instanceUrl() + { + $id = $this['id']; + $account = $this['account']; + if (!$id) { + throw new Error\InvalidRequest( + "Could not determine which URL to request: " . + "class instance has invalid ID: $id", + null + ); + } + $id = Util\Util::utf8($id); + $account = Util\Util::utf8($account); + + $base = Account::classUrl(); + $accountExtn = urlencode($account); + $extn = urlencode($id); + return "$base/$accountExtn/persons/$extn"; + } + + /** + * @param array|string $_id + * @param array|string|null $_opts + * + * @throws \Stripe\Error\InvalidRequest + */ + public static function retrieve($_id, $_opts = null) + { + $msg = "Persons cannot be accessed without an account ID. " . + "Retrieve a Person using \$account->retrievePerson('person_id') instead."; + throw new Error\InvalidRequest($msg, null); + } + + /** + * @param string $_id + * @param array|null $_params + * @param array|string|null $_options + * + * @throws \Stripe\Error\InvalidRequest + */ + public static function update($_id, $_params = null, $_options = null) + { + $msg = "Persons cannot be accessed without an account ID. " . + "Retrieve a Person using \$account->retrievePerson('person_id') instead."; + throw new Error\InvalidRequest($msg, null); + } +} diff --git a/vendor/stripe/stripe-php/lib/Product.php b/vendor/stripe/stripe-php/lib/Product.php index 1087349b..1d718d50 100644 --- a/vendor/stripe/stripe-php/lib/Product.php +++ b/vendor/stripe/stripe-php/lib/Product.php @@ -13,7 +13,7 @@ namespace Stripe; * @property int $created * @property string[] $deactivate_on * @property string $description - * @property array $images + * @property string[] $images * @property bool $livemode * @property StripeObject $metadata * @property string $name diff --git a/vendor/stripe/stripe-php/lib/Radar/ValueList.php b/vendor/stripe/stripe-php/lib/Radar/ValueList.php new file mode 100644 index 00000000..d267429b --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Radar/ValueList.php @@ -0,0 +1,32 @@ +<?php + +namespace Stripe\Radar; + +/** + * Class ValueList + * + * @property string $id + * @property string $object + * @property string $alias + * @property int $created + * @property string $created_by + * @property string $item_type + * @property Collection $list_items + * @property bool $livemode + * @property StripeObject $metadata + * @property mixed $name + * @property int $updated + * @property string $updated_by + * + * @package Stripe\Radar + */ +class ValueList extends \Stripe\ApiResource +{ + const OBJECT_NAME = "radar.value_list"; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Delete; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/lib/Radar/ValueListItem.php b/vendor/stripe/stripe-php/lib/Radar/ValueListItem.php new file mode 100644 index 00000000..42b1f10f --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Radar/ValueListItem.php @@ -0,0 +1,26 @@ +<?php + +namespace Stripe\Radar; + +/** + * Class ValueListItem + * + * @property string $id + * @property string $object + * @property int $created + * @property string $created_by + * @property string $list + * @property bool $livemode + * @property string $value + * + * @package Stripe\Radar + */ +class ValueListItem extends \Stripe\ApiResource +{ + const OBJECT_NAME = "radar.value_list_item"; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Delete; + use \Stripe\ApiOperations\Retrieve; +} diff --git a/vendor/stripe/stripe-php/lib/Refund.php b/vendor/stripe/stripe-php/lib/Refund.php index 2ec220ab..396f06fc 100644 --- a/vendor/stripe/stripe-php/lib/Refund.php +++ b/vendor/stripe/stripe-php/lib/Refund.php @@ -12,12 +12,15 @@ namespace Stripe; * @property string $charge * @property int $created * @property string $currency + * @property string $description * @property string $failure_balance_transaction * @property string $failure_reason * @property StripeObject $metadata - * @property mixed $reason - * @property mixed $receipt_number + * @property string $reason + * @property string $receipt_number + * @property string $source_transfer_reversal * @property string $status + * @property string $transfer_reversal * * @package Stripe */ diff --git a/vendor/stripe/stripe-php/lib/RequestTelemetry.php b/vendor/stripe/stripe-php/lib/RequestTelemetry.php new file mode 100644 index 00000000..f677a7f7 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/RequestTelemetry.php @@ -0,0 +1,27 @@ +<?php + +namespace Stripe; + +/** + * Class RequestTelemetry + * + * Tracks client request telemetry + * @package Stripe + */ +class RequestTelemetry +{ + public $requestId; + public $requestDuration; + + /** + * Initialize a new telemetry object. + * + * @param string $requestId The request's request ID. + * @param int $requestDuration The request's duration in milliseconds. + */ + public function __construct($requestId, $requestDuration) + { + $this->requestId = $requestId; + $this->requestDuration = $requestDuration; + } +} diff --git a/vendor/stripe/stripe-php/lib/Review.php b/vendor/stripe/stripe-php/lib/Review.php new file mode 100644 index 00000000..2698b37f --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Review.php @@ -0,0 +1,44 @@ +<?php + +namespace Stripe; + +/** + * Class Review + * + * @property string $id + * @property string $object + * @property string $billing_zip + * @property string $charge + * @property string $closed_reason + * @property int $created + * @property string $ip_address + * @property mixed $ip_address_location + * @property bool $livemode + * @property bool $open + * @property string $opened_reason + * @property string $payment_intent + * @property string $reason + * @property mixed $session + * + * @package Stripe + */ +class Review extends \Stripe\ApiResource +{ + const OBJECT_NAME = "review"; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Retrieve; + + /** + * @param array|string|null $options + * + * @return Review The approved review. + */ + public function approve($params = null, $options = null) + { + $url = $this->instanceUrl() . '/approve'; + list($response, $opts) = $this->_request('post', $url, $params, $options); + $this->refreshFrom($response, $opts); + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/Source.php b/vendor/stripe/stripe-php/lib/Source.php index b051f416..31b7cf77 100644 --- a/vendor/stripe/stripe-php/lib/Source.php +++ b/vendor/stripe/stripe-php/lib/Source.php @@ -7,22 +7,37 @@ namespace Stripe; * * @property string $id * @property string $object + * @property mixed $ach_credit_transfer + * @property mixed $ach_debit + * @property mixed $alipay * @property int $amount + * @property mixed $bancontact + * @property mixed $card + * @property mixed $card_present * @property string $client_secret * @property mixed $code_verification * @property int $created * @property string $currency + * @property mixed $eps * @property string $flow + * @property mixed $giropay + * @property mixed $ideal * @property bool $livemode * @property StripeObject $metadata + * @property mixed $multibanco * @property mixed $owner + * @property mixed $p24 * @property mixed $receiver * @property mixed $redirect + * @property mixed $sepa_debit + * @property mixed $sofort * @property string $statement_descriptor * @property string $status + * @property mixed $three_d_secure * @property string $type * @property string $usage - * + * @property mixed $wechat + * @package Stripe */ class Source extends ApiResource diff --git a/vendor/stripe/stripe-php/lib/Stripe.php b/vendor/stripe/stripe-php/lib/Stripe.php index 564d519e..d4045c7f 100644 --- a/vendor/stripe/stripe-php/lib/Stripe.php +++ b/vendor/stripe/stripe-php/lib/Stripe.php @@ -46,13 +46,16 @@ class Stripe // @var int Maximum number of request retries public static $maxNetworkRetries = 0; + // @var boolean Whether client telemetry is enabled. Defaults to false. + public static $enableTelemetry = false; + // @var float Maximum delay between retries, in seconds private static $maxNetworkRetryDelay = 2.0; // @var float Initial delay between retries, in seconds private static $initialNetworkRetryDelay = 0.5; - const VERSION = '6.19.5'; + const VERSION = '6.30.4'; /** * @return string The API key used for requests. @@ -239,4 +242,24 @@ class Stripe { return self::$initialNetworkRetryDelay; } + + /** + * @return bool Whether client telemetry is enabled + */ + public static function getEnableTelemetry() + { + return self::$enableTelemetry; + } + + /** + * @param bool $enableTelemetry Enables client telemetry. + * + * Client telemetry enables timing and request metrics to be sent back to Stripe as an HTTP Header + * with the current request. This enables Stripe to do latency and metrics analysis without adding extra + * overhead (such as extra network calls) on the client. + */ + public static function setEnableTelemetry($enableTelemetry) + { + self::$enableTelemetry = $enableTelemetry; + } } diff --git a/vendor/stripe/stripe-php/lib/Subscription.php b/vendor/stripe/stripe-php/lib/Subscription.php index e6bfa1dd..82aac8e1 100644 --- a/vendor/stripe/stripe-php/lib/Subscription.php +++ b/vendor/stripe/stripe-php/lib/Subscription.php @@ -10,6 +10,7 @@ namespace Stripe; * @property float $application_fee_percent * @property string $billing * @property int $billing_cycle_anchor + * @property mixed $billing_thresholds * @property bool $cancel_at_period_end * @property int $canceled_at * @property int $created @@ -17,13 +18,16 @@ namespace Stripe; * @property int $current_period_start * @property string $customer * @property int $days_until_due + * @property string $default_source * @property Discount $discount * @property int $ended_at * @property Collection $items + * @property string $latest_invoice * @property boolean $livemode * @property StripeObject $metadata * @property Plan $plan * @property int $quantity + * @property SubscriptionSchedule $schedule * @property int $start * @property string $status * @property float $tax_percent diff --git a/vendor/stripe/stripe-php/lib/SubscriptionItem.php b/vendor/stripe/stripe-php/lib/SubscriptionItem.php index 199952fc..22ed8a1d 100644 --- a/vendor/stripe/stripe-php/lib/SubscriptionItem.php +++ b/vendor/stripe/stripe-php/lib/SubscriptionItem.php @@ -7,6 +7,7 @@ namespace Stripe; * * @property string $id * @property string $object + * @property mixed $billing_thresholds * @property int $created * @property StripeObject $metadata * @property Plan $plan diff --git a/vendor/stripe/stripe-php/lib/SubscriptionSchedule.php b/vendor/stripe/stripe-php/lib/SubscriptionSchedule.php new file mode 100644 index 00000000..b8eae1c2 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/SubscriptionSchedule.php @@ -0,0 +1,111 @@ +<?php + +namespace Stripe; + +/** + * Class SubscriptionSchedule + * + * @property string $id + * @property string $object + * @property string $billing + * @property mixed $billing_thresholds + * @property int $canceled_at + * @property int $completed_at + * @property int $created + * @property mixed $current_phase + * @property string $customer + * @property mixed $invoice_settings + * @property boolean $livemode + * @property StripeObject $metadata + * @property mixed $phases + * @property int $released_at + * @property string $released_subscription + * @property string $renewal_behavior + * @property mixed $renewal_interval + * @property string $revision + * @property string $status + * @property string $subscription + * + * @package Stripe + */ +class SubscriptionSchedule extends ApiResource +{ + + const OBJECT_NAME = "subscription_schedule"; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + use ApiOperations\NestedResource; + + const PATH_REVISIONS = '/revisions'; + + /** + * @param array|null $params + * @param array|string|null $opts + * + * @return SubscriptionSchedule The canceled subscription schedule. + */ + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + return $this; + } + + /** + * @param array|null $params + * @param array|string|null $opts + * + * @return SubscriptionSchedule The released subscription schedule. + */ + public function release($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/release'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + return $this; + } + + /** + * @param array|null $params + * @param array|string|null $options + * + * @return Collection The list of subscription schedule revisions. + */ + public function revisions($params = null, $options = null) + { + $url = $this->instanceUrl() . '/revisions'; + list($response, $opts) = $this->_request('get', $url, $params, $options); + $obj = Util\Util::convertToStripeObject($response, $opts); + $obj->setLastResponse($response); + return $obj; + } + + /** + * @param array|null $id The ID of the subscription schedule to which the person belongs. + * @param array|null $personId The ID of the person to retrieve. + * @param array|null $params + * @param array|string|null $opts + * + * @return Revision + */ + public static function retrieveRevision($id, $personId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_REVISIONS, $personId, $params, $opts); + } + + /** + * @param array|null $id The ID of the subscription schedule on which to retrieve the persons. + * @param array|null $params + * @param array|string|null $opts + * + * @return Revision + */ + public static function allRevisions($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_REVISIONS, $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/SubscriptionScheduleRevision.php b/vendor/stripe/stripe-php/lib/SubscriptionScheduleRevision.php new file mode 100644 index 00000000..12177236 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/SubscriptionScheduleRevision.php @@ -0,0 +1,77 @@ +<?php + +namespace Stripe; + +/** + * Class SubscriptionScheduleRevision + * + * @property string $id + * @property string $object + * @property int $created + * @property mixed $invoice_settings + * @property boolean $livemode + * @property mixed $phases + * @property string $previous_revision + * @property string $renewal_behavior + * @property mixed $renewal_interval + * @property string $schedule + * + * @package Stripe + */ +class SubscriptionScheduleRevision extends ApiResource +{ + + const OBJECT_NAME = "subscription_schedule_revision"; + + use ApiOperations\All; + use ApiOperations\Retrieve; + + /** + * @return string The API URL for this Subscription Schedule Revision. + */ + public function instanceUrl() + { + $id = $this['id']; + $schedule = $this['schedule']; + if (!$id) { + throw new Error\InvalidRequest( + "Could not determine which URL to request: " . + "class instance has invalid ID: $id", + null + ); + } + $id = Util\Util::utf8($id); + $schedule = Util\Util::utf8($schedule); + + $base = SubscriptionSchedule::classUrl(); + $scheduleExtn = urlencode($schedule); + $extn = urlencode($id); + return "$base/$scheduleExtn/revisions/$extn"; + } + + /** + * @param array|string $_id + * @param array|string|null $_opts + * + * @throws \Stripe\Error\InvalidRequest + */ + public static function retrieve($_id, $_opts = null) + { + $msg = "Subscription Schedule Revisions cannot be accessed without a Subscription Schedule ID. " . + "Retrieve one using \$schedule->retrieveRevision('revision_id') instead."; + throw new Error\InvalidRequest($msg, null); + } + + /** + * @param array|string $_id + * @param array|string|null $_opts + * + * @throws \Stripe\Error\InvalidRequest + */ + public static function all($params = null, $opts = null) + { + $msg = "Subscription Schedule Revisions cannot be listed without a Subscription Schedule ID. " . + "List those using \$schedule->allRevisions('revision_id') instead."; + throw new Error\InvalidRequest($msg, null); + } +} diff --git a/vendor/stripe/stripe-php/lib/Transfer.php b/vendor/stripe/stripe-php/lib/Transfer.php index fb84c874..5a173fad 100644 --- a/vendor/stripe/stripe-php/lib/Transfer.php +++ b/vendor/stripe/stripe-php/lib/Transfer.php @@ -61,7 +61,7 @@ class Transfer extends ApiResource } /** - * @param array|null $id The ID of the transfer on which to create the reversal. + * @param string|null $id The ID of the transfer on which to create the reversal. * @param array|null $params * @param array|string|null $opts * @@ -73,7 +73,7 @@ class Transfer extends ApiResource } /** - * @param array|null $id The ID of the transfer to which the reversal belongs. + * @param string|null $id The ID of the transfer to which the reversal belongs. * @param array|null $reversalId The ID of the reversal to retrieve. * @param array|null $params * @param array|string|null $opts @@ -86,7 +86,7 @@ class Transfer extends ApiResource } /** - * @param array|null $id The ID of the transfer to which the reversal belongs. + * @param string|null $id The ID of the transfer to which the reversal belongs. * @param array|null $reversalId The ID of the reversal to update. * @param array|null $params * @param array|string|null $opts @@ -99,7 +99,7 @@ class Transfer extends ApiResource } /** - * @param array|null $id The ID of the transfer on which to retrieve the reversals. + * @param string|null $id The ID of the transfer on which to retrieve the reversals. * @param array|null $params * @param array|string|null $opts * diff --git a/vendor/stripe/stripe-php/lib/TransferReversal.php b/vendor/stripe/stripe-php/lib/TransferReversal.php index 3c8a7e2e..c945e5a9 100644 --- a/vendor/stripe/stripe-php/lib/TransferReversal.php +++ b/vendor/stripe/stripe-php/lib/TransferReversal.php @@ -11,7 +11,9 @@ namespace Stripe; * @property string $balance_transaction * @property int $created * @property string $currency + * @property string $destination_payment_refund * @property StripeObject $metadata + * @property string $source_refund * @property string $transfer * * @package Stripe diff --git a/vendor/stripe/stripe-php/lib/Util/Util.php b/vendor/stripe/stripe-php/lib/Util/Util.php index 7e64536b..f4eafc25 100644 --- a/vendor/stripe/stripe-php/lib/Util/Util.php +++ b/vendor/stripe/stripe-php/lib/Util/Util.php @@ -71,6 +71,7 @@ abstract class Util // business objects \Stripe\Account::OBJECT_NAME => 'Stripe\\Account', + \Stripe\AccountLink::OBJECT_NAME => 'Stripe\\AccountLink', \Stripe\AlipayAccount::OBJECT_NAME => 'Stripe\\AlipayAccount', \Stripe\ApplePayDomain::OBJECT_NAME => 'Stripe\\ApplePayDomain', \Stripe\ApplicationFee::OBJECT_NAME => 'Stripe\\ApplicationFee', @@ -81,6 +82,7 @@ abstract class Util \Stripe\BitcoinTransaction::OBJECT_NAME => 'Stripe\\BitcoinTransaction', \Stripe\Card::OBJECT_NAME => 'Stripe\\Card', \Stripe\Charge::OBJECT_NAME => 'Stripe\\Charge', + \Stripe\Checkout\Session::OBJECT_NAME => 'Stripe\\Checkout\\Session', \Stripe\CountrySpec::OBJECT_NAME => 'Stripe\\CountrySpec', \Stripe\Coupon::OBJECT_NAME => 'Stripe\\Coupon', \Stripe\Customer::OBJECT_NAME => 'Stripe\\Customer', @@ -109,19 +111,25 @@ abstract class Util \Stripe\OrderReturn::OBJECT_NAME => 'Stripe\\OrderReturn', \Stripe\PaymentIntent::OBJECT_NAME => 'Stripe\\PaymentIntent', \Stripe\Payout::OBJECT_NAME => 'Stripe\\Payout', + \Stripe\Person::OBJECT_NAME => 'Stripe\\Person', \Stripe\Plan::OBJECT_NAME => 'Stripe\\Plan', \Stripe\Product::OBJECT_NAME => 'Stripe\\Product', + \Stripe\Radar\ValueList::OBJECT_NAME => 'Stripe\\Radar\\ValueList', + \Stripe\Radar\ValueListItem::OBJECT_NAME => 'Stripe\\Radar\\ValueListItem', \Stripe\Recipient::OBJECT_NAME => 'Stripe\\Recipient', \Stripe\RecipientTransfer::OBJECT_NAME => 'Stripe\\RecipientTransfer', \Stripe\Refund::OBJECT_NAME => 'Stripe\\Refund', \Stripe\Reporting\ReportRun::OBJECT_NAME => 'Stripe\\Reporting\\ReportRun', \Stripe\Reporting\ReportType::OBJECT_NAME => 'Stripe\\Reporting\\ReportType', + \Stripe\Review::OBJECT_NAME => 'Stripe\\Review', \Stripe\SKU::OBJECT_NAME => 'Stripe\\SKU', \Stripe\Sigma\ScheduledQueryRun::OBJECT_NAME => 'Stripe\\Sigma\\ScheduledQueryRun', \Stripe\Source::OBJECT_NAME => 'Stripe\\Source', \Stripe\SourceTransaction::OBJECT_NAME => 'Stripe\\SourceTransaction', \Stripe\Subscription::OBJECT_NAME => 'Stripe\\Subscription', \Stripe\SubscriptionItem::OBJECT_NAME => 'Stripe\\SubscriptionItem', + \Stripe\SubscriptionSchedule::OBJECT_NAME => 'Stripe\\SubscriptionSchedule', + \Stripe\SubscriptionScheduleRevision::OBJECT_NAME => 'Stripe\\SubscriptionScheduleRevision', \Stripe\ThreeDSecure::OBJECT_NAME => 'Stripe\\ThreeDSecure', \Stripe\Terminal\ConnectionToken::OBJECT_NAME => 'Stripe\\Terminal\\ConnectionToken', \Stripe\Terminal\Location::OBJECT_NAME => 'Stripe\\Terminal\\Location', @@ -132,6 +140,7 @@ abstract class Util \Stripe\TransferReversal::OBJECT_NAME => 'Stripe\\TransferReversal', \Stripe\UsageRecord::OBJECT_NAME => 'Stripe\\UsageRecord', \Stripe\UsageRecordSummary::OBJECT_NAME => 'Stripe\\UsageRecordSummary', + \Stripe\WebhookEndpoint::OBJECT_NAME => 'Stripe\\WebhookEndpoint', ]; if (self::isList($resp)) { $mapped = []; @@ -331,4 +340,14 @@ abstract class Util } return [$id, $params]; } + + /** + * Returns UNIX timestamp in milliseconds + * + * @return integer current time in millis + */ + public static function currentTimeMillis() + { + return (int) round(microtime(true) * 1000); + } } diff --git a/vendor/stripe/stripe-php/lib/WebhookEndpoint.php b/vendor/stripe/stripe-php/lib/WebhookEndpoint.php new file mode 100644 index 00000000..27ecacf6 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/WebhookEndpoint.php @@ -0,0 +1,29 @@ +<?php + +namespace Stripe; + +/** + * Class WebhookEndpoint + * + * @property string $id + * @property string $object + * @property int $created + * @property string[] $enabled_events + * @property bool $livemode + * @property string $secret + * @property string $status + * @property string $url + * + * @package Stripe + */ +class WebhookEndpoint extends ApiResource +{ + + const OBJECT_NAME = "webhook_endpoint"; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\Retrieve; + use ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/phpunit.no_autoload.xml b/vendor/stripe/stripe-php/phpunit.no_autoload.xml deleted file mode 100644 index f418611d..00000000 --- a/vendor/stripe/stripe-php/phpunit.no_autoload.xml +++ /dev/null @@ -1,15 +0,0 @@ -<phpunit bootstrap="tests/bootstrap.no_autoload.php" colors="true"> - <testsuites> - <testsuite name="Stripe PHP Test Suite"> - <directory suffix="Test.php">tests</directory> - </testsuite> - </testsuites> - <filter> - <whitelist> - <directory>lib</directory> - </whitelist> - </filter> - <logging> - <log type="coverage-clover" target="clover.xml"/> - </logging> -</phpunit> diff --git a/vendor/stripe/stripe-php/phpunit.xml b/vendor/stripe/stripe-php/phpunit.xml deleted file mode 100644 index 7a73276d..00000000 --- a/vendor/stripe/stripe-php/phpunit.xml +++ /dev/null @@ -1,15 +0,0 @@ -<phpunit bootstrap="tests/bootstrap.php" colors="true"> - <testsuites> - <testsuite name="Stripe PHP Test Suite"> - <directory suffix="Test.php">tests</directory> - </testsuite> - </testsuites> - <filter> - <whitelist> - <directory>lib</directory> - </whitelist> - </filter> - <logging> - <log type="coverage-clover" target="clover.xml"/> - </logging> -</phpunit> diff --git a/vendor/stripe/stripe-php/tests/Stripe/AccountTest.php b/vendor/stripe/stripe-php/tests/Stripe/AccountTest.php deleted file mode 100644 index 0e7b2fe1..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/AccountTest.php +++ /dev/null @@ -1,388 +0,0 @@ -<?php - -namespace Stripe; - -class AccountTest extends TestCase -{ - const TEST_RESOURCE_ID = 'acct_123'; - const TEST_EXTERNALACCOUNT_ID = 'ba_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/accounts' - ); - $resources = Account::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Account", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/accounts/' . self::TEST_RESOURCE_ID - ); - $resource = Account::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Account", $resource); - } - - public function testIsRetrievableWithoutId() - { - $this->expectsRequest( - 'get', - '/v1/account' - ); - $resource = Account::retrieve(); - $this->assertInstanceOf("Stripe\\Account", $resource); - } - - public function testIsCreatable() - { - $this->expectsRequest( - 'post', - '/v1/accounts' - ); - $resource = Account::create(["type" => "custom"]); - $this->assertInstanceOf("Stripe\\Account", $resource); - } - - public function testIsSaveable() - { - $resource = Account::retrieve(self::TEST_RESOURCE_ID); - $resource->metadata["key"] = "value"; - $this->expectsRequest( - 'post', - '/v1/accounts/' . $resource->id - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\Account", $resource); - } - - public function testIsUpdatable() - { - $this->expectsRequest( - 'post', - '/v1/accounts/' . self::TEST_RESOURCE_ID - ); - $resource = Account::update(self::TEST_RESOURCE_ID, [ - "metadata" => ["key" => "value"], - ]); - $this->assertInstanceOf("Stripe\\Account", $resource); - } - - public function testIsDeletable() - { - $resource = Account::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'delete', - '/v1/accounts/' . $resource->id - ); - $resource->delete(); - $this->assertInstanceOf("Stripe\\Account", $resource); - } - - public function testIsRejectable() - { - $account = Account::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'post', - '/v1/accounts/' . $account->id . '/reject' - ); - $resource = $account->reject(["reason" => "fraud"]); - $this->assertInstanceOf("Stripe\\Account", $resource); - $this->assertSame($resource, $account); - } - - public function testIsDeauthorizable() - { - $resource = Account::retrieve(self::TEST_RESOURCE_ID); - $this->stubRequest( - 'post', - '/oauth/deauthorize', - [ - 'client_id' => Stripe::getClientId(), - 'stripe_user_id' => $resource->id, - ], - null, - false, - [ - 'stripe_user_id' => $resource->id, - ], - 200, - Stripe::$connectBase - ); - $resource->deauthorize(); - } - - public function testCanCreateExternalAccount() - { - $this->expectsRequest( - 'post', - '/v1/accounts/' . self::TEST_RESOURCE_ID . '/external_accounts' - ); - $resource = Account::createExternalAccount(self::TEST_RESOURCE_ID, [ - "external_account" => "btok_123", - ]); - $this->assertInstanceOf("Stripe\\BankAccount", $resource); - } - - public function testCanRetrieveExternalAccount() - { - $this->expectsRequest( - 'get', - '/v1/accounts/' . self::TEST_RESOURCE_ID . '/external_accounts/' . self::TEST_EXTERNALACCOUNT_ID - ); - $resource = Account::retrieveExternalAccount(self::TEST_RESOURCE_ID, self::TEST_EXTERNALACCOUNT_ID); - $this->assertInstanceOf("Stripe\\BankAccount", $resource); - } - - public function testCanUpdateExternalAccount() - { - $this->expectsRequest( - 'post', - '/v1/accounts/' . self::TEST_RESOURCE_ID . '/external_accounts/' . self::TEST_EXTERNALACCOUNT_ID - ); - $resource = Account::updateExternalAccount(self::TEST_RESOURCE_ID, self::TEST_EXTERNALACCOUNT_ID, [ - "name" => "name", - ]); - $this->assertInstanceOf("Stripe\\BankAccount", $resource); - } - - public function testCanDeleteExternalAccount() - { - $this->expectsRequest( - 'delete', - '/v1/accounts/' . self::TEST_RESOURCE_ID . '/external_accounts/' . self::TEST_EXTERNALACCOUNT_ID - ); - $resource = Account::deleteExternalAccount(self::TEST_RESOURCE_ID, self::TEST_EXTERNALACCOUNT_ID); - $this->assertTrue($resource->deleted); - } - - public function testCanListExternalAccounts() - { - $this->expectsRequest( - 'get', - '/v1/accounts/' . self::TEST_RESOURCE_ID . '/external_accounts' - ); - $resources = Account::allExternalAccounts(self::TEST_RESOURCE_ID); - $this->assertTrue(is_array($resources->data)); - } - - public function testCanCreateLoginLink() - { - $this->expectsRequest( - 'post', - '/v1/accounts/' . self::TEST_RESOURCE_ID . '/login_links' - ); - $resource = Account::createLoginLink(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\LoginLink", $resource); - } - - public function testSerializeNewAdditionalOwners() - { - $obj = Util\Util::convertToStripeObject([ - 'object' => 'account', - 'legal_entity' => StripeObject::constructFrom([]), - ], null); - $obj->legal_entity->additional_owners = [ - ['first_name' => 'Joe'], - ['first_name' => 'Jane'], - ]; - - $expected = [ - 'legal_entity' => [ - 'additional_owners' => [ - 0 => ['first_name' => 'Joe'], - 1 => ['first_name' => 'Jane'], - ], - ], - ]; - $this->assertSame($expected, $obj->serializeParameters()); - } - - public function testSerializeAddAdditionalOwners() - { - $obj = Util\Util::convertToStripeObject([ - 'object' => 'account', - 'legal_entity' => [ - 'additional_owners' => [ - StripeObject::constructFrom(['first_name' => 'Joe']), - StripeObject::constructFrom(['first_name' => 'Jane']), - ], - ], - ], null); - $obj->legal_entity->additional_owners[2] = ['first_name' => 'Andrew']; - - $expected = [ - 'legal_entity' => [ - 'additional_owners' => [ - 2 => ['first_name' => 'Andrew'], - ], - ], - ]; - $this->assertSame($expected, $obj->serializeParameters()); - } - - public function testSerializePartiallyChangedAdditionalOwners() - { - $obj = Util\Util::convertToStripeObject([ - 'object' => 'account', - 'legal_entity' => [ - 'additional_owners' => [ - StripeObject::constructFrom(['first_name' => 'Joe']), - StripeObject::constructFrom(['first_name' => 'Jane']), - ], - ], - ], null); - $obj->legal_entity->additional_owners[1]->first_name = 'Stripe'; - - $expected = [ - 'legal_entity' => [ - 'additional_owners' => [ - 1 => ['first_name' => 'Stripe'], - ], - ], - ]; - $this->assertSame($expected, $obj->serializeParameters()); - } - - public function testSerializeUnchangedAdditionalOwners() - { - $obj = Util\Util::convertToStripeObject([ - 'object' => 'account', - 'legal_entity' => [ - 'additional_owners' => [ - StripeObject::constructFrom(['first_name' => 'Joe']), - StripeObject::constructFrom(['first_name' => 'Jane']), - ], - ], - ], null); - - $expected = [ - 'legal_entity' => [ - 'additional_owners' => [], - ], - ]; - $this->assertSame($expected, $obj->serializeParameters()); - } - - public function testSerializeUnsetAdditionalOwners() - { - $obj = Util\Util::convertToStripeObject([ - 'object' => 'account', - 'legal_entity' => [ - 'additional_owners' => [ - StripeObject::constructFrom(['first_name' => 'Joe']), - StripeObject::constructFrom(['first_name' => 'Jane']), - ], - ], - ], null); - $obj->legal_entity->additional_owners = null; - - // Note that the empty string that we send for this one has a special - // meaning for the server, which interprets it as an array unset. - $expected = [ - 'legal_entity' => [ - 'additional_owners' => '', - ], - ]; - $this->assertSame($expected, $obj->serializeParameters()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testSerializeAdditionalOwnersDeletedItem() - { - $obj = Util\Util::convertToStripeObject([ - 'object' => 'account', - 'legal_entity' => [ - 'additional_owners' => [ - StripeObject::constructFrom(['first_name' => 'Joe']), - StripeObject::constructFrom(['first_name' => 'Jane']), - ], - ], - ], null); - unset($obj->legal_entity->additional_owners[0]); - - $obj->serializeParameters(); - } - - public function testSerializeExternalAccountString() - { - $obj = Util\Util::convertToStripeObject([ - 'object' => 'account', - ], null); - $obj->external_account = 'btok_123'; - - $expected = [ - 'external_account' => 'btok_123', - ]; - $this->assertSame($expected, $obj->serializeParameters()); - } - - public function testSerializeExternalAccountHash() - { - $obj = Util\Util::convertToStripeObject([ - 'object' => 'account', - ], null); - $obj->external_account = [ - 'object' => 'bank_account', - 'routing_number' => '110000000', - 'account_number' => '000123456789', - 'country' => 'US', - 'currency' => 'usd', - ]; - - $expected = [ - 'external_account' => [ - 'object' => 'bank_account', - 'routing_number' => '110000000', - 'account_number' => '000123456789', - 'country' => 'US', - 'currency' => 'usd', - ], - ]; - $this->assertSame($expected, $obj->serializeParameters()); - } - - public function testSerializeBankAccountString() - { - $obj = Util\Util::convertToStripeObject([ - 'object' => 'account', - ], null); - $obj->bank_account = 'btok_123'; - - $expected = [ - 'bank_account' => 'btok_123', - ]; - $this->assertSame($expected, $obj->serializeParameters()); - } - - public function testSerializeBankAccountHash() - { - $obj = Util\Util::convertToStripeObject([ - 'object' => 'account', - ], null); - $obj->bank_account = [ - 'object' => 'bank_account', - 'routing_number' => '110000000', - 'account_number' => '000123456789', - 'country' => 'US', - 'currency' => 'usd', - ]; - - $expected = [ - 'bank_account' => [ - 'object' => 'bank_account', - 'routing_number' => '110000000', - 'account_number' => '000123456789', - 'country' => 'US', - 'currency' => 'usd', - ], - ]; - $this->assertSame($expected, $obj->serializeParameters()); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/AlipayAccountTest.php b/vendor/stripe/stripe-php/tests/Stripe/AlipayAccountTest.php deleted file mode 100644 index 7159f544..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/AlipayAccountTest.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php - -namespace Stripe; - -class AlipayAccountTest extends TestCase -{ - const TEST_RESOURCE_ID = 'aliacc_123'; - - // Because of the wildcard nature of sources, stripe-mock cannot currently - // reliably return sources of a given type, so we create a fixture manually - public function createFixture($params = []) - { - if (empty($params)) { - $params['customer'] = 'cus_123'; - } - $base = [ - 'id' => self::TEST_RESOURCE_ID, - 'object' => 'card', - 'metadata' => [], - ]; - return AlipayAccount::constructFrom( - array_merge($params, $base), - new Util\RequestOptions() - ); - } - - public function testHasCorrectUrlForCustomer() - { - $resource = $this->createFixture(['customer' => 'cus_123']); - $this->assertSame( - "/v1/customers/cus_123/sources/" . self::TEST_RESOURCE_ID, - $resource->instanceUrl() - ); - } - - /** - * @expectedException \Stripe\Error\InvalidRequest - */ - public function testIsNotDirectlyRetrievable() - { - AlipayAccount::retrieve(self::TEST_RESOURCE_ID); - } - - public function testIsSaveable() - { - $resource = $this->createFixture(); - $resource->metadata["key"] = "value"; - $this->expectsRequest( - 'post', - '/v1/customers/cus_123/sources/' . self::TEST_RESOURCE_ID - ); - $resource->save(); - $this->assertSame("Stripe\\AlipayAccount", get_class($resource)); - } - - /** - * @expectedException \Stripe\Error\InvalidRequest - */ - public function testIsNotDirectlyUpdatable() - { - AlipayAccount::update(self::TEST_RESOURCE_ID, [ - "metadata" => ["key" => "value"], - ]); - } - - public function testIsDeletable() - { - $resource = $this->createFixture(); - $this->expectsRequest( - 'delete', - '/v1/customers/cus_123/sources/' . self::TEST_RESOURCE_ID - ); - $resource->delete(); - $this->assertSame("Stripe\\AlipayAccount", get_class($resource)); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/ApiRequestorTest.php b/vendor/stripe/stripe-php/tests/Stripe/ApiRequestorTest.php deleted file mode 100644 index ae79e566..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/ApiRequestorTest.php +++ /dev/null @@ -1,573 +0,0 @@ -<?php - -namespace Stripe; - -use Stripe\HttpClient\CurlClient; - -class ApiRequestorTest extends TestCase -{ - public function testEncodeObjects() - { - $reflector = new \ReflectionClass('Stripe\\ApiRequestor'); - $method = $reflector->getMethod('_encodeObjects'); - $method->setAccessible(true); - - $a = ['customer' => new Customer('abcd')]; - $enc = $method->invoke(null, $a); - $this->assertSame($enc, ['customer' => 'abcd']); - - // Preserves UTF-8 - $v = ['customer' => "☃"]; - $enc = $method->invoke(null, $v); - $this->assertSame($enc, $v); - - // Encodes latin-1 -> UTF-8 - $v = ['customer' => "\xe9"]; - $enc = $method->invoke(null, $v); - $this->assertSame($enc, ['customer' => "\xc3\xa9"]); - - // Encodes booleans - $v = true; - $enc = $method->invoke(null, $v); - $this->assertSame('true', $enc); - - $v = false; - $enc = $method->invoke(null, $v); - $this->assertSame('false', $enc); - } - - public function testHttpClientInjection() - { - $reflector = new \ReflectionClass('Stripe\\ApiRequestor'); - $method = $reflector->getMethod('httpClient'); - $method->setAccessible(true); - - $curl = new CurlClient(); - $curl->setTimeout(10); - ApiRequestor::setHttpClient($curl); - - $injectedCurl = $method->invoke(new ApiRequestor()); - $this->assertSame($injectedCurl, $curl); - } - - public function testDefaultHeaders() - { - $reflector = new \ReflectionClass('Stripe\\ApiRequestor'); - $method = $reflector->getMethod('_defaultHeaders'); - $method->setAccessible(true); - - // no way to stub static methods with PHPUnit 4.x :( - Stripe::setAppInfo('MyTestApp', '1.2.34', 'https://mytestapp.example', 'partner_1234'); - $apiKey = 'sk_test_notarealkey'; - $clientInfo = ['httplib' => 'testlib 0.1.2']; - - $headers = $method->invoke(null, $apiKey, $clientInfo); - - $ua = json_decode($headers['X-Stripe-Client-User-Agent']); - $this->assertSame($ua->application->name, 'MyTestApp'); - $this->assertSame($ua->application->version, '1.2.34'); - $this->assertSame($ua->application->url, 'https://mytestapp.example'); - $this->assertSame($ua->application->partner_id, 'partner_1234'); - - $this->assertSame($ua->httplib, 'testlib 0.1.2'); - - $this->assertSame( - $headers['User-Agent'], - 'Stripe/v1 PhpBindings/' . Stripe::VERSION . ' MyTestApp/1.2.34 (https://mytestapp.example)' - ); - - $this->assertSame($headers['Authorization'], 'Bearer ' . $apiKey); - } - - /** - * @expectedException \Stripe\Error\Authentication - * @expectedExceptionMessageRegExp #No API key provided# - */ - public function testRaisesAuthenticationErrorWhenNoApiKey() - { - Stripe::setApiKey(null); - Charge::create(); - } - - public function testRaisesInvalidRequestErrorOn400() - { - $this->stubRequest( - 'POST', - '/v1/charges', - [], - null, - false, - [ - 'error' => [ - 'type' => 'invalid_request_error', - 'message' => 'Missing id', - 'param' => 'id', - ], - ], - 400 - ); - - try { - Charge::create(); - $this->fail("Did not raise error"); - } catch (Error\InvalidRequest $e) { - $this->assertSame(400, $e->getHttpStatus()); - $this->assertTrue(is_array($e->getJsonBody())); - $this->assertSame('Missing id', $e->getMessage()); - $this->assertSame('id', $e->getStripeParam()); - } catch (\Exception $e) { - $this->fail("Unexpected exception: " . get_class($e)); - } - } - - public function testRaisesIdempotencyErrorOn400AndTypeIdempotencyError() - { - $this->stubRequest( - 'POST', - '/v1/charges', - array(), - null, - false, - array( - 'error' => array( - 'type' => 'idempotency_error', - 'message' => "Keys for idempotent requests can only be used with the same parameters they were first used with. Try using a key other than 'abc' if you meant to execute a different request.", - ), - ), - 400 - ); - - try { - Charge::create(); - $this->fail("Did not raise error"); - } catch (Error\Idempotency $e) { - $this->assertSame(400, $e->getHttpStatus()); - $this->assertTrue(is_array($e->getJsonBody())); - $this->assertSame("Keys for idempotent requests can only be used with the same parameters they were first used with. Try using a key other than 'abc' if you meant to execute a different request.", $e->getMessage()); - } catch (\Exception $e) { - $this->fail("Unexpected exception: " . get_class($e)); - } - } - - public function testRaisesAuthenticationErrorOn401() - { - $this->stubRequest( - 'POST', - '/v1/charges', - [], - null, - false, - [ - 'error' => [ - 'type' => 'invalid_request_error', - 'message' => 'You did not provide an API key.', - ], - ], - 401 - ); - - try { - Charge::create(); - $this->fail("Did not raise error"); - } catch (Error\Authentication $e) { - $this->assertSame(401, $e->getHttpStatus()); - $this->assertTrue(is_array($e->getJsonBody())); - $this->assertSame('You did not provide an API key.', $e->getMessage()); - } catch (\Exception $e) { - $this->fail("Unexpected exception: " . get_class($e)); - } - } - - public function testRaisesCardErrorOn402() - { - $this->stubRequest( - 'POST', - '/v1/charges', - [], - null, - false, - [ - 'error' => [ - 'type' => 'card_error', - 'message' => 'Your card was declined.', - 'code' => 'card_declined', - 'decline_code' => 'generic_decline', - 'charge' => 'ch_declined_charge', - 'param' => 'exp_month', - ], - ], - 402 - ); - - try { - Charge::create(); - $this->fail("Did not raise error"); - } catch (Error\Card $e) { - $this->assertSame(402, $e->getHttpStatus()); - $this->assertTrue(is_array($e->getJsonBody())); - $this->assertSame('Your card was declined.', $e->getMessage()); - $this->assertSame('card_declined', $e->getStripeCode()); - $this->assertSame('generic_decline', $e->getDeclineCode()); - $this->assertSame('exp_month', $e->getStripeParam()); - } catch (\Exception $e) { - $this->fail("Unexpected exception: " . get_class($e)); - } - } - - public function testRaisesPermissionErrorOn403() - { - $this->stubRequest( - 'GET', - '/v1/accounts/foo', - [], - null, - false, - [ - 'error' => [ - 'type' => 'invalid_request_error', - 'message' => "The provided key 'sk_test_********************1234' does not have access to account 'foo' (or that account does not exist). Application access may have been revoked.", - ], - ], - 403 - ); - - try { - Account::retrieve('foo'); - $this->fail("Did not raise error"); - } catch (Error\Permission $e) { - $this->assertSame(403, $e->getHttpStatus()); - $this->assertTrue(is_array($e->getJsonBody())); - $this->assertSame("The provided key 'sk_test_********************1234' does not have access to account 'foo' (or that account does not exist). Application access may have been revoked.", $e->getMessage()); - } catch (\Exception $e) { - $this->fail("Unexpected exception: " . get_class($e)); - } - } - - public function testRaisesInvalidRequestErrorOn404() - { - $this->stubRequest( - 'GET', - '/v1/charges/foo', - [], - null, - false, - [ - 'error' => [ - 'type' => 'invalid_request_error', - 'message' => 'No such charge: foo', - 'param' => 'id', - ], - ], - 404 - ); - - try { - Charge::retrieve('foo'); - $this->fail("Did not raise error"); - } catch (Error\InvalidRequest $e) { - $this->assertSame(404, $e->getHttpStatus()); - $this->assertTrue(is_array($e->getJsonBody())); - $this->assertSame('No such charge: foo', $e->getMessage()); - $this->assertSame('id', $e->getStripeParam()); - } catch (\Exception $e) { - $this->fail("Unexpected exception: " . get_class($e)); - } - } - - public function testRaisesRateLimitErrorOn429() - { - $this->stubRequest( - 'POST', - '/v1/charges', - [], - null, - false, - [ - 'error' => [ - 'message' => 'Too many requests', - ], - ], - 429 - ); - - try { - Charge::create(); - $this->fail("Did not raise error"); - } catch (Error\RateLimit $e) { - $this->assertSame(429, $e->getHttpStatus()); - $this->assertTrue(is_array($e->getJsonBody())); - $this->assertSame('Too many requests', $e->getMessage()); - } catch (\Exception $e) { - $this->fail("Unexpected exception: " . get_class($e)); - } - } - - public function testRaisesRateLimitErrorOn400AndCodeRateLimit() - { - $this->stubRequest( - 'POST', - '/v1/charges', - [], - null, - false, - [ - 'error' => [ - 'code' => 'rate_limit', - 'message' => 'Too many requests', - ], - ], - 400 - ); - - try { - Charge::create(); - $this->fail("Did not raise error"); - } catch (Error\RateLimit $e) { - $this->assertSame(400, $e->getHttpStatus()); - $this->assertTrue(is_array($e->getJsonBody())); - $this->assertSame('Too many requests', $e->getMessage()); - } catch (\Exception $e) { - $this->fail("Unexpected exception: " . get_class($e)); - } - } - - public function testRaisesOAuthInvalidRequestError() - { - $this->stubRequest( - 'POST', - '/oauth/token', - [], - null, - false, - [ - 'error' => 'invalid_request', - 'error_description' => 'No grant type specified', - ], - 400, - Stripe::$connectBase - ); - - try { - OAuth::token(); - $this->fail("Did not raise error"); - } catch (Error\OAuth\InvalidRequest $e) { - $this->assertSame(400, $e->getHttpStatus()); - $this->assertSame('invalid_request', $e->getErrorCode()); - $this->assertSame('No grant type specified', $e->getMessage()); - } catch (\Exception $e) { - $this->fail("Unexpected exception: " . get_class($e)); - } - } - - public function testRaisesOAuthInvalidClientError() - { - $this->stubRequest( - 'POST', - '/oauth/token', - [], - null, - false, - [ - 'error' => 'invalid_client', - 'error_description' => 'No authentication was provided. Send your secret API key using the Authorization header, or as a client_secret POST parameter.', - ], - 401, - Stripe::$connectBase - ); - - try { - OAuth::token(); - $this->fail("Did not raise error"); - } catch (Error\OAuth\InvalidClient $e) { - $this->assertSame(401, $e->getHttpStatus()); - $this->assertSame('invalid_client', $e->getErrorCode()); - $this->assertSame('No authentication was provided. Send your secret API key using the Authorization header, or as a client_secret POST parameter.', $e->getMessage()); - } catch (\Exception $e) { - $this->fail("Unexpected exception: " . get_class($e)); - } - } - - public function testRaisesOAuthInvalidGrantError() - { - $this->stubRequest( - 'POST', - '/oauth/token', - [], - null, - false, - [ - 'error' => 'invalid_grant', - 'error_description' => 'This authorization code has already been used. All tokens issued with this code have been revoked.', - ], - 400, - Stripe::$connectBase - ); - - try { - OAuth::token(); - $this->fail("Did not raise error"); - } catch (Error\OAuth\InvalidGrant $e) { - $this->assertSame(400, $e->getHttpStatus()); - $this->assertSame('invalid_grant', $e->getErrorCode()); - $this->assertSame('This authorization code has already been used. All tokens issued with this code have been revoked.', $e->getMessage()); - } catch (\Exception $e) { - $this->fail("Unexpected exception: " . get_class($e)); - } - } - - public function testRaisesOAuthInvalidScopeError() - { - $this->stubRequest( - 'POST', - '/oauth/token', - [], - null, - false, - [ - 'error' => 'invalid_scope', - 'error_description' => 'Invalid scope provided: invalid_scope.', - ], - 400, - Stripe::$connectBase - ); - - try { - OAuth::token(); - $this->fail("Did not raise error"); - } catch (Error\OAuth\InvalidScope $e) { - $this->assertSame(400, $e->getHttpStatus()); - $this->assertSame('invalid_scope', $e->getErrorCode()); - $this->assertSame('Invalid scope provided: invalid_scope.', $e->getMessage()); - } catch (\Exception $e) { - $this->fail("Unexpected exception: " . get_class($e)); - } - } - - public function testRaisesOAuthUnsupportedGrantTypeError() - { - $this->stubRequest( - 'POST', - '/oauth/token', - [], - null, - false, - [ - 'error' => 'unsupported_grant_type', - ], - 400, - Stripe::$connectBase - ); - - try { - OAuth::token(); - $this->fail("Did not raise error"); - } catch (Error\OAuth\UnsupportedGrantType $e) { - $this->assertSame(400, $e->getHttpStatus()); - $this->assertSame('unsupported_grant_type', $e->getErrorCode()); - } catch (\Exception $e) { - $this->fail("Unexpected exception: " . get_class($e)); - } - } - - public function testRaisesOAuthUnsupportedResponseTypeError() - { - $this->stubRequest( - 'POST', - '/oauth/token', - [], - null, - false, - [ - 'error' => 'unsupported_response_type', - 'error_description' => "Only 'code' response_type is supported, but 'unsupported_response_type' was provided", - ], - 400, - Stripe::$connectBase - ); - - try { - OAuth::token(); - $this->fail("Did not raise error"); - } catch (Error\OAuth\UnsupportedResponseType $e) { - $this->assertSame(400, $e->getHttpStatus()); - $this->assertSame('unsupported_response_type', $e->getErrorCode()); - $this->assertSame("Only 'code' response_type is supported, but 'unsupported_response_type' was provided", $e->getMessage()); - } catch (\Exception $e) { - $this->fail("Unexpected exception: " . get_class($e)); - } - } - - public function testHeaderStripeVersionGlobal() - { - Stripe::setApiVersion('2222-22-22'); - $this->stubRequest( - 'POST', - '/v1/charges', - [], - [ - 'Stripe-Version: 2222-22-22', - ], - false, - [ - 'id' => 'ch_123', - 'object' => 'charge', - ] - ); - Charge::create(); - } - - public function testHeaderStripeVersionRequestOptions() - { - $this->stubRequest( - 'POST', - '/v1/charges', - [], - [ - 'Stripe-Version: 2222-22-22', - ], - false, - [ - 'id' => 'ch_123', - 'object' => 'charge', - ] - ); - Charge::create([], ['stripe_version' => '2222-22-22']); - } - - public function testHeaderStripeAccountGlobal() - { - Stripe::setAccountId('acct_123'); - $this->stubRequest( - 'POST', - '/v1/charges', - [], - [ - 'Stripe-Account: acct_123', - ], - false, - [ - 'id' => 'ch_123', - 'object' => 'charge', - ] - ); - Charge::create(); - } - - public function testHeaderStripeAccountRequestOptions() - { - $this->stubRequest( - 'POST', - '/v1/charges', - [], - [ - 'Stripe-Account: acct_123', - ], - false, - [ - 'id' => 'ch_123', - 'object' => 'charge', - ] - ); - Charge::create([], ['stripe_account' => 'acct_123']); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/ApplePayDomainTest.php b/vendor/stripe/stripe-php/tests/Stripe/ApplePayDomainTest.php deleted file mode 100644 index d033f55c..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/ApplePayDomainTest.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php - -namespace Stripe; - -class ApplePayDomainTest extends TestCase -{ - const TEST_RESOURCE_ID = 'apwc_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/apple_pay/domains' - ); - $resources = ApplePayDomain::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\ApplePayDomain", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/apple_pay/domains/' . self::TEST_RESOURCE_ID - ); - $resource = ApplePayDomain::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\ApplePayDomain", $resource); - } - - public function testIsCreatable() - { - $this->expectsRequest( - 'post', - '/v1/apple_pay/domains' - ); - $resource = ApplePayDomain::create([ - "domain_name" => "domain", - ]); - $this->assertInstanceOf("Stripe\\ApplePayDomain", $resource); - } - - public function testIsDeletable() - { - $resource = ApplePayDomain::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'delete', - '/v1/apple_pay/domains/' . $resource->id - ); - $resource->delete(); - $this->assertInstanceOf("Stripe\\ApplePayDomain", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/ApplicationFeeRefundTest.php b/vendor/stripe/stripe-php/tests/Stripe/ApplicationFeeRefundTest.php deleted file mode 100644 index 9af059ff..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/ApplicationFeeRefundTest.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -namespace Stripe; - -class ApplicationFeeRefundTest extends TestCase -{ - const TEST_RESOURCE_ID = 'fr_123'; - const TEST_FEE_ID = 'fee_123'; - - public function testIsSaveable() - { - $resource = ApplicationFee::retrieveRefund(self::TEST_FEE_ID, self::TEST_RESOURCE_ID); - $resource->metadata["key"] = "value"; - $this->expectsRequest( - 'post', - '/v1/application_fees/' . $resource->fee . '/refunds/' . $resource->id - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\ApplicationFeeRefund", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/ApplicationFeeTest.php b/vendor/stripe/stripe-php/tests/Stripe/ApplicationFeeTest.php deleted file mode 100644 index 66e007ff..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/ApplicationFeeTest.php +++ /dev/null @@ -1,83 +0,0 @@ -<?php - -namespace Stripe; - -class ApplicationFeeTest extends TestCase -{ - const TEST_RESOURCE_ID = 'fee_123'; - const TEST_FEEREFUND_ID = 'fr_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/application_fees' - ); - $resources = ApplicationFee::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\ApplicationFee", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/application_fees/' . self::TEST_RESOURCE_ID - ); - $resource = ApplicationFee::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\ApplicationFee", $resource); - } - - public function testIsRefundable() - { - $fee = ApplicationFee::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'post', - '/v1/application_fees/' . $fee->id . '/refunds' - ); - $resource = $fee->refund(); - $this->assertInstanceOf("Stripe\\ApplicationFee", $resource); - $this->assertSame($resource, $fee); - } - - public function testCanCreateRefund() - { - $this->expectsRequest( - 'post', - '/v1/application_fees/' . self::TEST_RESOURCE_ID . '/refunds' - ); - $resource = ApplicationFee::createRefund(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\ApplicationFeeRefund", $resource); - } - - public function testCanRetrieveRefund() - { - $this->expectsRequest( - 'get', - '/v1/application_fees/' . self::TEST_RESOURCE_ID . '/refunds/' . self::TEST_FEEREFUND_ID - ); - $resource = ApplicationFee::retrieveRefund(self::TEST_RESOURCE_ID, self::TEST_FEEREFUND_ID); - $this->assertInstanceOf("Stripe\\ApplicationFeeRefund", $resource); - } - - public function testCanUpdateRefund() - { - $this->expectsRequest( - 'post', - '/v1/application_fees/' . self::TEST_RESOURCE_ID . '/refunds/' . self::TEST_FEEREFUND_ID - ); - $resource = ApplicationFee::updateRefund(self::TEST_RESOURCE_ID, self::TEST_FEEREFUND_ID); - $this->assertInstanceOf("Stripe\\ApplicationFeeRefund", $resource); - } - - public function testCanListRefunds() - { - $this->expectsRequest( - 'get', - '/v1/application_fees/' . self::TEST_RESOURCE_ID . '/refunds' - ); - $resources = ApplicationFee::allRefunds(self::TEST_RESOURCE_ID); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\ApplicationFeeRefund", $resources->data[0]); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/BalanceTest.php b/vendor/stripe/stripe-php/tests/Stripe/BalanceTest.php deleted file mode 100644 index ccbdbdfb..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/BalanceTest.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Stripe; - -class BalanceTest extends TestCase -{ - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/balance' - ); - $resource = Balance::retrieve(); - $this->assertInstanceOf("Stripe\\Balance", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/BalanceTransactionTest.php b/vendor/stripe/stripe-php/tests/Stripe/BalanceTransactionTest.php deleted file mode 100644 index 8785e859..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/BalanceTransactionTest.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Stripe; - -class BalanceTransactionTest extends TestCase -{ - const TEST_RESOURCE_ID = 'txn_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/balance/history' - ); - $resources = BalanceTransaction::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\BalanceTransaction", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/balance/history/' . self::TEST_RESOURCE_ID - ); - $resource = BalanceTransaction::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\BalanceTransaction", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/BankAccountTest.php b/vendor/stripe/stripe-php/tests/Stripe/BankAccountTest.php deleted file mode 100644 index ab1dff9d..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/BankAccountTest.php +++ /dev/null @@ -1,99 +0,0 @@ -<?php - -namespace Stripe; - -class BankAccountTest extends TestCase -{ - const TEST_RESOURCE_ID = 'ba_123'; - - // Because of the wildcard nature of sources, stripe-mock cannot currently - // reliably return sources of a given type, so we create a fixture manually - public function createFixture($params = []) - { - if (empty($params)) { - $params['customer'] = 'cus_123'; - } - $base = [ - 'id' => self::TEST_RESOURCE_ID, - 'object' => 'bank_account', - 'metadata' => [], - ]; - return BankAccount::constructFrom( - array_merge($params, $base), - new Util\RequestOptions() - ); - } - - public function testHasCorrectUrlForCustomer() - { - $resource = $this->createFixture(['customer' => 'cus_123']); - $this->assertSame( - "/v1/customers/cus_123/sources/" . self::TEST_RESOURCE_ID, - $resource->instanceUrl() - ); - } - - public function testHasCorrectUrlForAccount() - { - $resource = $this->createFixture(['account' => 'acct_123']); - $this->assertSame( - "/v1/accounts/acct_123/external_accounts/" . self::TEST_RESOURCE_ID, - $resource->instanceUrl() - ); - } - - /** - * @expectedException \Stripe\Error\InvalidRequest - */ - public function testIsNotDirectlyRetrievable() - { - BankAccount::retrieve(self::TEST_RESOURCE_ID); - } - - public function testIsSaveable() - { - $resource = $this->createFixture(); - $resource->metadata["key"] = "value"; - $this->expectsRequest( - 'post', - '/v1/customers/cus_123/sources/' . self::TEST_RESOURCE_ID - ); - $resource->save(); - $this->assertSame("Stripe\\BankAccount", get_class($resource)); - } - - /** - * @expectedException \Stripe\Error\InvalidRequest - */ - public function testIsNotDirectlyUpdatable() - { - BankAccount::update(self::TEST_RESOURCE_ID, [ - "metadata" => ["key" => "value"], - ]); - } - - public function testIsDeletable() - { - $resource = $this->createFixture(); - $this->expectsRequest( - 'delete', - '/v1/customers/cus_123/sources/' . self::TEST_RESOURCE_ID - ); - $resource->delete(); - $this->assertSame("Stripe\\BankAccount", get_class($resource)); - } - - public function testIsVerifiable() - { - $resource = $this->createFixture(); - $this->expectsRequest( - 'post', - '/v1/customers/cus_123/sources/' . self::TEST_RESOURCE_ID . "/verify", - [ - "amounts" => [1, 2] - ] - ); - $resource->verify(["amounts" => [1, 2]]); - $this->assertInstanceOf("Stripe\\BankAccount", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/BitcoinReceiverTest.php b/vendor/stripe/stripe-php/tests/Stripe/BitcoinReceiverTest.php deleted file mode 100644 index cea999fc..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/BitcoinReceiverTest.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php - -namespace Stripe; - -class BitcoinReceiverTest extends TestCase -{ - const TEST_RESOURCE_ID = 'btcrcv_123'; - - // Because of the wildcard nature of sources, stripe-mock cannot currently - // reliably return sources of a given type, so we create a fixture manually - public function createFixture($params = []) - { - $base = [ - 'id' => self::TEST_RESOURCE_ID, - 'object' => 'bitcoin_receiver', - 'metadata' => [], - ]; - return BitcoinReceiver::constructFrom( - array_merge($params, $base), - new Util\RequestOptions() - ); - } - - public function testHasCorrectStandaloneUrl() - { - $resource = $this->createFixture(); - $this->assertSame( - "/v1/bitcoin/receivers/" . self::TEST_RESOURCE_ID, - $resource->instanceUrl() - ); - } - - public function testHasCorrectUrlForCustomer() - { - $resource = $this->createFixture(['customer' => 'cus_123']); - $this->assertSame( - "/v1/customers/cus_123/sources/" . self::TEST_RESOURCE_ID, - $resource->instanceUrl() - ); - } - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/bitcoin/receivers' - ); - $resources = BitcoinReceiver::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertSame("Stripe\\BitcoinReceiver", get_class($resources->data[0])); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/bitcoin/receivers/' . self::TEST_RESOURCE_ID - ); - $resource = BitcoinReceiver::retrieve(self::TEST_RESOURCE_ID); - $this->assertSame("Stripe\\BitcoinReceiver", get_class($resource)); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/CardTest.php b/vendor/stripe/stripe-php/tests/Stripe/CardTest.php deleted file mode 100644 index 8976eff6..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/CardTest.php +++ /dev/null @@ -1,94 +0,0 @@ -<?php - -namespace Stripe; - -class CardTest extends TestCase -{ - const TEST_RESOURCE_ID = 'card_123'; - - // Because of the wildcard nature of sources, stripe-mock cannot currently - // reliably return sources of a given type, so we create a fixture manually - public function createFixture($params = []) - { - if (empty($params)) { - $params['customer'] = 'cus_123'; - } - $base = [ - 'id' => self::TEST_RESOURCE_ID, - 'object' => 'card', - 'metadata' => [], - ]; - return Card::constructFrom( - array_merge($params, $base), - new Util\RequestOptions() - ); - } - - public function testHasCorrectUrlForCustomer() - { - $resource = $this->createFixture(['customer' => 'cus_123']); - $this->assertSame( - "/v1/customers/cus_123/sources/" . self::TEST_RESOURCE_ID, - $resource->instanceUrl() - ); - } - - public function testHasCorrectUrlForAccount() - { - $resource = $this->createFixture(['account' => 'acct_123']); - $this->assertSame( - "/v1/accounts/acct_123/external_accounts/" . self::TEST_RESOURCE_ID, - $resource->instanceUrl() - ); - } - - public function testHasCorrectUrlForRecipient() - { - $resource = $this->createFixture(['recipient' => 'rp_123']); - $this->assertSame( - "/v1/recipients/rp_123/cards/" . self::TEST_RESOURCE_ID, - $resource->instanceUrl() - ); - } - - /** - * @expectedException \Stripe\Error\InvalidRequest - */ - public function testIsNotDirectlyRetrievable() - { - Card::retrieve(self::TEST_RESOURCE_ID); - } - - public function testIsSaveable() - { - $resource = $this->createFixture(); - $resource->metadata["key"] = "value"; - $this->expectsRequest( - 'post', - '/v1/customers/cus_123/sources/' . self::TEST_RESOURCE_ID - ); - $resource->save(); - $this->assertSame("Stripe\\Card", get_class($resource)); - } - - /** - * @expectedException \Stripe\Error\InvalidRequest - */ - public function testIsNotDirectlyUpdatable() - { - Card::update(self::TEST_RESOURCE_ID, [ - "metadata" => ["key" => "value"], - ]); - } - - public function testIsDeletable() - { - $resource = $this->createFixture(); - $this->expectsRequest( - 'delete', - '/v1/customers/cus_123/sources/' . self::TEST_RESOURCE_ID - ); - $resource->delete(); - $this->assertSame("Stripe\\Card", get_class($resource)); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/ChargeTest.php b/vendor/stripe/stripe-php/tests/Stripe/ChargeTest.php deleted file mode 100644 index b8c6cbab..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/ChargeTest.php +++ /dev/null @@ -1,140 +0,0 @@ -<?php - -namespace Stripe; - -class ChargeTest extends TestCase -{ - const TEST_RESOURCE_ID = 'ch_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/charges' - ); - $resources = Charge::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Charge", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/charges/' . self::TEST_RESOURCE_ID - ); - $resource = Charge::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Charge", $resource); - } - - public function testIsCreatable() - { - $this->expectsRequest( - 'post', - '/v1/charges' - ); - $resource = Charge::create([ - "amount" => 100, - "currency" => "usd", - "source" => "tok_123" - ]); - $this->assertInstanceOf("Stripe\\Charge", $resource); - } - - public function testIsSaveable() - { - $resource = Charge::retrieve(self::TEST_RESOURCE_ID); - $resource->metadata["key"] = "value"; - $this->expectsRequest( - 'post', - '/v1/charges/' . $resource->id - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\Charge", $resource); - } - - public function testIsUpdatable() - { - $this->expectsRequest( - 'post', - '/v1/charges/' . self::TEST_RESOURCE_ID - ); - $resource = Charge::update(self::TEST_RESOURCE_ID, [ - "metadata" => ["key" => "value"], - ]); - $this->assertInstanceOf("Stripe\\Charge", $resource); - } - - public function testCanRefund() - { - $charge = Charge::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'post', - '/v1/charges/' . $charge->id . '/refund' - ); - $resource = $charge->refund(); - $this->assertInstanceOf("Stripe\\Charge", $resource); - $this->assertSame($resource, $charge); - } - - public function testCanCapture() - { - $charge = Charge::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'post', - '/v1/charges/' . $charge->id . '/capture' - ); - $resource = $charge->capture(); - $this->assertInstanceOf("Stripe\\Charge", $resource); - $this->assertSame($resource, $charge); - } - - public function testCanUpdateDispute() - { - $charge = Charge::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'post', - '/v1/charges/' . $charge->id . '/dispute' - ); - $resource = $charge->updateDispute(); - $this->assertInstanceOf("Stripe\\Dispute", $resource); - } - - public function testCanCloseDispute() - { - $charge = Charge::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'post', - '/v1/charges/' . $charge->id . '/dispute/close' - ); - $resource = $charge->closeDispute(); - $this->assertInstanceOf("Stripe\\Charge", $resource); - $this->assertSame($resource, $charge); - } - - public function testCanMarkAsFraudulent() - { - $charge = Charge::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'post', - '/v1/charges/' . $charge->id, - ['fraud_details' => ['user_report' => 'fraudulent']] - ); - $resource = $charge->markAsFraudulent(); - $this->assertInstanceOf("Stripe\\Charge", $resource); - $this->assertSame($resource, $charge); - } - - public function testCanMarkAsSafe() - { - $charge = Charge::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'post', - '/v1/charges/' . $charge->id, - ['fraud_details' => ['user_report' => 'safe']] - ); - $resource = $charge->markAsSafe(); - $this->assertInstanceOf("Stripe\\Charge", $resource); - $this->assertSame($resource, $charge); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/CollectionTest.php b/vendor/stripe/stripe-php/tests/Stripe/CollectionTest.php deleted file mode 100644 index 560085ae..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/CollectionTest.php +++ /dev/null @@ -1,147 +0,0 @@ -<?php - -namespace Stripe; - -class CollectionTest extends TestCase -{ - /** - * @before - */ - public function setUpFixture() - { - $this->fixture = Collection::constructFrom([ - 'data' => [['id' => 1]], - 'has_more' => true, - 'url' => '/things', - ]); - } - - public function testCanList() - { - $this->stubRequest( - 'GET', - '/things', - [], - null, - false, - [ - 'data' => [['id' => 1]], - 'has_more' => true, - 'url' => '/things', - ] - ); - - $resources = $this->fixture->all(); - $this->assertTrue(is_array($resources->data)); - } - - public function testCanRetrieve() - { - $this->stubRequest( - 'GET', - '/things/1', - [], - null, - false, - [ - 'id' => 1, - ] - ); - - $this->fixture->retrieve(1); - } - - public function testCanCreate() - { - $this->stubRequest( - 'POST', - '/things', - [ - 'foo' => 'bar', - ], - null, - false, - [ - 'id' => 2, - ] - ); - - $this->fixture->create([ - 'foo' => 'bar', - ]); - } - - public function testProvidesAutoPagingIterator() - { - $this->stubRequest( - 'GET', - '/things', - [ - 'starting_after' => 1, - ], - null, - false, - [ - 'data' => [['id' => 2], ['id' => 3]], - 'has_more' => false, - ] - ); - - $seen = []; - foreach ($this->fixture->autoPagingIterator() as $item) { - array_push($seen, $item['id']); - } - - $this->assertSame([1, 2, 3], $seen); - } - - public function testSupportsIteratorToArray() - { - $this->stubRequest( - 'GET', - '/things', - [ - 'starting_after' => 1, - ], - null, - false, - [ - 'data' => [['id' => 2], ['id' => 3]], - 'has_more' => false, - ] - ); - - $seen = []; - foreach (iterator_to_array($this->fixture->autoPagingIterator()) as $item) { - array_push($seen, $item['id']); - } - - $this->assertSame([1, 2, 3], $seen); - } - - public function testHeaders() - { - $this->stubRequest( - 'POST', - '/things', - [ - 'foo' => 'bar', - ], - [ - 'Stripe-Account: acct_foo', - 'Idempotency-Key: qwertyuiop', - ], - false, - [ - 'id' => 2, - ] - ); - - $this->fixture->create([ - 'foo' => 'bar', - ], [ - 'stripe_account' => 'acct_foo', - 'idempotency_key' => 'qwertyuiop', - ]); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/CountrySpecTest.php b/vendor/stripe/stripe-php/tests/Stripe/CountrySpecTest.php deleted file mode 100644 index cccd4116..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/CountrySpecTest.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Stripe; - -class CountrySpecTest extends TestCase -{ - const TEST_RESOURCE_ID = 'US'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/country_specs' - ); - $resources = CountrySpec::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\CountrySpec", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/country_specs/' . self::TEST_RESOURCE_ID - ); - $resource = CountrySpec::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\CountrySpec", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/CouponTest.php b/vendor/stripe/stripe-php/tests/Stripe/CouponTest.php deleted file mode 100644 index 8a6fbf63..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/CouponTest.php +++ /dev/null @@ -1,79 +0,0 @@ -<?php - -namespace Stripe; - -class CouponTest extends TestCase -{ - const TEST_RESOURCE_ID = '25OFF'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/coupons' - ); - $resources = Coupon::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Coupon", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/coupons/' . self::TEST_RESOURCE_ID - ); - $resource = Coupon::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Coupon", $resource); - } - - public function testIsCreatable() - { - $this->expectsRequest( - 'post', - '/v1/coupons' - ); - $resource = Coupon::create([ - "percent_off" => 25, - "duration" => "repeating", - "duration_in_months" => 3, - "id" => self::TEST_RESOURCE_ID, - ]); - $this->assertInstanceOf("Stripe\\Coupon", $resource); - } - - public function testIsSaveable() - { - $resource = Coupon::retrieve(self::TEST_RESOURCE_ID); - $resource->metadata["key"] = "value"; - $this->expectsRequest( - 'post', - '/v1/coupons/' . self::TEST_RESOURCE_ID - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\Coupon", $resource); - } - - public function testIsUpdatable() - { - $this->expectsRequest( - 'post', - '/v1/coupons/' . self::TEST_RESOURCE_ID - ); - $resource = Coupon::update(self::TEST_RESOURCE_ID, [ - "metadata" => ["key" => "value"], - ]); - $this->assertInstanceOf("Stripe\\Coupon", $resource); - } - - public function testIsDeletable() - { - $resource = Coupon::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'delete', - '/v1/coupons/' . self::TEST_RESOURCE_ID - ); - $resource->delete(); - $this->assertInstanceOf("Stripe\\Coupon", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/CustomerTest.php b/vendor/stripe/stripe-php/tests/Stripe/CustomerTest.php deleted file mode 100644 index e279e548..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/CustomerTest.php +++ /dev/null @@ -1,269 +0,0 @@ -<?php - -namespace Stripe; - -class CustomerTest extends TestCase -{ - const TEST_RESOURCE_ID = 'cus_123'; - const TEST_SOURCE_ID = 'ba_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/customers' - ); - $resources = Customer::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Customer", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/customers/' . self::TEST_RESOURCE_ID - ); - $resource = Customer::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Customer", $resource); - } - - public function testIsCreatable() - { - $this->expectsRequest( - 'post', - '/v1/customers' - ); - $resource = Customer::create(); - $this->assertInstanceOf("Stripe\\Customer", $resource); - } - - public function testIsSaveable() - { - $resource = Customer::retrieve(self::TEST_RESOURCE_ID); - $resource->metadata["key"] = "value"; - $this->expectsRequest( - 'post', - '/v1/customers/' . $resource->id - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\Customer", $resource); - } - - public function testIsUpdatable() - { - $this->expectsRequest( - 'post', - '/v1/customers/' . self::TEST_RESOURCE_ID - ); - $resource = Customer::update(self::TEST_RESOURCE_ID, [ - "metadata" => ["key" => "value"], - ]); - $this->assertInstanceOf("Stripe\\Customer", $resource); - } - - public function testIsDeletable() - { - $resource = Customer::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'delete', - '/v1/customers/' . $resource->id - ); - $resource->delete(); - $this->assertInstanceOf("Stripe\\Customer", $resource); - } - - public function testCanAddInvoiceItem() - { - $customer = Customer::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'post', - '/v1/invoiceitems', - [ - "amount" => 100, - "currency" => "usd", - "customer" => $customer->id - ] - ); - $resource = $customer->addInvoiceItem([ - "amount" => 100, - "currency" => "usd" - ]); - $this->assertInstanceOf("Stripe\\InvoiceItem", $resource); - } - - public function testCanListInvoices() - { - $customer = Customer::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'get', - '/v1/invoices', - ["customer" => $customer->id] - ); - $resources = $customer->invoices(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Invoice", $resources->data[0]); - } - - public function testCanListInvoiceItems() - { - $customer = Customer::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'get', - '/v1/invoiceitems', - ["customer" => $customer->id] - ); - $resources = $customer->invoiceItems(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\InvoiceItem", $resources->data[0]); - } - - public function testCanListCharges() - { - $customer = Customer::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'get', - '/v1/charges', - ["customer" => $customer->id] - ); - $resources = $customer->charges(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Charge", $resources->data[0]); - } - - public function testCanUpdateSubscription() - { - $customer = Customer::retrieve(self::TEST_RESOURCE_ID); - $this->stubRequest( - 'post', - '/v1/customers/' . $customer->id . '/subscription', - ["plan" => "plan"], - null, - false, - [ - "object" => "subscription", - "id" => "sub_foo" - ] - ); - $resource = $customer->updateSubscription(["plan" => "plan"]); - $this->assertInstanceOf("Stripe\\Subscription", $resource); - $this->assertSame("sub_foo", $customer->subscription->id); - } - - public function testCanCancelSubscription() - { - $customer = Customer::retrieve(self::TEST_RESOURCE_ID); - $this->stubRequest( - 'delete', - '/v1/customers/' . $customer->id . '/subscription', - [], - null, - false, - [ - "object" => "subscription", - "id" => "sub_foo" - ] - ); - $resource = $customer->cancelSubscription(); - $this->assertInstanceOf("Stripe\\Subscription", $resource); - $this->assertSame("sub_foo", $customer->subscription->id); - } - - public function testCanDeleteDiscount() - { - $customer = Customer::retrieve(self::TEST_RESOURCE_ID); - $this->stubRequest( - 'delete', - '/v1/customers/' . $customer->id . '/discount' - ); - $customer->deleteDiscount(); - $this->assertSame($customer->discount, null); - } - - public function testCanCreateSource() - { - $this->expectsRequest( - 'post', - '/v1/customers/' . self::TEST_RESOURCE_ID . '/sources' - ); - $resource = Customer::createSource(self::TEST_RESOURCE_ID, ["source" => "btok_123"]); - $this->assertInstanceOf("Stripe\\BankAccount", $resource); - } - - public function testCanRetrieveSource() - { - $this->expectsRequest( - 'get', - '/v1/customers/' . self::TEST_RESOURCE_ID . '/sources/' . self::TEST_SOURCE_ID - ); - $resource = Customer::retrieveSource(self::TEST_RESOURCE_ID, self::TEST_SOURCE_ID); - $this->assertInstanceOf("Stripe\\BankAccount", $resource); - } - - public function testCanUpdateSource() - { - $this->expectsRequest( - 'post', - '/v1/customers/' . self::TEST_RESOURCE_ID . '/sources/' . self::TEST_SOURCE_ID - ); - $resource = Customer::updateSource(self::TEST_RESOURCE_ID, self::TEST_SOURCE_ID, ["name" => "name"]); - // stripe-mock returns a Card on this method and not a bank account - $this->assertInstanceOf("Stripe\\Card", $resource); - } - - public function testCanDeleteSource() - { - $this->expectsRequest( - 'delete', - '/v1/customers/' . self::TEST_RESOURCE_ID . '/sources/' . self::TEST_SOURCE_ID - ); - $resource = Customer::deleteSource(self::TEST_RESOURCE_ID, self::TEST_SOURCE_ID); - $this->assertInstanceOf("Stripe\\BankAccount", $resource); - } - - public function testCanListSources() - { - $this->expectsRequest( - 'get', - '/v1/customers/' . self::TEST_RESOURCE_ID . '/sources' - ); - $resources = Customer::allSources(self::TEST_RESOURCE_ID); - $this->assertTrue(is_array($resources->data)); - } - - public function testSerializeSourceString() - { - $obj = Util\Util::convertToStripeObject([ - 'object' => 'customer', - ], null); - $obj->source = 'tok_visa'; - - $expected = [ - 'source' => 'tok_visa', - ]; - $this->assertSame($expected, $obj->serializeParameters()); - } - - public function testSerializeSourceMap() - { - $obj = Util\Util::convertToStripeObject([ - 'object' => 'customer', - ], null); - $obj->source = [ - 'object' => 'card', - 'number' => '4242424242424242', - 'exp_month' => 12, - 'exp_year' => 2032, - ]; - - $expected = [ - 'source' => [ - 'object' => 'card', - 'number' => '4242424242424242', - 'exp_month' => 12, - 'exp_year' => 2032, - ], - ]; - $this->assertSame($expected, $obj->serializeParameters()); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/DisputeTest.php b/vendor/stripe/stripe-php/tests/Stripe/DisputeTest.php deleted file mode 100644 index 81d93da0..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/DisputeTest.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -namespace Stripe; - -class DisputeTest extends TestCase -{ - const TEST_RESOURCE_ID = 'dp_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/disputes' - ); - $resources = Dispute::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Dispute", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/disputes/' . self::TEST_RESOURCE_ID - ); - $resource = Dispute::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Dispute", $resource); - } - - public function testIsSaveable() - { - $resource = Dispute::retrieve(self::TEST_RESOURCE_ID); - $resource->metadata["key"] = "value"; - $this->expectsRequest( - 'post', - '/v1/disputes/' . $resource->id - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\Dispute", $resource); - } - - public function testIsUpdatable() - { - $this->expectsRequest( - 'post', - '/v1/disputes/' . self::TEST_RESOURCE_ID - ); - $resource = Dispute::update(self::TEST_RESOURCE_ID, [ - "metadata" => ["key" => "value"], - ]); - $this->assertInstanceOf("Stripe\\Dispute", $resource); - } - - public function testIsClosable() - { - $dispute = Dispute::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'post', - '/v1/disputes/' . $dispute->id . '/close' - ); - $resource = $dispute->close(); - $this->assertInstanceOf("Stripe\\Dispute", $resource); - $this->assertSame($resource, $dispute); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/EphemeralKeyTest.php b/vendor/stripe/stripe-php/tests/Stripe/EphemeralKeyTest.php deleted file mode 100644 index e8a1fc0e..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/EphemeralKeyTest.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -namespace Stripe; - -class EphemeralKeyTest extends TestCase -{ - public function testIsCreatable() - { - $this->expectsRequest( - 'post', - '/v1/ephemeral_keys', - null, - ["Stripe-Version: 2017-05-25"] - ); - $resource = EphemeralKey::create([ - "customer" => "cus_123", - ], ["stripe_version" => "2017-05-25"]); - $this->assertInstanceOf("Stripe\\EphemeralKey", $resource); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testIsNotCreatableWithoutAnExplicitApiVersion() - { - $resource = EphemeralKey::create([ - "customer" => "cus_123", - ]); - } - - public function testIsDeletable() - { - $key = EphemeralKey::create([ - "customer" => "cus_123", - ], ["stripe_version" => "2017-05-25"]); - $this->expectsRequest( - 'delete', - '/v1/ephemeral_keys/' . $key->id - ); - $resource = $key->delete(); - $this->assertInstanceOf("Stripe\\EphemeralKey", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/Error/BaseTest.php b/vendor/stripe/stripe-php/tests/Stripe/Error/BaseTest.php deleted file mode 100644 index 4c2732ed..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/Error/BaseTest.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -namespace Stripe; - -class BaseTest extends TestCase -{ - public function createFixture($params = []) - { - return $this->getMockForAbstractClass('Stripe\\Error\\Base', [ - 'message', - 200, - '{"key": "value"}', - ['key' => 'value'], - [ - 'Some-Header' => 'Some Value', - 'Request-Id' => 'req_test', - ], - ]); - } - - public function testGetters() - { - $e = $this->createFixture(); - $this->assertSame(200, $e->getHttpStatus()); - $this->assertSame('{"key": "value"}', $e->getHttpBody()); - $this->assertSame(['key' => 'value'], $e->getJsonBody()); - $this->assertSame('Some Value', $e->getHttpHeaders()['Some-Header']); - $this->assertSame('req_test', $e->getRequestId()); - } - - public function testToString() - { - $e = $this->createFixture(); - $this->assertContains("from API request 'req_test'", (string)$e); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/Error/SignatureVerificationTest.php b/vendor/stripe/stripe-php/tests/Stripe/Error/SignatureVerificationTest.php deleted file mode 100644 index 020a41f8..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/Error/SignatureVerificationTest.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -namespace Stripe; - -class SignatureVerificationTest extends TestCase -{ - public function testGetters() - { - $e = new Error\SignatureVerification('message', 'sig_header'); - $this->assertSame('sig_header', $e->getSigHeader()); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/EventTest.php b/vendor/stripe/stripe-php/tests/Stripe/EventTest.php deleted file mode 100644 index 2e3c92f0..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/EventTest.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Stripe; - -class EventTest extends TestCase -{ - const TEST_RESOURCE_ID = 'evt_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/events' - ); - $resources = Event::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Event", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/events/' . self::TEST_RESOURCE_ID - ); - $resource = Event::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Event", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/ExchangeRateTest.php b/vendor/stripe/stripe-php/tests/Stripe/ExchangeRateTest.php deleted file mode 100644 index 8b07b5a1..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/ExchangeRateTest.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -namespace Stripe; - -class ExchangeRateTest extends TestCase -{ - public function testIsListable() - { - $this->stubRequest( - 'get', - '/v1/exchange_rates', - [], - null, - false, - [ - 'object' => 'list', - 'data' => [ - [ - 'id' => 'eur', - 'object' => 'exchange_rate', - 'rates' => ['usd' => 1.18221], - ], - [ - 'id' => 'usd', - 'object' => 'exchange_rate', - 'rates' => ['eur' => 0.845876], - ], - ], - ] - ); - - $listRates = ExchangeRate::all(); - $this->assertTrue(is_array($listRates->data)); - $this->assertEquals('exchange_rate', $listRates->data[0]->object); - } - - public function testIsRetrievable() - { - $this->stubRequest( - 'get', - '/v1/exchange_rates/usd', - [], - null, - false, - [ - 'id' => 'usd', - 'object' => 'exchange_rate', - 'rates' => ['eur' => 0.845876], - ] - ); - $rates = ExchangeRate::retrieve("usd"); - $this->assertEquals('exchange_rate', $rates->object); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/FileCreationTest.php b/vendor/stripe/stripe-php/tests/Stripe/FileCreationTest.php deleted file mode 100644 index 9a65452c..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/FileCreationTest.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php - -namespace Stripe; - -/* - * These tests should really be part of `FileTest`, but because the file creation requests use a - * different host, the tests for these methods need their own setup and teardown methods. - */ -class FileCreationTest extends TestCase -{ - /** - * @before - */ - public function setUpUploadBase() - { - Stripe::$apiUploadBase = Stripe::$apiBase; - Stripe::$apiBase = null; - } - - /** - * @after - */ - public function tearDownUploadBase() - { - Stripe::$apiBase = Stripe::$apiUploadBase; - Stripe::$apiUploadBase = 'https://files.stripe.com'; - } - - public function testIsCreatableWithFileHandle() - { - $this->expectsRequest( - 'post', - '/v1/files', - null, - ['Content-Type: multipart/form-data'], - true, - Stripe::$apiUploadBase - ); - $fp = fopen(dirname(__FILE__) . '/../data/test.png', 'r'); - $resource = File::create([ - "purpose" => "dispute_evidence", - "file" => $fp, - ]); - $this->assertInstanceOf("Stripe\\File", $resource); - } - - public function testIsCreatableWithCurlFile() - { - if (!class_exists('\CurlFile', false)) { - // Older PHP versions don't support this - return; - } - - $this->expectsRequest( - 'post', - '/v1/files', - null, - ['Content-Type: multipart/form-data'], - true, - Stripe::$apiUploadBase - ); - $curlFile = new \CurlFile(dirname(__FILE__) . '/../data/test.png'); - $resource = File::create([ - "purpose" => "dispute_evidence", - "file" => $curlFile, - ]); - $this->assertInstanceOf("Stripe\\File", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/FileLinkTest.php b/vendor/stripe/stripe-php/tests/Stripe/FileLinkTest.php deleted file mode 100644 index 264d0f5e..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/FileLinkTest.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -namespace Stripe; - -class FileLinkTest extends TestCase -{ - const TEST_RESOURCE_ID = 'link_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/file_links' - ); - $resources = FileLink::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\FileLink", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/file_links/' . self::TEST_RESOURCE_ID - ); - $resource = FileLink::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\FileLink", $resource); - } - - public function testIsCreatable() - { - $this->expectsRequest( - 'post', - '/v1/file_links' - ); - $resource = FileLink::create([ - "file" => "file_123" - ]); - $this->assertInstanceOf("Stripe\\FileLink", $resource); - } - - public function testIsSaveable() - { - $resource = FileLink::retrieve(self::TEST_RESOURCE_ID); - $resource->metadata["key"] = "value"; - $this->expectsRequest( - 'post', - '/v1/file_links/' . $resource->id - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\FileLink", $resource); - } - - public function testIsUpdatable() - { - $this->expectsRequest( - 'post', - '/v1/file_links/' . self::TEST_RESOURCE_ID - ); - $resource = FileLink::update(self::TEST_RESOURCE_ID, [ - "metadata" => ["key" => "value"], - ]); - $this->assertInstanceOf("Stripe\\FileLink", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/FileTest.php b/vendor/stripe/stripe-php/tests/Stripe/FileTest.php deleted file mode 100644 index 5ea89184..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/FileTest.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -namespace Stripe; - -class FileTest extends TestCase -{ - const TEST_RESOURCE_ID = 'file_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/files' - ); - $resources = File::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\File", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/files/' . self::TEST_RESOURCE_ID - ); - $resource = File::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\File", $resource); - } - - public function testDeserializesFromFile() - { - $obj = Util\Util::convertToStripeObject([ - 'object' => 'file', - ], null); - $this->assertInstanceOf("Stripe\\File", $obj); - } - - public function testDeserializesFromFileUpload() - { - $obj = Util\Util::convertToStripeObject([ - 'object' => 'file_upload', - ], null); - $this->assertInstanceOf("Stripe\\File", $obj); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/FileUploadCreationTest.php b/vendor/stripe/stripe-php/tests/Stripe/FileUploadCreationTest.php deleted file mode 100644 index 8d5bd870..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/FileUploadCreationTest.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php - -namespace Stripe; - -/* - * These tests should really be part of `FileUploadTest`, but because the file creation requests - * use a different host, the tests for these methods need their own setup and teardown methods. - */ -class FileUploadCreationTest extends TestCase -{ - /** - * @before - */ - public function setUpUploadBase() - { - Stripe::$apiUploadBase = Stripe::$apiBase; - Stripe::$apiBase = null; - } - - /** - * @after - */ - public function tearDownUploadBase() - { - Stripe::$apiBase = Stripe::$apiUploadBase; - Stripe::$apiUploadBase = 'https://files.stripe.com'; - } - - public function testIsCreatableWithFileHandle() - { - $this->expectsRequest( - 'post', - '/v1/files', - null, - ['Content-Type: multipart/form-data'], - true, - Stripe::$apiUploadBase - ); - $fp = fopen(dirname(__FILE__) . '/../data/test.png', 'r'); - $resource = FileUpload::create([ - "purpose" => "dispute_evidence", - "file" => $fp, - ]); - $this->assertInstanceOf("Stripe\\FileUpload", $resource); - } - - public function testIsCreatableWithCurlFile() - { - if (!class_exists('\CurlFile', false)) { - // Older PHP versions don't support this - return; - } - - $this->expectsRequest( - 'post', - '/v1/files', - null, - ['Content-Type: multipart/form-data'], - true, - Stripe::$apiUploadBase - ); - $curlFile = new \CurlFile(dirname(__FILE__) . '/../data/test.png'); - $resource = FileUpload::create([ - "purpose" => "dispute_evidence", - "file" => $curlFile, - ]); - $this->assertInstanceOf("Stripe\\FileUpload", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/FileUploadTest.php b/vendor/stripe/stripe-php/tests/Stripe/FileUploadTest.php deleted file mode 100644 index 4b23de67..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/FileUploadTest.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -namespace Stripe; - -class FileUploadTest extends TestCase -{ - const TEST_RESOURCE_ID = 'file_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/files' - ); - $resources = FileUpload::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\FileUpload", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/files/' . self::TEST_RESOURCE_ID - ); - $resource = FileUpload::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\FileUpload", $resource); - } - - public function testDeserializesFromFile() - { - $obj = Util\Util::convertToStripeObject([ - 'object' => 'file', - ], null); - $this->assertInstanceOf("Stripe\\FileUpload", $obj); - } - - public function testDeserializesFromFileUpload() - { - $obj = Util\Util::convertToStripeObject([ - 'object' => 'file_upload', - ], null); - $this->assertInstanceOf("Stripe\\FileUpload", $obj); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/HttpClient/CurlClientTest.php b/vendor/stripe/stripe-php/tests/Stripe/HttpClient/CurlClientTest.php deleted file mode 100644 index 89cf203f..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/HttpClient/CurlClientTest.php +++ /dev/null @@ -1,237 +0,0 @@ -<?php - -namespace Stripe; - -use Stripe\HttpClient\CurlClient; - -class CurlClientTest extends TestCase -{ - /** - * @before - */ - public function saveOriginalNetworkValues() - { - $this->origMaxNetworkRetries = Stripe::getMaxNetworkRetries(); - $this->origMaxNetworkRetryDelay = Stripe::getMaxNetworkRetryDelay(); - $this->origInitialNetworkRetryDelay = Stripe::getInitialNetworkRetryDelay(); - } - - /** - * @before - */ - public function setUpReflectors() - { - $stripeReflector = new \ReflectionClass('\Stripe\Stripe'); - - $this->maxNetworkRetryDelayProperty = $stripeReflector->getProperty('maxNetworkRetryDelay'); - $this->maxNetworkRetryDelayProperty->setAccessible(true); - - $this->initialNetworkRetryDelayProperty = $stripeReflector->getProperty('initialNetworkRetryDelay'); - $this->initialNetworkRetryDelayProperty->setAccessible(true); - - $curlClientReflector = new \ReflectionClass('Stripe\HttpClient\CurlClient'); - - $this->shouldRetryMethod = $curlClientReflector->getMethod('shouldRetry'); - $this->shouldRetryMethod->setAccessible(true); - - $this->sleepTimeMethod = $curlClientReflector->getMethod('sleepTime'); - $this->sleepTimeMethod->setAccessible(true); - } - - /** - * @after - */ - public function restoreOriginalNetworkValues() - { - Stripe::setMaxNetworkRetries($this->origMaxNetworkRetries); - $this->setMaxNetworkRetryDelay($this->origMaxNetworkRetryDelay); - $this->setInitialNetworkRetryDelay($this->origInitialNetworkRetryDelay); - } - - private function setMaxNetworkRetryDelay($maxNetworkRetryDelay) - { - $this->maxNetworkRetryDelayProperty->setValue(null, $maxNetworkRetryDelay); - } - - private function setInitialNetworkRetryDelay($initialNetworkRetryDelay) - { - $this->initialNetworkRetryDelayProperty->setValue(null, $initialNetworkRetryDelay); - } - - private function createFakeRandomGenerator($returnValue = 1.0) - { - $fakeRandomGenerator = $this->getMock('Stripe\Util\RandomGenetator', ['randFloat']); - $fakeRandomGenerator->method('randFloat')->willReturn($returnValue); - return $fakeRandomGenerator; - } - - public function testTimeout() - { - $curl = new CurlClient(); - $this->assertSame(CurlClient::DEFAULT_TIMEOUT, $curl->getTimeout()); - $this->assertSame(CurlClient::DEFAULT_CONNECT_TIMEOUT, $curl->getConnectTimeout()); - - // implicitly tests whether we're returning the CurlClient instance - $curl = $curl->setConnectTimeout(1)->setTimeout(10); - $this->assertSame(1, $curl->getConnectTimeout()); - $this->assertSame(10, $curl->getTimeout()); - - $curl->setTimeout(-1); - $curl->setConnectTimeout(-999); - $this->assertSame(0, $curl->getTimeout()); - $this->assertSame(0, $curl->getConnectTimeout()); - } - - public function testUserAgentInfo() - { - $curl = new CurlClient(); - $uaInfo = $curl->getUserAgentInfo(); - $this->assertNotNull($uaInfo); - $this->assertNotNull($uaInfo['httplib']); - $this->assertNotNull($uaInfo['ssllib']); - } - - public function testDefaultOptions() - { - // make sure options array loads/saves properly - $optionsArray = [CURLOPT_PROXY => 'localhost:80']; - $withOptionsArray = new CurlClient($optionsArray); - $this->assertSame($withOptionsArray->getDefaultOptions(), $optionsArray); - - // make sure closure-based options work properly, including argument passing - $ref = null; - $withClosure = new CurlClient(function ($method, $absUrl, $headers, $params, $hasFile) use (&$ref) { - $ref = func_get_args(); - return []; - }); - - $withClosure->request('get', 'https://httpbin.org/status/200', [], [], false); - $this->assertSame($ref, ['get', 'https://httpbin.org/status/200', [], [], false]); - - // this is the last test case that will run, since it'll throw an exception at the end - $withBadClosure = new CurlClient(function () { - return 'thisShouldNotWork'; - }); - $this->setExpectedException('Stripe\Error\Api', "Non-array value returned by defaultOptions CurlClient callback"); - $withBadClosure->request('get', 'https://httpbin.org/status/200', [], [], false); - } - - public function testSslOption() - { - // make sure options array loads/saves properly - $optionsArray = [CURLOPT_SSLVERSION => CURL_SSLVERSION_TLSv1]; - $withOptionsArray = new CurlClient($optionsArray); - $this->assertSame($withOptionsArray->getDefaultOptions(), $optionsArray); - } - - public function testShouldRetryOnTimeout() - { - Stripe::setMaxNetworkRetries(2); - - $curlClient = new CurlClient(); - - $this->assertTrue($this->shouldRetryMethod->invoke($curlClient, CURLE_OPERATION_TIMEOUTED, 0, 0)); - } - - public function testShouldRetryOnConnectionFailure() - { - Stripe::setMaxNetworkRetries(2); - - $curlClient = new CurlClient(); - - $this->assertTrue($this->shouldRetryMethod->invoke($curlClient, CURLE_COULDNT_CONNECT, 0, 0)); - } - - public function testShouldRetryOnConflict() - { - Stripe::setMaxNetworkRetries(2); - - $curlClient = new CurlClient(); - - $this->assertTrue($this->shouldRetryMethod->invoke($curlClient, 0, 409, 0)); - } - - public function testShouldNotRetryAtMaximumCount() - { - Stripe::setMaxNetworkRetries(2); - - $curlClient = new CurlClient(); - - $this->assertFalse($this->shouldRetryMethod->invoke($curlClient, 0, 0, Stripe::getMaxNetworkRetries())); - } - - public function testShouldNotRetryOnCertValidationError() - { - Stripe::setMaxNetworkRetries(2); - - $curlClient = new CurlClient(); - - $this->assertFalse($this->shouldRetryMethod->invoke($curlClient, CURLE_SSL_PEER_CERTIFICATE, -1, 0)); - } - - public function testSleepTimeShouldGrowExponentially() - { - $this->setMaxNetworkRetryDelay(999); - - $curlClient = new CurlClient(null, $this->createFakeRandomGenerator()); - - $this->assertEquals( - Stripe::getInitialNetworkRetryDelay() * 1, - $this->sleepTimeMethod->invoke($curlClient, 1) - ); - $this->assertEquals( - Stripe::getInitialNetworkRetryDelay() * 2, - $this->sleepTimeMethod->invoke($curlClient, 2) - ); - $this->assertEquals( - Stripe::getInitialNetworkRetryDelay() * 4, - $this->sleepTimeMethod->invoke($curlClient, 3) - ); - $this->assertEquals( - Stripe::getInitialNetworkRetryDelay() * 8, - $this->sleepTimeMethod->invoke($curlClient, 4) - ); - } - - public function testSleepTimeShouldEnforceMaxNetworkRetryDelay() - { - $this->setInitialNetworkRetryDelay(1); - $this->setMaxNetworkRetryDelay(2); - - $curlClient = new CurlClient(null, $this->createFakeRandomGenerator()); - - $this->assertEquals(1, $this->sleepTimeMethod->invoke($curlClient, 1)); - $this->assertEquals(2, $this->sleepTimeMethod->invoke($curlClient, 2)); - $this->assertEquals(2, $this->sleepTimeMethod->invoke($curlClient, 3)); - $this->assertEquals(2, $this->sleepTimeMethod->invoke($curlClient, 4)); - } - - public function testSleepTimeShouldAddSomeRandomness() - { - $randomValue = 0.8; - $this->setInitialNetworkRetryDelay(1); - $this->setMaxNetworkRetryDelay(8); - - $curlClient = new CurlClient(null, $this->createFakeRandomGenerator($randomValue)); - - $baseValue = Stripe::getInitialNetworkRetryDelay() * (0.5 * (1 + $randomValue)); - - // the initial value cannot be smaller than the base, - // so the randomness is ignored - $this->assertEquals(Stripe::getInitialNetworkRetryDelay(), $this->sleepTimeMethod->invoke($curlClient, 1)); - - // after the first one, the randomness is applied - $this->assertEquals($baseValue * 2, $this->sleepTimeMethod->invoke($curlClient, 2)); - $this->assertEquals($baseValue * 4, $this->sleepTimeMethod->invoke($curlClient, 3)); - $this->assertEquals($baseValue * 8, $this->sleepTimeMethod->invoke($curlClient, 4)); - } - - public function testResponseHeadersCaseInsensitive() - { - $charge = Charge::all(); - - $headers = $charge->getLastResponse()->headers; - $this->assertNotNull($headers['request-id']); - $this->assertEquals($headers['request-id'], $headers['Request-Id']); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/InvoiceItemTest.php b/vendor/stripe/stripe-php/tests/Stripe/InvoiceItemTest.php deleted file mode 100644 index ffe140aa..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/InvoiceItemTest.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php - -namespace Stripe; - -class InvoiceItemTest extends TestCase -{ - const TEST_RESOURCE_ID = 'ii_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/invoiceitems' - ); - $resources = InvoiceItem::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\InvoiceItem", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/invoiceitems/' . self::TEST_RESOURCE_ID - ); - $resource = InvoiceItem::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\InvoiceItem", $resource); - } - - public function testIsCreatable() - { - $this->expectsRequest( - 'post', - '/v1/invoiceitems' - ); - $resource = InvoiceItem::create([ - "amount" => 100, - "currency" => "usd", - "customer" => "cus_123" - ]); - $this->assertInstanceOf("Stripe\\InvoiceItem", $resource); - } - - public function testIsSaveable() - { - $resource = InvoiceItem::retrieve(self::TEST_RESOURCE_ID); - $resource->metadata["key"] = "value"; - $this->expectsRequest( - 'post', - '/v1/invoiceitems/' . $resource->id - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\InvoiceItem", $resource); - } - - public function testIsUpdatable() - { - $this->expectsRequest( - 'post', - '/v1/invoiceitems/' . self::TEST_RESOURCE_ID - ); - $resource = InvoiceItem::update(self::TEST_RESOURCE_ID, [ - "metadata" => ["key" => "value"], - ]); - $this->assertInstanceOf("Stripe\\InvoiceItem", $resource); - } - - public function testIsDeletable() - { - $invoiceItem = InvoiceItem::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'delete', - '/v1/invoiceitems/' . $invoiceItem->id - ); - $resource = $invoiceItem->delete(); - $this->assertInstanceOf("Stripe\\InvoiceItem", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/InvoiceTest.php b/vendor/stripe/stripe-php/tests/Stripe/InvoiceTest.php deleted file mode 100644 index f1ae9378..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/InvoiceTest.php +++ /dev/null @@ -1,87 +0,0 @@ -<?php - -namespace Stripe; - -class InvoiceTest extends TestCase -{ - const TEST_RESOURCE_ID = 'in_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/invoices' - ); - $resources = Invoice::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Invoice", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/invoices/' . self::TEST_RESOURCE_ID - ); - $resource = Invoice::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Invoice", $resource); - } - - public function testIsCreatable() - { - $this->expectsRequest( - 'post', - '/v1/invoices' - ); - $resource = Invoice::create([ - "customer" => "cus_123" - ]); - $this->assertInstanceOf("Stripe\\Invoice", $resource); - } - - public function testIsSaveable() - { - $resource = Invoice::retrieve(self::TEST_RESOURCE_ID); - $resource->metadata["key"] = "value"; - $this->expectsRequest( - 'post', - '/v1/invoices/' . $resource->id - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\Invoice", $resource); - } - - public function testIsUpdatable() - { - $this->expectsRequest( - 'post', - '/v1/invoices/' . self::TEST_RESOURCE_ID - ); - $resource = Invoice::update(self::TEST_RESOURCE_ID, [ - "metadata" => ["key" => "value"], - ]); - $this->assertInstanceOf("Stripe\\Invoice", $resource); - } - - public function testCanRetrieveUpcoming() - { - $this->expectsRequest( - 'get', - '/v1/invoices/upcoming' - ); - $resource = Invoice::upcoming(["customer" => "cus_123"]); - $this->assertInstanceOf("Stripe\\Invoice", $resource); - } - - public function testIsPayable() - { - $invoice = Invoice::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'post', - '/v1/invoices/' . $invoice->id . '/pay' - ); - $resource = $invoice->pay(); - $this->assertInstanceOf("Stripe\\Invoice", $resource); - $this->assertSame($resource, $invoice); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/IssuerFraudRecordTest.php b/vendor/stripe/stripe-php/tests/Stripe/IssuerFraudRecordTest.php deleted file mode 100644 index 1869248a..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/IssuerFraudRecordTest.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Stripe; - -class IssuerFraudRecordTest extends TestCase -{ - const TEST_RESOURCE_ID = 'issfr_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/issuer_fraud_records' - ); - $resources = IssuerFraudRecord::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\IssuerFraudRecord", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/issuer_fraud_records/' . self::TEST_RESOURCE_ID - ); - $resource = IssuerFraudRecord::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\IssuerFraudRecord", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/Issuing/AuthorizationTest.php b/vendor/stripe/stripe-php/tests/Stripe/Issuing/AuthorizationTest.php deleted file mode 100644 index 4bd5480d..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/Issuing/AuthorizationTest.php +++ /dev/null @@ -1,79 +0,0 @@ -<?php - -namespace Stripe\Issuing; - -class AuthorizationTest extends \Stripe\TestCase -{ - const TEST_RESOURCE_ID = 'iauth_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/issuing/authorizations' - ); - $resources = Authorization::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Issuing\\Authorization", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/issuing/authorizations/' . self::TEST_RESOURCE_ID - ); - $resource = Authorization::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Issuing\\Authorization", $resource); - } - - public function testIsSaveable() - { - $resource = Authorization::retrieve(self::TEST_RESOURCE_ID); - $resource->metadata["key"] = "value"; - - $this->expectsRequest( - 'post', - '/v1/issuing/authorizations/' . self::TEST_RESOURCE_ID - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\Issuing\\Authorization", $resource); - } - - public function testIsUpdatable() - { - $this->expectsRequest( - 'post', - '/v1/issuing/authorizations/' . self::TEST_RESOURCE_ID, - ["metadata" => ["key" => "value"]] - ); - $resource = Authorization::update(self::TEST_RESOURCE_ID, [ - "metadata" => ["key" => "value"], - ]); - $this->assertInstanceOf("Stripe\\Issuing\\Authorization", $resource); - } - - public function testIsApprovable() - { - $resource = Authorization::retrieve(self::TEST_RESOURCE_ID); - - $this->expectsRequest( - 'post', - '/v1/issuing/authorizations/' . self::TEST_RESOURCE_ID . '/approve' - ); - $resource = $resource->approve(); - $this->assertInstanceOf("Stripe\\Issuing\\Authorization", $resource); - } - - public function testIsDeclinable() - { - $resource = Authorization::retrieve(self::TEST_RESOURCE_ID); - - $this->expectsRequest( - 'post', - '/v1/issuing/authorizations/' . self::TEST_RESOURCE_ID . '/decline' - ); - $resource = $resource->decline(); - $this->assertInstanceOf("Stripe\\Issuing\\Authorization", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/Issuing/CardTest.php b/vendor/stripe/stripe-php/tests/Stripe/Issuing/CardTest.php deleted file mode 100644 index edbe8502..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/Issuing/CardTest.php +++ /dev/null @@ -1,66 +0,0 @@ -<?php - -namespace Stripe\Issuing; - -class CardTest extends \Stripe\TestCase -{ - const TEST_RESOURCE_ID = 'ic_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/issuing/cards' - ); - $resources = Card::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Issuing\\Card", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/issuing/cards/' . self::TEST_RESOURCE_ID - ); - $resource = Card::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Issuing\\Card", $resource); - } - - public function testIsSaveable() - { - $resource = Card::retrieve(self::TEST_RESOURCE_ID); - $resource->metadata["key"] = "value"; - - $this->expectsRequest( - 'post', - '/v1/issuing/cards/' . self::TEST_RESOURCE_ID - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\Issuing\\Card", $resource); - } - - public function testIsUpdatable() - { - $this->expectsRequest( - 'post', - '/v1/issuing/cards/' . self::TEST_RESOURCE_ID, - ["metadata" => ["key" => "value"]] - ); - $resource = Card::update(self::TEST_RESOURCE_ID, [ - "metadata" => ["key" => "value"], - ]); - $this->assertInstanceOf("Stripe\\Issuing\\Card", $resource); - } - - public function testCanRetrieveDetails() - { - $resource = Card::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'get', - '/v1/issuing/cards/' . self::TEST_RESOURCE_ID . '/details' - ); - $details = $resource->details(); - $this->assertInstanceOf("Stripe\\Issuing\\CardDetails", $details); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/Issuing/CardholderTest.php b/vendor/stripe/stripe-php/tests/Stripe/Issuing/CardholderTest.php deleted file mode 100644 index 8e334e5f..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/Issuing/CardholderTest.php +++ /dev/null @@ -1,79 +0,0 @@ -<?php - -namespace Stripe\Issuing; - -class CardholderTest extends \Stripe\TestCase -{ - const TEST_RESOURCE_ID = 'ich_123'; - - public function testIsCreatable() - { - $params = [ - "billing" => [ - "address" => [ - "city" => "city", - "country" => "US", - "line1" => "line1", - "postal_code" => "postal_code", - ], - ], - "name" => "Cardholder Name", - "type" => "individual", - ]; - - $this->expectsRequest( - 'post', - '/v1/issuing/cardholders', - $params - ); - $resource = Cardholder::create($params); - $this->assertInstanceOf("Stripe\\Issuing\\Cardholder", $resource); - } - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/issuing/cardholders' - ); - $resources = Cardholder::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Issuing\\Cardholder", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/issuing/cardholders/' . self::TEST_RESOURCE_ID - ); - $resource = Cardholder::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Issuing\\Cardholder", $resource); - } - - public function testIsSaveable() - { - $resource = Cardholder::retrieve(self::TEST_RESOURCE_ID); - $resource->metadata["key"] = "value"; - - $this->expectsRequest( - 'post', - '/v1/issuing/cardholders/' . self::TEST_RESOURCE_ID - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\Issuing\\Cardholder", $resource); - } - - public function testIsUpdatable() - { - $this->expectsRequest( - 'post', - '/v1/issuing/cardholders/' . self::TEST_RESOURCE_ID, - ["metadata" => ["key" => "value"]] - ); - $resource = Cardholder::update(self::TEST_RESOURCE_ID, [ - "metadata" => ["key" => "value"], - ]); - $this->assertInstanceOf("Stripe\\Issuing\\Cardholder", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/Issuing/DisputeTest.php b/vendor/stripe/stripe-php/tests/Stripe/Issuing/DisputeTest.php deleted file mode 100644 index 068868d3..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/Issuing/DisputeTest.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php - -namespace Stripe\Issuing; - -class DisputeTest extends \Stripe\TestCase -{ - const TEST_RESOURCE_ID = 'idp_123'; - - public function testIsCreatable() - { - $params = [ - "reason" => "fraudulent", - "disputed_transaction" => "ipi_123", - ]; - - $this->expectsRequest( - 'post', - '/v1/issuing/disputes', - $params - ); - $resource = Dispute::create($params); - $this->assertInstanceOf("Stripe\\Issuing\\Dispute", $resource); - } - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/issuing/disputes' - ); - $resources = Dispute::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Issuing\\Dispute", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/issuing/disputes/' . self::TEST_RESOURCE_ID - ); - $resource = Dispute::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Issuing\\Dispute", $resource); - } - - public function testIsSaveable() - { - $resource = Dispute::retrieve(self::TEST_RESOURCE_ID); - $resource->metadata["key"] = "value"; - - $this->expectsRequest( - 'post', - '/v1/issuing/disputes/' . self::TEST_RESOURCE_ID - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\Issuing\\Dispute", $resource); - } - - public function testIsUpdatable() - { - $this->expectsRequest( - 'post', - '/v1/issuing/disputes/' . self::TEST_RESOURCE_ID, - ["metadata" => ["key" => "value"]] - ); - $resource = Dispute::update(self::TEST_RESOURCE_ID, [ - "metadata" => ["key" => "value"], - ]); - $this->assertInstanceOf("Stripe\\Issuing\\Dispute", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/Issuing/TransactionTest.php b/vendor/stripe/stripe-php/tests/Stripe/Issuing/TransactionTest.php deleted file mode 100644 index 64d12374..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/Issuing/TransactionTest.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -namespace Stripe\Issuing; - -class TransactionTest extends \Stripe\TestCase -{ - const TEST_RESOURCE_ID = 'ipi_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/issuing/transactions' - ); - $resources = Transaction::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Issuing\\Transaction", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/issuing/transactions/' . self::TEST_RESOURCE_ID - ); - $resource = Transaction::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Issuing\\Transaction", $resource); - } - - public function testIsSaveable() - { - $resource = Transaction::retrieve(self::TEST_RESOURCE_ID); - $resource->metadata["key"] = "value"; - - $this->expectsRequest( - 'post', - '/v1/issuing/transactions/' . self::TEST_RESOURCE_ID - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\Issuing\\Transaction", $resource); - } - - public function testIsUpdatable() - { - $this->expectsRequest( - 'post', - '/v1/issuing/transactions/' . self::TEST_RESOURCE_ID, - ["metadata" => ["key" => "value"]] - ); - $resource = Transaction::update(self::TEST_RESOURCE_ID, [ - "metadata" => ["key" => "value"], - ]); - $this->assertInstanceOf("Stripe\\Issuing\\Transaction", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/OAuthTest.php b/vendor/stripe/stripe-php/tests/Stripe/OAuthTest.php deleted file mode 100644 index b4e43a88..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/OAuthTest.php +++ /dev/null @@ -1,97 +0,0 @@ -<?php - -namespace Stripe; - -class OAuthTest extends TestCase -{ - public function testAuthorizeUrl() - { - $uriStr = OAuth::authorizeUrl([ - 'scope' => 'read_write', - 'state' => 'csrf_token', - 'stripe_user' => [ - 'email' => 'test@example.com', - 'url' => 'https://example.com/profile/test', - 'country' => 'US', - ], - ]); - - $uri = parse_url($uriStr); - parse_str($uri['query'], $params); - - $this->assertSame('https', $uri['scheme']); - $this->assertSame('connect.stripe.com', $uri['host']); - $this->assertSame('/oauth/authorize', $uri['path']); - - $this->assertSame('ca_123', $params['client_id']); - $this->assertSame('read_write', $params['scope']); - $this->assertSame('test@example.com', $params['stripe_user']['email']); - $this->assertSame('https://example.com/profile/test', $params['stripe_user']['url']); - $this->assertSame('US', $params['stripe_user']['country']); - } - - /** - * @expectedException \Stripe\Error\Authentication - * @expectedExceptionMessageRegExp #No client_id provided# - */ - public function testRaisesAuthenticationErrorWhenNoClientId() - { - Stripe::setClientId(null); - OAuth::authorizeUrl(); - } - - public function testToken() - { - $this->stubRequest( - 'POST', - '/oauth/token', - [ - 'grant_type' => 'authorization_code', - 'code' => 'this_is_an_authorization_code', - ], - null, - false, - [ - 'access_token' => 'sk_access_token', - 'scope' => 'read_only', - 'livemode' => false, - 'token_type' => 'bearer', - 'refresh_token' => 'sk_refresh_token', - 'stripe_user_id' => 'acct_test', - 'stripe_publishable_key' => 'pk_test', - ], - 200, - Stripe::$connectBase - ); - - $resp = OAuth::token([ - 'grant_type' => 'authorization_code', - 'code' => 'this_is_an_authorization_code', - ]); - $this->assertSame('sk_access_token', $resp->access_token); - } - - public function testDeauthorize() - { - $this->stubRequest( - 'POST', - '/oauth/deauthorize', - [ - 'stripe_user_id' => 'acct_test_deauth', - 'client_id' => 'ca_123', - ], - null, - false, - [ - 'stripe_user_id' => 'acct_test_deauth', - ], - 200, - Stripe::$connectBase - ); - - $resp = OAuth::deauthorize([ - 'stripe_user_id' => 'acct_test_deauth', - ]); - $this->assertSame('acct_test_deauth', $resp->stripe_user_id); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/OrderReturnTest.php b/vendor/stripe/stripe-php/tests/Stripe/OrderReturnTest.php deleted file mode 100644 index bb2d65c4..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/OrderReturnTest.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Stripe; - -class OrderReturnTest extends TestCase -{ - const TEST_RESOURCE_ID = 'orret_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/order_returns' - ); - $resources = OrderReturn::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\OrderReturn", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/order_returns/' . self::TEST_RESOURCE_ID - ); - $resource = OrderReturn::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\OrderReturn", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/OrderTest.php b/vendor/stripe/stripe-php/tests/Stripe/OrderTest.php deleted file mode 100644 index 51d17e94..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/OrderTest.php +++ /dev/null @@ -1,87 +0,0 @@ -<?php - -namespace Stripe; - -class OrderTest extends TestCase -{ - const TEST_RESOURCE_ID = 'or_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/orders' - ); - $resources = Order::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Order", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/orders/' . self::TEST_RESOURCE_ID - ); - $resource = Order::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Order", $resource); - } - - public function testIsCreatable() - { - $this->expectsRequest( - 'post', - '/v1/orders' - ); - $resource = Order::create([ - 'currency' => 'usd' - ]); - $this->assertInstanceOf("Stripe\\Order", $resource); - } - - public function testIsSaveable() - { - $resource = Order::retrieve(self::TEST_RESOURCE_ID); - $resource->metadata["key"] = "value"; - $this->expectsRequest( - 'post', - '/v1/orders/' . $resource->id - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\Order", $resource); - } - - public function testIsUpdatable() - { - $this->expectsRequest( - 'post', - '/v1/orders/' . self::TEST_RESOURCE_ID - ); - $resource = Order::update(self::TEST_RESOURCE_ID, [ - "metadata" => ["key" => "value"], - ]); - $this->assertInstanceOf("Stripe\\Order", $resource); - } - - public function testIsPayable() - { - $resource = Order::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'post', - '/v1/orders/' . $resource->id . '/pay' - ); - $resource->pay(); - $this->assertInstanceOf("Stripe\\Order", $resource); - } - - public function testIsReturnable() - { - $order = Order::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'post', - '/v1/orders/' . $order->id . '/returns' - ); - $resource = $order->returnOrder(); - $this->assertInstanceOf("Stripe\\OrderReturn", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/PaymentIntentTest.php b/vendor/stripe/stripe-php/tests/Stripe/PaymentIntentTest.php deleted file mode 100644 index acae9bc8..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/PaymentIntentTest.php +++ /dev/null @@ -1,103 +0,0 @@ -<?php - -namespace Stripe; - -class PaymentIntentTest extends TestCase -{ - const TEST_RESOURCE_ID = 'pi_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/payment_intents' - ); - $resources = PaymentIntent::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\PaymentIntent", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/payment_intents/' . self::TEST_RESOURCE_ID - ); - $resource = PaymentIntent::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\PaymentIntent", $resource); - } - - public function testIsCreatable() - { - $this->expectsRequest( - 'post', - '/v1/payment_intents' - ); - $resource = PaymentIntent::create([ - "allowed_source_types" => ["card"], - "amount" => 100, - "currency" => "usd", - ]); - $this->assertInstanceOf("Stripe\\PaymentIntent", $resource); - } - - public function testIsSaveable() - { - $resource = PaymentIntent::retrieve(self::TEST_RESOURCE_ID); - $resource->metadata["key"] = "value"; - $this->expectsRequest( - 'post', - '/v1/payment_intents/' . self::TEST_RESOURCE_ID - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\PaymentIntent", $resource); - } - - public function testIsUpdatable() - { - $this->expectsRequest( - 'post', - '/v1/payment_intents/' . self::TEST_RESOURCE_ID - ); - $resource = PaymentIntent::update( - self::TEST_RESOURCE_ID, - [ - "metadata" => ["key" => "value"], - ] - ); - $this->assertInstanceOf("Stripe\\PaymentIntent", $resource); - } - - public function testIsCancelable() - { - $resource = PaymentIntent::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'post', - '/v1/payment_intents/' . self::TEST_RESOURCE_ID . '/cancel' - ); - $resource->cancel(); - $this->assertInstanceOf("Stripe\\PaymentIntent", $resource); - } - - public function testIsCapturable() - { - $resource = PaymentIntent::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'post', - '/v1/payment_intents/' . self::TEST_RESOURCE_ID . '/capture' - ); - $resource->capture(); - $this->assertInstanceOf("Stripe\\PaymentIntent", $resource); - } - - public function testIsConfirmable() - { - $resource = PaymentIntent::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'post', - '/v1/payment_intents/' . self::TEST_RESOURCE_ID . '/confirm' - ); - $resource->confirm(); - $this->assertInstanceOf("Stripe\\PaymentIntent", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/PayoutTest.php b/vendor/stripe/stripe-php/tests/Stripe/PayoutTest.php deleted file mode 100644 index 79c7b5fd..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/PayoutTest.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php - -namespace Stripe; - -class PayoutTest extends TestCase -{ - const TEST_RESOURCE_ID = 'po_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/payouts' - ); - $resources = Payout::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Payout", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/payouts/' . self::TEST_RESOURCE_ID - ); - $resource = Payout::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Payout", $resource); - } - - public function testIsCreatable() - { - $this->expectsRequest( - 'post', - '/v1/payouts' - ); - $resource = Payout::create([ - "amount" => 100, - "currency" => "usd" - ]); - $this->assertInstanceOf("Stripe\\Payout", $resource); - } - - public function testIsSaveable() - { - $resource = Payout::retrieve(self::TEST_RESOURCE_ID); - $resource->metadata["key"] = "value"; - $this->expectsRequest( - 'post', - '/v1/payouts/' . $resource->id - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\Payout", $resource); - } - - public function testIsUpdatable() - { - $this->expectsRequest( - 'post', - '/v1/payouts/' . self::TEST_RESOURCE_ID - ); - $resource = Payout::update(self::TEST_RESOURCE_ID, [ - "metadata" => ["key" => "value"], - ]); - $this->assertInstanceOf("Stripe\\Payout", $resource); - } - - public function testIsCancelable() - { - $resource = Payout::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'post', - '/v1/payouts/' . $resource->id . '/cancel' - ); - $resource->cancel(); - $this->assertInstanceOf("Stripe\\Payout", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/PlanTest.php b/vendor/stripe/stripe-php/tests/Stripe/PlanTest.php deleted file mode 100644 index 8d71745e..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/PlanTest.php +++ /dev/null @@ -1,80 +0,0 @@ -<?php - -namespace Stripe; - -class PlanTest extends TestCase -{ - const TEST_RESOURCE_ID = 'plan'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/plans' - ); - $resources = Plan::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Plan", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/plans/' . self::TEST_RESOURCE_ID - ); - $resource = Plan::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Plan", $resource); - } - - public function testIsCreatable() - { - $this->expectsRequest( - 'post', - '/v1/plans' - ); - $resource = Plan::create([ - 'amount' => 100, - 'interval' => 'month', - 'currency' => 'usd', - 'name' => self::TEST_RESOURCE_ID, - 'id' => self::TEST_RESOURCE_ID - ]); - $this->assertInstanceOf("Stripe\\Plan", $resource); - } - - public function testIsSaveable() - { - $resource = Plan::retrieve(self::TEST_RESOURCE_ID); - $resource->metadata["key"] = "value"; - $this->expectsRequest( - 'post', - '/v1/plans/' . $resource->id - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\Plan", $resource); - } - - public function testIsUpdatable() - { - $this->expectsRequest( - 'post', - '/v1/plans/' . self::TEST_RESOURCE_ID - ); - $resource = Plan::update(self::TEST_RESOURCE_ID, [ - "metadata" => ["key" => "value"], - ]); - $this->assertInstanceOf("Stripe\\Plan", $resource); - } - - public function testIsDeletable() - { - $resource = Plan::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'delete', - '/v1/plans/' . $resource->id - ); - $resource->delete(); - $this->assertInstanceOf("Stripe\\Plan", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/ProductTest.php b/vendor/stripe/stripe-php/tests/Stripe/ProductTest.php deleted file mode 100644 index c2a3813c..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/ProductTest.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php - -namespace Stripe; - -class ProductTest extends TestCase -{ - const TEST_RESOURCE_ID = 'prod_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/products' - ); - $resources = Product::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Product", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/products/' . self::TEST_RESOURCE_ID - ); - $resource = Product::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Product", $resource); - } - - public function testIsCreatable() - { - $this->expectsRequest( - 'post', - '/v1/products' - ); - $resource = Product::create([ - 'name' => 'name', - 'type' => 'good' - ]); - $this->assertInstanceOf("Stripe\\Product", $resource); - } - - public function testIsSaveable() - { - $resource = Product::retrieve(self::TEST_RESOURCE_ID); - $resource->metadata["key"] = "value"; - $this->expectsRequest( - 'post', - '/v1/products/' . $resource->id - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\Product", $resource); - } - - public function testIsUpdatable() - { - $this->expectsRequest( - 'post', - '/v1/products/' . self::TEST_RESOURCE_ID - ); - $resource = Product::update(self::TEST_RESOURCE_ID, [ - "metadata" => ["key" => "value"], - ]); - $this->assertInstanceOf("Stripe\\Product", $resource); - } - - public function testIsDeletable() - { - $resource = Product::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'delete', - '/v1/products/' . $resource->id - ); - $resource->delete(); - $this->assertInstanceOf("Stripe\\Product", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/RecipientTest.php b/vendor/stripe/stripe-php/tests/Stripe/RecipientTest.php deleted file mode 100644 index 67866721..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/RecipientTest.php +++ /dev/null @@ -1,98 +0,0 @@ -<?php - -namespace Stripe; - -class RecipientTest extends TestCase -{ - const TEST_RESOURCE_ID = 'rp_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/recipients' - ); - $resources = Recipient::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Recipient", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/recipients/' . self::TEST_RESOURCE_ID - ); - $resource = Recipient::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Recipient", $resource); - } - - public function testIsCreatable() - { - $this->expectsRequest( - 'post', - '/v1/recipients' - ); - $resource = Recipient::create([ - "name" => "name", - "type" => "individual" - ]); - $this->assertInstanceOf("Stripe\\Recipient", $resource); - } - - public function testIsSaveable() - { - $resource = Recipient::retrieve(self::TEST_RESOURCE_ID); - $resource->metadata["key"] = "value"; - $this->expectsRequest( - 'post', - '/v1/recipients/' . $resource->id - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\Recipient", $resource); - } - - public function testIsUpdatable() - { - $this->expectsRequest( - 'post', - '/v1/recipients/' . self::TEST_RESOURCE_ID - ); - $resource = Recipient::update(self::TEST_RESOURCE_ID, [ - "metadata" => ["key" => "value"], - ]); - $this->assertInstanceOf("Stripe\\Recipient", $resource); - } - - public function testIsDeletable() - { - $resource = Recipient::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'delete', - '/v1/recipients/' . $resource->id - ); - $resource->delete(); - $this->assertInstanceOf("Stripe\\Recipient", $resource); - } - - public function testCanListTransfers() - { - $recipient = Recipient::retrieve(self::TEST_RESOURCE_ID); - - // stripe-mock does not support this anymore so we stub it - $this->stubRequest( - 'get', - '/v1/transfers', - ["recipient" => $recipient->id], - null, - false, - [ - "object" => "list", - "data" => [["id" => "tr_123", "object" => "transfer"]] - ] - ); - $resources = $recipient->transfers(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Transfer", $resources->data[0]); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/RefundTest.php b/vendor/stripe/stripe-php/tests/Stripe/RefundTest.php deleted file mode 100644 index 788361d4..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/RefundTest.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -namespace Stripe; - -class RefundTest extends TestCase -{ - const TEST_RESOURCE_ID = 're_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/refunds' - ); - $resources = Refund::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Refund", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/refunds/' . self::TEST_RESOURCE_ID - ); - $resource = Refund::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Refund", $resource); - } - - public function testIsCreatable() - { - $this->expectsRequest( - 'post', - '/v1/refunds' - ); - $resource = Refund::create([ - "charge" => "ch_123" - ]); - $this->assertInstanceOf("Stripe\\Refund", $resource); - } - - public function testIsSaveable() - { - $resource = Refund::retrieve(self::TEST_RESOURCE_ID); - $resource->metadata["key"] = "value"; - $this->expectsRequest( - 'post', - '/v1/refunds/' . $resource->id - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\Refund", $resource); - } - - public function testIsUpdatable() - { - $this->expectsRequest( - 'post', - '/v1/refunds/' . self::TEST_RESOURCE_ID - ); - $resource = Refund::update(self::TEST_RESOURCE_ID, [ - "metadata" => ["key" => "value"], - ]); - $this->assertInstanceOf("Stripe\\Refund", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/Reporting/ReportRunTest.php b/vendor/stripe/stripe-php/tests/Stripe/Reporting/ReportRunTest.php deleted file mode 100644 index a7807040..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/Reporting/ReportRunTest.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -namespace Stripe\Reporting; - -class ReportRunTest extends \Stripe\TestCase -{ - const TEST_RESOURCE_ID = 'frr_123'; - - public function testIsCreatable() - { - $params = [ - "parameters" => [ - "connected_account" => "acct_123" - ], - "report_type" => "activity.summary.1", - ]; - - $this->expectsRequest( - 'post', - '/v1/reporting/report_runs', - $params - ); - $resource = ReportRun::create($params); - $this->assertInstanceOf("Stripe\\Reporting\\ReportRun", $resource); - } - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/reporting/report_runs' - ); - $resources = ReportRun::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Reporting\\ReportRun", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/reporting/report_runs/' . self::TEST_RESOURCE_ID - ); - $resource = ReportRun::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Reporting\\ReportRun", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/Reporting/ReportTypeTest.php b/vendor/stripe/stripe-php/tests/Stripe/Reporting/ReportTypeTest.php deleted file mode 100644 index d3777850..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/Reporting/ReportTypeTest.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Stripe\Reporting; - -class ReportTypeTest extends \Stripe\TestCase -{ - const TEST_RESOURCE_ID = 'activity.summary.1'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/reporting/report_types' - ); - $resources = ReportType::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Reporting\\ReportType", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/reporting/report_types/' . self::TEST_RESOURCE_ID - ); - $resource = ReportType::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Reporting\\ReportType", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/SKUTest.php b/vendor/stripe/stripe-php/tests/Stripe/SKUTest.php deleted file mode 100644 index d4fc2ad4..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/SKUTest.php +++ /dev/null @@ -1,82 +0,0 @@ -<?php - -namespace Stripe; - -class SKUTest extends TestCase -{ - const TEST_RESOURCE_ID = 'sku_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/skus' - ); - $resources = SKU::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\SKU", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/skus/' . self::TEST_RESOURCE_ID - ); - $resource = SKU::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\SKU", $resource); - } - - public function testIsCreatable() - { - $this->expectsRequest( - 'post', - '/v1/skus' - ); - $resource = SKU::create([ - 'currency' => 'usd', - 'inventory' => [ - 'type' => 'finite', - 'quantity' => 1 - ], - 'price' => 100, - 'product' => "prod_123" - ]); - $this->assertInstanceOf("Stripe\\SKU", $resource); - } - - public function testIsSaveable() - { - $resource = SKU::retrieve(self::TEST_RESOURCE_ID); - $resource->metadata["key"] = "value"; - $this->expectsRequest( - 'post', - '/v1/skus/' . $resource->id - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\SKU", $resource); - } - - public function testIsUpdatable() - { - $this->expectsRequest( - 'post', - '/v1/skus/' . self::TEST_RESOURCE_ID - ); - $resource = SKU::update(self::TEST_RESOURCE_ID, [ - "metadata" => ["key" => "value"], - ]); - $this->assertInstanceOf("Stripe\\SKU", $resource); - } - - public function testIsDeletable() - { - $resource = SKU::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'delete', - '/v1/skus/' . $resource->id - ); - $resource->delete(); - $this->assertInstanceOf("Stripe\\SKU", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/Sigma/ScheduledQueryRunTest.php b/vendor/stripe/stripe-php/tests/Stripe/Sigma/ScheduledQueryRunTest.php deleted file mode 100644 index f79e230b..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/Sigma/ScheduledQueryRunTest.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -namespace Stripe\Sigma; - -class AuthorizationTest extends \Stripe\TestCase -{ - const TEST_RESOURCE_ID = 'sqr_123'; - - public function testIsListable() - { - $resources = ScheduledQueryRun::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Sigma\\ScheduledQueryRun", $resources->data[0]); - } - - public function testIsRetrievable() - { - $resource = ScheduledQueryRun::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Sigma\\ScheduledQueryRun", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/SourceTest.php b/vendor/stripe/stripe-php/tests/Stripe/SourceTest.php deleted file mode 100644 index ad11b0d3..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/SourceTest.php +++ /dev/null @@ -1,134 +0,0 @@ -<?php - -namespace Stripe; - -class SourceTest extends TestCase -{ - const TEST_RESOURCE_ID = 'src_123'; - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/sources/' . self::TEST_RESOURCE_ID - ); - $resource = Source::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Source", $resource); - } - - public function testIsCreatable() - { - $this->expectsRequest( - 'post', - '/v1/sources' - ); - $resource = Source::create([ - "type" => "card" - ]); - $this->assertInstanceOf("Stripe\\Source", $resource); - } - - public function testIsSaveable() - { - $resource = Source::retrieve(self::TEST_RESOURCE_ID); - $resource->metadata["key"] = "value"; - $this->expectsRequest( - 'post', - '/v1/sources/' . $resource->id - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\Source", $resource); - } - - public function testIsUpdatable() - { - $this->expectsRequest( - 'post', - '/v1/sources/' . self::TEST_RESOURCE_ID - ); - $resource = Source::update(self::TEST_RESOURCE_ID, [ - "metadata" => ["key" => "value"], - ]); - $this->assertInstanceOf("Stripe\\Source", $resource); - } - - public function testCanSaveCardExpiryDate() - { - $response = [ - 'id' => 'src_foo', - 'object' => 'source', - 'card' => [ - 'exp_month' => 8, - 'exp_year' => 2019, - ], - ]; - $source = Source::constructFrom($response); - - $response['card']['exp_month'] = 12; - $response['card']['exp_year'] = 2022; - $this->stubRequest( - 'POST', - '/v1/sources/src_foo', - [ - 'card' => [ - 'exp_month' => 12, - 'exp_year' => 2022, - ] - ], - null, - false, - $response - ); - - $source->card->exp_month = 12; - $source->card->exp_year = 2022; - $source->save(); - - $this->assertSame(12, $source->card->exp_month); - $this->assertSame(2022, $source->card->exp_year); - } - - public function testIsDetachableWhenAttached() - { - $resource = Source::retrieve(self::TEST_RESOURCE_ID); - $resource->customer = "cus_123"; - $this->expectsRequest( - 'delete', - '/v1/customers/cus_123/sources/' . $resource->id - ); - $resource->delete(); - $this->assertInstanceOf("Stripe\\Source", $resource); - } - - /** - * @expectedException \Stripe\Error\Api - */ - public function testIsNotDetachableWhenUnattached() - { - $resource = Source::retrieve(self::TEST_RESOURCE_ID); - $resource->detach(); - } - - public function testCanListSourceTransactions() - { - $source = Source::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'get', - '/v1/sources/' . $source->id . "/source_transactions" - ); - $resources = $source->sourceTransactions(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\SourceTransaction", $resources->data[0]); - } - - public function testCanVerify() - { - $resource = Source::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'post', - '/v1/sources/' . $resource->id . "/verify" - ); - $resource->verify(["values" => [32, 45]]); - $this->assertInstanceOf("Stripe\\Source", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/StripeObjectTest.php b/vendor/stripe/stripe-php/tests/Stripe/StripeObjectTest.php deleted file mode 100644 index 2e841fd8..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/StripeObjectTest.php +++ /dev/null @@ -1,476 +0,0 @@ -<?php - -namespace Stripe; - -class StripeObjectTest extends TestCase -{ - /** - * @before - */ - public function setUpReflectors() - { - // Sets up reflectors needed by some tests to access protected or - // private attributes. - - // This is used to invoke the `deepCopy` protected function - $this->deepCopyReflector = new \ReflectionMethod('Stripe\\StripeObject', 'deepCopy'); - $this->deepCopyReflector->setAccessible(true); - - // This is used to access the `_opts` protected variable - $this->optsReflector = new \ReflectionProperty('Stripe\\StripeObject', '_opts'); - $this->optsReflector->setAccessible(true); - } - - public function testArrayAccessorsSemantics() - { - $s = new StripeObject(); - $s['foo'] = 'a'; - $this->assertSame($s['foo'], 'a'); - $this->assertTrue(isset($s['foo'])); - unset($s['foo']); - $this->assertFalse(isset($s['foo'])); - } - - public function testNormalAccessorsSemantics() - { - $s = new StripeObject(); - $s->foo = 'a'; - $this->assertSame($s->foo, 'a'); - $this->assertTrue(isset($s->foo)); - unset($s->foo); - $this->assertFalse(isset($s->foo)); - } - - public function testArrayAccessorsMatchNormalAccessors() - { - $s = new StripeObject(); - $s->foo = 'a'; - $this->assertSame($s['foo'], 'a'); - - $s['bar'] = 'b'; - $this->assertSame($s->bar, 'b'); - } - - public function testCount() - { - $s = new StripeObject(); - $this->assertSame(0, count($s)); - - $s['key1'] = 'value1'; - $this->assertSame(1, count($s)); - - $s['key2'] = 'value2'; - $this->assertSame(2, count($s)); - - unset($s['key1']); - $this->assertSame(1, count($s)); - } - - public function testKeys() - { - $s = new StripeObject(); - $s->foo = 'bar'; - $this->assertSame($s->keys(), ['foo']); - } - - public function testValues() - { - $s = new StripeObject(); - $s->foo = 'bar'; - $this->assertSame($s->values(), ['bar']); - } - - public function testToArray() - { - $s = new StripeObject(); - $s->foo = 'a'; - - $converted = $s->__toArray(); - - $this->assertInternalType('array', $converted); - $this->assertArrayHasKey('foo', $converted); - $this->assertEquals('a', $converted['foo']); - } - - public function testRecursiveToArray() - { - $s = new StripeObject(); - $z = new StripeObject(); - - $s->child = $z; - $z->foo = 'a'; - - $converted = $s->__toArray(true); - - $this->assertInternalType('array', $converted); - $this->assertArrayHasKey('child', $converted); - $this->assertInternalType('array', $converted['child']); - $this->assertArrayHasKey('foo', $converted['child']); - $this->assertEquals('a', $converted['child']['foo']); - } - - public function testNonexistentProperty() - { - $s = new StripeObject(); - $this->assertNull($s->nonexistent); - } - - public function testPropertyDoesNotExists() - { - $s = new StripeObject(); - $this->assertNull($s['nonexistent']); - } - - public function testJsonEncode() - { - $s = new StripeObject(); - $s->foo = 'a'; - - $this->assertEquals('{"foo":"a"}', json_encode($s)); - } - - public function testToString() - { - $s = new StripeObject(); - $s->foo = 'a'; - - $string = $s->__toString(); - $expected = <<<EOS -Stripe\StripeObject JSON: { - "foo": "a" -} -EOS; - $this->assertEquals($expected, $string); - } - - public function testReplaceNewNestedUpdatable() - { - $s = new StripeObject(); - - $s->metadata = ['bar']; - $this->assertSame($s->metadata, ['bar']); - $s->metadata = ['baz', 'qux']; - $this->assertSame($s->metadata, ['baz', 'qux']); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testSetPermanentAttribute() - { - $s = new StripeObject(); - $s->id = 'abc_123'; - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testSetEmptyStringValue() - { - $s = new StripeObject(); - $s->foo = ''; - } - - public function testSerializeParametersOnEmptyObject() - { - $obj = StripeObject::constructFrom([]); - $this->assertSame([], $obj->serializeParameters()); - } - - public function testSerializeParametersOnNewObjectWithSubObject() - { - $obj = new StripeObject(); - $obj->metadata = ['foo' => 'bar']; - $this->assertSame(['metadata' => ['foo' => 'bar']], $obj->serializeParameters()); - } - - public function testSerializeParametersOnBasicObject() - { - $obj = StripeObject::constructFrom(['foo' => null]); - $obj->updateAttributes(['foo' => 'bar']); - $this->assertSame(['foo' => 'bar'], $obj->serializeParameters()); - } - - public function testSerializeParametersOnMoreComplexObject() - { - $obj = StripeObject::constructFrom([ - 'foo' => StripeObject::constructFrom([ - 'bar' => null, - 'baz' => null, - ]), - ]); - $obj->foo->bar = 'newbar'; - $this->assertSame(['foo' => ['bar' => 'newbar']], $obj->serializeParameters()); - } - - public function testSerializeParametersOnArray() - { - $obj = StripeObject::constructFrom([ - 'foo' => null, - ]); - $obj->foo = ['new-value']; - $this->assertSame(['foo' => ['new-value']], $obj->serializeParameters()); - } - - public function testSerializeParametersOnArrayThatShortens() - { - $obj = StripeObject::constructFrom([ - 'foo' => ['0-index', '1-index', '2-index'], - ]); - $obj->foo = ['new-value']; - $this->assertSame(['foo' => ['new-value']], $obj->serializeParameters()); - } - - public function testSerializeParametersOnArrayThatLengthens() - { - $obj = StripeObject::constructFrom([ - 'foo' => ['0-index', '1-index', '2-index'], - ]); - $obj->foo = array_fill(0, 4, 'new-value'); - $this->assertSame(['foo' => array_fill(0, 4, 'new-value')], $obj->serializeParameters()); - } - - public function testSerializeParametersOnArrayOfHashes() - { - $obj = StripeObject::constructFrom(['foo' => null]); - $obj->foo = [ - StripeObject::constructFrom(['bar' => null]), - ]; - - $obj->foo[0]->bar = 'baz'; - $this->assertSame(['foo' => [['bar' => 'baz']]], $obj->serializeParameters()); - } - - public function testSerializeParametersDoesNotIncludeUnchangedValues() - { - $obj = StripeObject::constructFrom([ - 'foo' => null, - ]); - $this->assertSame([], $obj->serializeParameters()); - } - - public function testSerializeParametersOnUnchangedArray() - { - $obj = StripeObject::constructFrom([ - 'foo' => ['0-index', '1-index', '2-index'], - ]); - $obj->foo = ['0-index', '1-index', '2-index']; - $this->assertSame([], $obj->serializeParameters()); - } - - public function testSerializeParametersWithStripeObject() - { - $obj = StripeObject::constructFrom([]); - $obj->metadata = StripeObject::constructFrom(['foo' => 'bar']); - - $serialized = $obj->serializeParameters(); - $this->assertSame(['foo' => 'bar'], $serialized['metadata']); - } - - public function testSerializeParametersOnReplacedStripeObject() - { - $obj = StripeObject::constructFrom([ - 'source' => StripeObject::constructFrom(['bar' => 'foo']), - ]); - $obj->source = StripeObject::constructFrom(['baz' => 'foo']); - - $serialized = $obj->serializeParameters(); - $this->assertSame(['baz' => 'foo'], $serialized['source']); - } - - public function testSerializeParametersOnReplacedStripeObjectWhichIsMetadata() - { - $obj = StripeObject::constructFrom([ - 'metadata' => StripeObject::constructFrom(['bar' => 'foo']), - ]); - $obj->metadata = StripeObject::constructFrom(['baz' => 'foo']); - - $serialized = $obj->serializeParameters(); - $this->assertSame(['bar' => '', 'baz' => 'foo'], $serialized['metadata']); - } - - public function testSerializeParametersOnArrayOfStripeObjects() - { - $obj = StripeObject::constructFrom([]); - $obj->metadata = [ - StripeObject::constructFrom(['foo' => 'bar']), - ]; - - $serialized = $obj->serializeParameters(); - $this->assertSame([['foo' => 'bar']], $serialized['metadata']); - } - - public function testSerializeParametersOnSetApiResource() - { - $customer = Customer::constructFrom(['id' => 'cus_123']); - $obj = StripeObject::constructFrom([]); - - // the key here is that the property is set explicitly (and therefore - // marked as unsaved), which is why it gets included below - $obj->customer = $customer; - - $serialized = $obj->serializeParameters(); - $this->assertSame(['customer' => $customer], $serialized); - } - - public function testSerializeParametersOnNotSetApiResource() - { - $customer = Customer::constructFrom(['id' => 'cus_123']); - $obj = StripeObject::constructFrom(['customer' => $customer]); - - $serialized = $obj->serializeParameters(); - $this->assertSame([], $serialized); - } - - public function testSerializeParametersOnApiResourceFlaggedWithSaveWithParent() - { - $customer = Customer::constructFrom(['id' => 'cus_123']); - $customer->saveWithParent = true; - - $obj = StripeObject::constructFrom(['customer' => $customer]); - - $serialized = $obj->serializeParameters(); - $this->assertSame(['customer' => []], $serialized); - } - - public function testSerializeParametersRaisesExceotionOnOtherEmbeddedApiResources() - { - // This customer doesn't have an ID and therefore the library doesn't know - // what to do with it and throws an InvalidArgumentException because it's - // probably not what the user expected to happen. - $customer = Customer::constructFrom([]); - - $obj = StripeObject::constructFrom([]); - $obj->customer = $customer; - - try { - $serialized = $obj->serializeParameters(); - $this->fail("Did not raise error"); - } catch (\InvalidArgumentException $e) { - $this->assertSame( - "Cannot save property `customer` containing an API resource of type Stripe\Customer. " . - "It doesn't appear to be persisted and is not marked as `saveWithParent`.", - $e->getMessage() - ); - } catch (\Exception $e) { - $this->fail("Unexpected exception: " . get_class($e)); - } - } - - public function testSerializeParametersForce() - { - $obj = StripeObject::constructFrom([ - 'id' => 'id', - 'metadata' => StripeObject::constructFrom([ - 'bar' => 'foo', - ]), - ]); - - $serialized = $obj->serializeParameters(true); - $this->assertSame(['id' => 'id', 'metadata' => ['bar' => 'foo']], $serialized); - } - - public function testDirty() - { - $obj = StripeObject::constructFrom([ - 'id' => 'id', - 'metadata' => StripeObject::constructFrom([ - 'bar' => 'foo', - ]), - ]); - - // note that `$force` and `dirty()` are for different things, but are - // functionally equivalent - $obj->dirty(); - - $serialized = $obj->serializeParameters(); - $this->assertSame(['id' => 'id', 'metadata' => ['bar' => 'foo']], $serialized); - } - - public function testDeepCopy() - { - $opts = [ - "api_base" => Stripe::$apiBase, - "api_key" => "apikey", - ]; - $values = [ - "id" => 1, - "name" => "Stripe", - "arr" => [ - StripeObject::constructFrom(["id" => "index0"], $opts), - "index1", - 2, - ], - "map" => [ - "0" => StripeObject::constructFrom(["id" => "index0"], $opts), - "1" => "index1", - "2" => 2 - ], - ]; - - $copyValues = $this->deepCopyReflector->invoke(null, $values); - - // we can't compare the hashes directly because they have embedded - // objects which are different from each other - $this->assertEquals($values["id"], $copyValues["id"]); - $this->assertEquals($values["name"], $copyValues["name"]); - $this->assertEquals(count($values["arr"]), count($copyValues["arr"])); - - // internal values of the copied StripeObject should be the same, - // but the object itself should be new (hence the assertNotSame) - $this->assertEquals($values["arr"][0]["id"], $copyValues["arr"][0]["id"]); - $this->assertNotSame($values["arr"][0], $copyValues["arr"][0]); - - // likewise, the Util\RequestOptions instance in _opts should have - // copied values but be a new instance - $this->assertEquals( - $this->optsReflector->getValue($values["arr"][0]), - $this->optsReflector->getValue($copyValues["arr"][0]) - ); - $this->assertNotSame( - $this->optsReflector->getValue($values["arr"][0]), - $this->optsReflector->getValue($copyValues["arr"][0]) - ); - - // scalars however, can be compared - $this->assertEquals($values["arr"][1], $copyValues["arr"][1]); - $this->assertEquals($values["arr"][2], $copyValues["arr"][2]); - - // and a similar story with the hash - $this->assertEquals($values["map"]["0"]["id"], $copyValues["map"]["0"]["id"]); - $this->assertNotSame($values["map"]["0"], $copyValues["map"]["0"]); - $this->assertNotSame( - $this->optsReflector->getValue($values["arr"][0]), - $this->optsReflector->getValue($copyValues["arr"][0]) - ); - $this->assertEquals( - $this->optsReflector->getValue($values["map"]["0"]), - $this->optsReflector->getValue($copyValues["map"]["0"]) - ); - $this->assertNotSame( - $this->optsReflector->getValue($values["map"]["0"]), - $this->optsReflector->getValue($copyValues["map"]["0"]) - ); - $this->assertEquals($values["map"]["1"], $copyValues["map"]["1"]); - $this->assertEquals($values["map"]["2"], $copyValues["map"]["2"]); - } - - public function testDeepCopyMaintainClass() - { - $charge = Charge::constructFrom(["id" => 1], null); - $copyCharge = $this->deepCopyReflector->invoke(null, $charge); - $this->assertEquals(get_class($charge), get_class($copyCharge)); - } - - public function testIsDeleted() - { - $obj = StripeObject::constructFrom([]); - $this->assertFalse($obj->isDeleted()); - - $obj = StripeObject::constructFrom(['deleted' => false]); - $this->assertFalse($obj->isDeleted()); - - $obj = StripeObject::constructFrom(['deleted' => true]); - $this->assertTrue($obj->isDeleted()); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/StripeTest.php b/vendor/stripe/stripe-php/tests/Stripe/StripeTest.php deleted file mode 100644 index f594518d..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/StripeTest.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -namespace Stripe; - -class StripeTest extends TestCase -{ - /** - * @before - */ - public function saveOriginalValues() - { - $this->orig = [ - 'caBundlePath' => Stripe::$caBundlePath, - ]; - } - - /** - * @after - */ - public function restoreOriginalValues() - { - Stripe::$caBundlePath = $this->orig['caBundlePath']; - } - - public function testCABundlePathAccessors() - { - Stripe::setCABundlePath('path/to/ca/bundle'); - $this->assertEquals('path/to/ca/bundle', Stripe::getCABundlePath()); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/SubscriptionItemTest.php b/vendor/stripe/stripe-php/tests/Stripe/SubscriptionItemTest.php deleted file mode 100644 index 2432820f..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/SubscriptionItemTest.php +++ /dev/null @@ -1,94 +0,0 @@ -<?php - -namespace Stripe; - -class SubscriptionItemTest extends TestCase -{ - const TEST_RESOURCE_ID = 'si_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/subscription_items', - [ - "subscription" => "sub_123" - ] - ); - $resources = SubscriptionItem::all([ - "subscription" => "sub_123" - ]); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\SubscriptionItem", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/subscription_items/' . self::TEST_RESOURCE_ID - ); - $resource = SubscriptionItem::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\SubscriptionItem", $resource); - } - - public function testIsCreatable() - { - $this->expectsRequest( - 'post', - '/v1/subscription_items' - ); - $resource = SubscriptionItem::create([ - "plan" => "plan", - "subscription" => "sub_123" - ]); - $this->assertInstanceOf("Stripe\\SubscriptionItem", $resource); - } - - public function testIsSaveable() - { - $resource = SubscriptionItem::retrieve(self::TEST_RESOURCE_ID); - $resource->metadata["key"] = "value"; - $this->expectsRequest( - 'post', - '/v1/subscription_items/' . $resource->id - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\SubscriptionItem", $resource); - } - - public function testIsUpdatable() - { - $this->expectsRequest( - 'post', - '/v1/subscription_items/' . self::TEST_RESOURCE_ID - ); - $resource = SubscriptionItem::update(self::TEST_RESOURCE_ID, [ - "metadata" => ["key" => "value"], - ]); - $this->assertInstanceOf("Stripe\\SubscriptionItem", $resource); - } - - public function testIsDeletable() - { - $resource = SubscriptionItem::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'delete', - '/v1/subscription_items/' . $resource->id - ); - $resource->delete(); - $this->assertInstanceOf("Stripe\\SubscriptionItem", $resource); - } - - public function testCanListUsageRecordSummaries() - { - $resource = SubscriptionItem::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'get', - '/v1/subscription_items/' . $resource->id . "/usage_record_summaries" - ); - $resources = $resource->usageRecordSummaries(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\UsageRecordSummary", $resources->data[0]); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/SubscriptionTest.php b/vendor/stripe/stripe-php/tests/Stripe/SubscriptionTest.php deleted file mode 100644 index 59b92e8f..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/SubscriptionTest.php +++ /dev/null @@ -1,110 +0,0 @@ -<?php - -namespace Stripe; - -class SubscriptionTest extends TestCase -{ - const TEST_RESOURCE_ID = 'sub_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/subscriptions' - ); - $resources = Subscription::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Subscription", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/subscriptions/' . self::TEST_RESOURCE_ID - ); - $resource = Subscription::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Subscription", $resource); - } - - public function testIsCreatable() - { - $this->expectsRequest( - 'post', - '/v1/subscriptions' - ); - $resource = Subscription::create([ - "customer" => "cus_123" - ]); - $this->assertInstanceOf("Stripe\\Subscription", $resource); - } - - public function testIsSaveable() - { - $resource = Subscription::retrieve(self::TEST_RESOURCE_ID); - $resource->metadata["key"] = "value"; - $this->expectsRequest( - 'post', - '/v1/subscriptions/' . $resource->id - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\Subscription", $resource); - } - - public function testIsUpdatable() - { - $this->expectsRequest( - 'post', - '/v1/subscriptions/' . self::TEST_RESOURCE_ID - ); - $resource = Subscription::update(self::TEST_RESOURCE_ID, [ - "metadata" => ["key" => "value"], - ]); - $this->assertInstanceOf("Stripe\\Subscription", $resource); - } - - public function testIsCancelable() - { - $resource = Subscription::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'delete', - '/v1/subscriptions/' . $resource->id, - [] - ); - $resource->cancel([]); - $this->assertInstanceOf("Stripe\\Subscription", $resource); - } - - public function testCanDeleteDiscount() - { - $resource = Subscription::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'delete', - '/v1/subscriptions/' . $resource->id . '/discount' - ); - $resource->deleteDiscount(); - $this->assertInstanceOf("Stripe\\Subscription", $resource); - } - - public function testSerializeParametersItems() - { - $obj = Util\Util::convertToStripeObject([ - 'object' => 'subscription', - 'items' => Util\Util::convertToStripeObject([ - 'object' => 'list', - 'data' => [], - ], null), - ], null); - $obj->items = [ - ['id' => 'si_foo', 'deleted' => true], - ['plan' => 'plan_bar'], - ]; - $expected = [ - 'items' => [ - 0 => ['id' => 'si_foo', 'deleted' => true], - 1 => ['plan' => 'plan_bar'], - ], - ]; - $this->assertSame($expected, $obj->serializeParameters()); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/Terminal/ConnectionTokenTest.php b/vendor/stripe/stripe-php/tests/Stripe/Terminal/ConnectionTokenTest.php deleted file mode 100644 index bbb1609f..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/Terminal/ConnectionTokenTest.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Stripe\Terminal; - -class ConnectionTokenTest extends \Stripe\TestCase -{ - public function testIsCreatable() - { - $this->expectsRequest( - 'post', - '/v1/terminal/connection_tokens' - ); - $resource = ConnectionToken::create(); - $this->assertInstanceOf("Stripe\\Terminal\\ConnectionToken", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/Terminal/LocationTest.php b/vendor/stripe/stripe-php/tests/Stripe/Terminal/LocationTest.php deleted file mode 100644 index d14b0d3a..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/Terminal/LocationTest.php +++ /dev/null @@ -1,84 +0,0 @@ -<?php - -namespace Stripe\Terminal; - -class LocationTest extends \Stripe\TestCase -{ - const TEST_RESOURCE_ID = 'loc_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/terminal/locations' - ); - $resources = Location::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Terminal\\Location", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/terminal/locations/' . self::TEST_RESOURCE_ID - ); - $resource = Location::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Terminal\\Location", $resource); - } - - public function testIsSaveable() - { - $resource = Location::retrieve(self::TEST_RESOURCE_ID); - $resource->display_name = "new-name"; - - $this->expectsRequest( - 'post', - '/v1/terminal/locations/' . self::TEST_RESOURCE_ID - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\Terminal\\Location", $resource); - } - - public function testIsUpdatable() - { - $this->expectsRequest( - 'post', - '/v1/terminal/locations/' . self::TEST_RESOURCE_ID, - ["display_name" => "new-name"] - ); - $resource = Location::update(self::TEST_RESOURCE_ID, [ - "display_name" => "new-name", - ]); - $this->assertInstanceOf("Stripe\\Terminal\\Location", $resource); - } - - public function testIsCreatable() - { - $this->expectsRequest( - 'post', - '/v1/terminal/locations', - [ - "display_name" => "name", - "address" => [ - "line1" => "line1", - "country" => "US", - "state" => "CA", - "postal_code" => "12345", - "city" => "San Francisco" - ] - ] - ); - $resource = Location::create([ - "display_name" => "name", - "address" => [ - "line1" => "line1", - "country" => "US", - "state" => "CA", - "postal_code" => "12345", - "city" => "San Francisco" - ] - ]); - $this->assertInstanceOf("Stripe\\Terminal\\Location", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/Terminal/ReaderTest.php b/vendor/stripe/stripe-php/tests/Stripe/Terminal/ReaderTest.php deleted file mode 100644 index 19077284..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/Terminal/ReaderTest.php +++ /dev/null @@ -1,66 +0,0 @@ -<?php - -namespace Stripe\Terminal; - -class ReaderTest extends \Stripe\TestCase -{ - const TEST_RESOURCE_ID = 'rdr_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/terminal/readers' - ); - $resources = Reader::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Terminal\\Reader", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/terminal/readers/' . self::TEST_RESOURCE_ID - ); - $resource = Reader::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Terminal\\Reader", $resource); - } - - public function testIsSaveable() - { - $resource = Reader::retrieve(self::TEST_RESOURCE_ID); - $resource->label = "new-name"; - - $this->expectsRequest( - 'post', - '/v1/terminal/readers/' . self::TEST_RESOURCE_ID - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\Terminal\\Reader", $resource); - } - - public function testIsUpdatable() - { - $this->expectsRequest( - 'post', - '/v1/terminal/readers/' . self::TEST_RESOURCE_ID, - ["label" => "new-name"] - ); - $resource = Reader::update(self::TEST_RESOURCE_ID, [ - "label" => "new-name", - ]); - $this->assertInstanceOf("Stripe\\Terminal\\Reader", $resource); - } - - public function testIsCreatable() - { - $this->expectsRequest( - 'post', - '/v1/terminal/readers', - ["registration_code" => "a-b-c"] - ); - $resource = Reader::create(['registration_code' => 'a-b-c']); - $this->assertInstanceOf("Stripe\\Terminal\\Reader", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/ThreeDSecureTest.php b/vendor/stripe/stripe-php/tests/Stripe/ThreeDSecureTest.php deleted file mode 100644 index f56e649c..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/ThreeDSecureTest.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -namespace Stripe; - -class ThreeDSecureTest extends TestCase -{ - const TEST_RESOURCE_ID = 'tdsrc_123'; - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/3d_secure/' . self::TEST_RESOURCE_ID - ); - $resource = ThreeDSecure::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\ThreeDSecure", $resource); - } - - public function testIsCreatable() - { - $this->expectsRequest( - 'post', - '/v1/3d_secure' - ); - $resource = ThreeDSecure::create([ - "amount" => 100, - "currency" => "usd", - "return_url" => "url" - ]); - $this->assertInstanceOf("Stripe\\ThreeDSecure", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/TokenTest.php b/vendor/stripe/stripe-php/tests/Stripe/TokenTest.php deleted file mode 100644 index 36bb4bc8..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/TokenTest.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -namespace Stripe; - -class TokenTest extends TestCase -{ - const TEST_RESOURCE_ID = 'tok_123'; - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/tokens/' . self::TEST_RESOURCE_ID - ); - $resource = Token::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Token", $resource); - } - - public function testIsCreatable() - { - $this->expectsRequest( - 'post', - '/v1/tokens' - ); - $resource = Token::create(["card" => "tok_visa"]); - $this->assertInstanceOf("Stripe\\Token", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/TopupTest.php b/vendor/stripe/stripe-php/tests/Stripe/TopupTest.php deleted file mode 100644 index 9990b30e..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/TopupTest.php +++ /dev/null @@ -1,80 +0,0 @@ -<?php - -namespace Stripe; - -class TopupTest extends TestCase -{ - const TEST_RESOURCE_ID = 'tu_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/topups' - ); - $resources = Topup::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Topup", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/topups/' . self::TEST_RESOURCE_ID - ); - $resource = Topup::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Topup", $resource); - } - - public function testIsCreatable() - { - $this->expectsRequest( - 'post', - '/v1/topups' - ); - $resource = Topup::create([ - "amount" => 100, - "currency" => "usd", - "source" => "tok_123", - "description" => "description", - "statement_descriptor" => "statement descriptor" - ]); - $this->assertInstanceOf("Stripe\\Topup", $resource); - } - - public function testIsSaveable() - { - $resource = Topup::retrieve(self::TEST_RESOURCE_ID); - $resource->metadata["key"] = "value"; - $this->expectsRequest( - 'post', - '/v1/topups/' . $resource->id - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\Topup", $resource); - } - - public function testIsUpdatable() - { - $this->expectsRequest( - 'post', - '/v1/topups/' . self::TEST_RESOURCE_ID - ); - $resource = Topup::update(self::TEST_RESOURCE_ID, [ - "metadata" => ["key" => "value"], - ]); - $this->assertInstanceOf("Stripe\\Topup", $resource); - } - - public function testIsCancelable() - { - $resource = Topup::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'post', - '/v1/topups/' . self::TEST_RESOURCE_ID . '/cancel' - ); - $resource = $resource->cancel(); - $this->assertInstanceOf("Stripe\\Topup", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/TransferReversalTest.php b/vendor/stripe/stripe-php/tests/Stripe/TransferReversalTest.php deleted file mode 100644 index 37101c73..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/TransferReversalTest.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -namespace Stripe; - -class TransferReversalTest extends TestCase -{ - const TEST_RESOURCE_ID = 'trr_123'; - const TEST_TRANSFER_ID = 'tr_123'; - - public function testIsSaveable() - { - $resource = Transfer::retrieveReversal(self::TEST_TRANSFER_ID, self::TEST_RESOURCE_ID); - $resource->metadata["key"] = "value"; - $this->expectsRequest( - 'post', - '/v1/transfers/' . $resource->transfer . '/reversals/' . $resource->id - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\TransferReversal", $resource); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/TransferTest.php b/vendor/stripe/stripe-php/tests/Stripe/TransferTest.php deleted file mode 100644 index d60d560e..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/TransferTest.php +++ /dev/null @@ -1,140 +0,0 @@ -<?php - -namespace Stripe; - -class TransferTest extends TestCase -{ - const TEST_RESOURCE_ID = 'tr_123'; - const TEST_REVERSAL_ID = 'trr_123'; - - public function testIsListable() - { - $this->expectsRequest( - 'get', - '/v1/transfers' - ); - $resources = Transfer::all(); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\Transfer", $resources->data[0]); - } - - public function testIsRetrievable() - { - $this->expectsRequest( - 'get', - '/v1/transfers/' . self::TEST_RESOURCE_ID - ); - $resource = Transfer::retrieve(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\Transfer", $resource); - } - - public function testIsCreatable() - { - $this->expectsRequest( - 'post', - '/v1/transfers' - ); - $resource = Transfer::create([ - "amount" => 100, - "currency" => "usd", - "destination" => "acct_123" - ]); - $this->assertInstanceOf("Stripe\\Transfer", $resource); - } - - public function testIsSaveable() - { - $resource = Transfer::retrieve(self::TEST_RESOURCE_ID); - $resource->metadata["key"] = "value"; - $this->expectsRequest( - 'post', - '/v1/transfers/' . $resource->id - ); - $resource->save(); - $this->assertInstanceOf("Stripe\\Transfer", $resource); - } - - public function testIsUpdatable() - { - $this->expectsRequest( - 'post', - '/v1/transfers/' . self::TEST_RESOURCE_ID - ); - $resource = Transfer::update(self::TEST_RESOURCE_ID, [ - "metadata" => ["key" => "value"], - ]); - $this->assertInstanceOf("Stripe\\Transfer", $resource); - } - - public function testIsReversable() - { - $resource = Transfer::retrieve(self::TEST_RESOURCE_ID); - $this->expectsRequest( - 'post', - '/v1/transfers/' . $resource->id . '/reversals' - ); - $resource->reverse(); - $this->assertInstanceOf("Stripe\\Transfer", $resource); - } - - public function testIsCancelable() - { - $transfer = Transfer::retrieve(self::TEST_RESOURCE_ID); - - // stripe-mock does not support this anymore so we stub it - $this->stubRequest( - 'post', - '/v1/transfers/' . $transfer->id . '/cancel' - ); - $resource = $transfer->cancel(); - $this->assertInstanceOf("Stripe\\Transfer", $resource); - $this->assertSame($resource, $transfer); - } - - public function testCanCreateReversal() - { - $this->expectsRequest( - 'post', - '/v1/transfers/' . self::TEST_RESOURCE_ID . '/reversals' - ); - $resource = Transfer::createReversal(self::TEST_RESOURCE_ID); - $this->assertInstanceOf("Stripe\\TransferReversal", $resource); - } - - public function testCanRetrieveReversal() - { - $this->expectsRequest( - 'get', - '/v1/transfers/' . self::TEST_RESOURCE_ID . '/reversals/' . self::TEST_REVERSAL_ID - ); - $resource = Transfer::retrieveReversal(self::TEST_RESOURCE_ID, self::TEST_REVERSAL_ID); - $this->assertInstanceOf("Stripe\\TransferReversal", $resource); - } - - public function testCanUpdateReversal() - { - $this->expectsRequest( - 'post', - '/v1/transfers/' . self::TEST_RESOURCE_ID . '/reversals/' . self::TEST_REVERSAL_ID - ); - $resource = Transfer::updateReversal( - self::TEST_RESOURCE_ID, - self::TEST_REVERSAL_ID, - [ - "metadata" => ["key" => "value"], - ] - ); - $this->assertInstanceOf("Stripe\\TransferReversal", $resource); - } - - public function testCanListReversal() - { - $this->expectsRequest( - 'get', - '/v1/transfers/' . self::TEST_RESOURCE_ID . '/reversals' - ); - $resources = Transfer::allReversals(self::TEST_RESOURCE_ID); - $this->assertTrue(is_array($resources->data)); - $this->assertInstanceOf("Stripe\\TransferReversal", $resources->data[0]); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/UsageRecordTest.php b/vendor/stripe/stripe-php/tests/Stripe/UsageRecordTest.php deleted file mode 100644 index c5fe3730..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/UsageRecordTest.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -namespace Stripe; - -class UsageRecordTest extends TestCase -{ - const TEST_RESOURCE_ID = 'usage_record'; - - public function testIsCreatable() - { - $this->expectsRequest( - 'post', - '/v1/subscription_items/si_123/usage_records' - ); - $resource = UsageRecord::create([ - 'subscription_item' => 'si_123', - 'quantity' => 100, - 'timestamp' => 12341234, - 'action' => 'set' - ]); - $this->assertInstanceOf("Stripe\\UsageRecord", $resource); - } - - /** - * @expectedException \Stripe\Error\InvalidRequest - */ - public function testThrowsIfSubscriptionItemIsMissing() - { - UsageRecord::create([ - 'quantity' => 100, - 'timestamp' => 12341234, - 'action' => 'set' - ]); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/Util/DefaultLoggerTest.php b/vendor/stripe/stripe-php/tests/Stripe/Util/DefaultLoggerTest.php deleted file mode 100644 index 711af03c..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/Util/DefaultLoggerTest.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -// Test in a slightly different namespace than usual. See comment on -// `error_log` below. -namespace Stripe\Util; - -class UtilLoggerTest extends \Stripe\TestCase -{ - public function testDefaultLogger() - { - $logger = new DefaultLogger(); - $logger->error("message"); - - global $lastMessage; - $this->assertSame($lastMessage, "message"); - } -} - -// This is a little terrible, but unfortunately there's no clean way to stub a -// call to `error_log`. Here we overwrite it so that we can get the last arguments -// that went to it. This is obviously bad, but luckily it's constrained to -// being just in \Stripe\Util (i.e. won't interfere with PHPUnit for example) -// and _just_ present when tests are running. -function error_log($message) -{ - global $lastMessage; - $lastMessage = $message; -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/Util/RequestOptionsTest.php b/vendor/stripe/stripe-php/tests/Stripe/Util/RequestOptionsTest.php deleted file mode 100644 index 558f7398..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/Util/RequestOptionsTest.php +++ /dev/null @@ -1,81 +0,0 @@ -<?php - -namespace Stripe; - -class RequestOptionsTest extends TestCase -{ - public function testStringAPIKey() - { - $opts = Util\RequestOptions::parse("foo"); - $this->assertSame("foo", $opts->apiKey); - $this->assertSame([], $opts->headers); - } - - public function testNull() - { - $opts = Util\RequestOptions::parse(null); - $this->assertSame(null, $opts->apiKey); - $this->assertSame([], $opts->headers); - } - - public function testEmptyArray() - { - $opts = Util\RequestOptions::parse([]); - $this->assertSame(null, $opts->apiKey); - $this->assertSame([], $opts->headers); - } - - public function testAPIKeyArray() - { - $opts = Util\RequestOptions::parse( - [ - 'api_key' => 'foo', - ] - ); - $this->assertSame('foo', $opts->apiKey); - $this->assertSame([], $opts->headers); - } - - public function testIdempotentKeyArray() - { - $opts = Util\RequestOptions::parse( - [ - 'idempotency_key' => 'foo', - ] - ); - $this->assertSame(null, $opts->apiKey); - $this->assertSame(['Idempotency-Key' => 'foo'], $opts->headers); - } - - public function testKeyArray() - { - $opts = Util\RequestOptions::parse( - [ - 'idempotency_key' => 'foo', - 'api_key' => 'foo' - ] - ); - $this->assertSame('foo', $opts->apiKey); - $this->assertSame(['Idempotency-Key' => 'foo'], $opts->headers); - } - - /** - * @expectedException Stripe\Error\Api - */ - public function testWrongType() - { - $opts = Util\RequestOptions::parse(5); - } - - public function testDiscardNonPersistentHeaders() - { - $opts = Util\RequestOptions::parse( - [ - 'stripe_account' => 'foo', - 'idempotency_key' => 'foo', - ] - ); - $opts->discardNonPersistentHeaders(); - $this->assertSame(['Stripe-Account' => 'foo'], $opts->headers); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/Util/UtilTest.php b/vendor/stripe/stripe-php/tests/Stripe/Util/UtilTest.php deleted file mode 100644 index ac3e41af..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/Util/UtilTest.php +++ /dev/null @@ -1,134 +0,0 @@ -<?php - -namespace Stripe; - -class UtilTest extends TestCase -{ - public function testIsList() - { - $list = [5, 'nstaoush', []]; - $this->assertTrue(Util\Util::isList($list)); - - $notlist = [5, 'nstaoush', [], 'bar' => 'baz']; - $this->assertFalse(Util\Util::isList($notlist)); - } - - public function testThatPHPHasValueSemanticsForArrays() - { - $original = ['php-arrays' => 'value-semantics']; - $derived = $original; - $derived['php-arrays'] = 'reference-semantics'; - - $this->assertSame('value-semantics', $original['php-arrays']); - } - - public function testConvertStripeObjectToArrayIncludesId() - { - $customer = Util\Util::convertToStripeObject( - [ - 'id' => 'cus_123', - 'object' => 'customer', - ], - null - ); - $this->assertTrue(array_key_exists("id", $customer->__toArray(true))); - } - - public function testUtf8() - { - // UTF-8 string - $x = "\xc3\xa9"; - $this->assertSame(Util\Util::utf8($x), $x); - - // Latin-1 string - $x = "\xe9"; - $this->assertSame(Util\Util::utf8($x), "\xc3\xa9"); - - // Not a string - $x = true; - $this->assertSame(Util\Util::utf8($x), $x); - } - - public function testObjectsToIds() - { - $params = [ - 'foo' => 'bar', - 'customer' => Util\Util::convertToStripeObject( - [ - 'id' => 'cus_123', - 'object' => 'customer', - ], - null - ), - 'null_value' => null, - ]; - - $this->assertSame( - [ - 'foo' => 'bar', - 'customer' => 'cus_123', - ], - Util\Util::objectsToIds($params) - ); - } - - public function testEncodeParameters() - { - $params = [ - 'a' => 3, - 'b' => '+foo?', - 'c' => 'bar&baz', - 'd' => ['a' => 'a', 'b' => 'b'], - 'e' => [0, 1], - 'f' => '', - - // note the empty hash won't even show up in the request - 'g' => [], - ]; - - $this->assertSame( - "a=3&b=%2Bfoo%3F&c=bar%26baz&d[a]=a&d[b]=b&e[0]=0&e[1]=1&f=", - Util\Util::encodeParameters($params) - ); - } - - public function testUrlEncode() - { - $this->assertSame("foo", Util\Util::urlEncode("foo")); - $this->assertSame("foo%2B", Util\Util::urlEncode("foo+")); - $this->assertSame("foo%26", Util\Util::urlEncode("foo&")); - $this->assertSame("foo[bar]", Util\Util::urlEncode("foo[bar]")); - } - - public function testFlattenParams() - { - $params = [ - 'a' => 3, - 'b' => '+foo?', - 'c' => 'bar&baz', - 'd' => ['a' => 'a', 'b' => 'b'], - 'e' => [0, 1], - 'f' => [ - ['foo' => '1', 'ghi' => '2'], - ['foo' => '3', 'bar' => '4'], - ], - ]; - - $this->assertSame( - [ - ['a', 3], - ['b', '+foo?'], - ['c', 'bar&baz'], - ['d[a]', 'a'], - ['d[b]', 'b'], - ['e[0]', 0], - ['e[1]', 1], - ['f[0][foo]', '1'], - ['f[0][ghi]', '2'], - ['f[1][foo]', '3'], - ['f[1][bar]', '4'], - ], - Util\Util::flattenParams($params) - ); - } -} diff --git a/vendor/stripe/stripe-php/tests/Stripe/WebhookTest.php b/vendor/stripe/stripe-php/tests/Stripe/WebhookTest.php deleted file mode 100644 index dcd82671..00000000 --- a/vendor/stripe/stripe-php/tests/Stripe/WebhookTest.php +++ /dev/null @@ -1,110 +0,0 @@ -<?php - -namespace Stripe; - -class WebhookTest extends TestCase -{ - const EVENT_PAYLOAD = "{ - \"id\": \"evt_test_webhook\", - \"object\": \"event\" -}"; - const SECRET = "whsec_test_secret"; - - private function generateHeader($opts = []) - { - $timestamp = array_key_exists('timestamp', $opts) ? $opts['timestamp'] : time(); - $payload = array_key_exists('payload', $opts) ? $opts['payload'] : self::EVENT_PAYLOAD; - $secret = array_key_exists('secret', $opts) ? $opts['secret'] : self::SECRET; - $scheme = array_key_exists('scheme', $opts) ? $opts['scheme'] : WebhookSignature::EXPECTED_SCHEME; - $signature = array_key_exists('signature', $opts) ? $opts['signature'] : null; - if ($signature === null) { - $signedPayload = "$timestamp.$payload"; - $signature = hash_hmac("sha256", $signedPayload, $secret); - } - return "t=$timestamp,$scheme=$signature"; - } - - public function testValidJsonAndHeader() - { - $sigHeader = $this->generateHeader(); - $event = Webhook::constructEvent(self::EVENT_PAYLOAD, $sigHeader, self::SECRET); - $this->assertEquals("evt_test_webhook", $event->id); - } - - /** - * @expectedException \UnexpectedValueException - */ - public function testInvalidJson() - { - $payload = "this is not valid JSON"; - $sigHeader = $this->generateHeader(["payload" => $payload]); - Webhook::constructEvent($payload, $sigHeader, self::SECRET); - } - - /** - * @expectedException \Stripe\Error\SignatureVerification - */ - public function testValidJsonAndInvalidHeader() - { - $sigHeader = "bad_header"; - Webhook::constructEvent(self::EVENT_PAYLOAD, $sigHeader, self::SECRET); - } - - /** - * @expectedException \Stripe\Error\SignatureVerification - * @expectedExceptionMessage Unable to extract timestamp and signatures from header - */ - public function testMalformedHeader() - { - $sigHeader = "i'm not even a real signature header"; - WebhookSignature::verifyHeader(self::EVENT_PAYLOAD, $sigHeader, self::SECRET); - } - - /** - * @expectedException \Stripe\Error\SignatureVerification - * @expectedExceptionMessage No signatures found with expected scheme - */ - public function testNoSignaturesWithExpectedScheme() - { - $sigHeader = $this->generateHeader(["scheme" => "v0"]); - WebhookSignature::verifyHeader(self::EVENT_PAYLOAD, $sigHeader, self::SECRET); - } - - /** - * @expectedException \Stripe\Error\SignatureVerification - * @expectedExceptionMessage No signatures found matching the expected signature for payload - */ - public function testNoValidSignatureForPayload() - { - $sigHeader = $this->generateHeader(["signature" => "bad_signature"]); - WebhookSignature::verifyHeader(self::EVENT_PAYLOAD, $sigHeader, self::SECRET); - } - - /** - * @expectedException \Stripe\Error\SignatureVerification - * @expectedExceptionMessage Timestamp outside the tolerance zone - */ - public function testTimestampOutsideTolerance() - { - $sigHeader = $this->generateHeader(["timestamp" => time() - 15]); - WebhookSignature::verifyHeader(self::EVENT_PAYLOAD, $sigHeader, self::SECRET, 10); - } - - public function testValidHeaderAndSignature() - { - $sigHeader = $this->generateHeader(); - $this->assertTrue(WebhookSignature::verifyHeader(self::EVENT_PAYLOAD, $sigHeader, self::SECRET, 10)); - } - - public function testHeaderContainsValidSignature() - { - $sigHeader = $this->generateHeader() . ",v1=bad_signature"; - $this->assertTrue(WebhookSignature::verifyHeader(self::EVENT_PAYLOAD, $sigHeader, self::SECRET, 10)); - } - - public function testTimestampOffButNoTolerance() - { - $sigHeader = $this->generateHeader(["timestamp" => 12345]); - $this->assertTrue(WebhookSignature::verifyHeader(self::EVENT_PAYLOAD, $sigHeader, self::SECRET)); - } -} diff --git a/vendor/stripe/stripe-php/tests/TestCase.php b/vendor/stripe/stripe-php/tests/TestCase.php deleted file mode 100644 index 93be3d12..00000000 --- a/vendor/stripe/stripe-php/tests/TestCase.php +++ /dev/null @@ -1,179 +0,0 @@ -<?php - -namespace Stripe; - -/** - * Base class for Stripe test cases. - */ -class TestCase extends \PHPUnit_Framework_TestCase -{ - /** @var string original API base URL */ - protected $origApiBase; - - /** @var string original API key */ - protected $origApiKey; - - /** @var string original client ID */ - protected $origClientId; - - /** @var string original API version */ - protected $origApiVersion; - - /** @var string original account ID */ - protected $origAccountId; - - /** @var object HTTP client mocker */ - protected $clientMock; - - protected function setUp() - { - // Save original values so that we can restore them after running tests - $this->origApiBase = Stripe::$apiBase; - $this->origApiKey = Stripe::getApiKey(); - $this->origClientId = Stripe::getClientId(); - $this->origApiVersion = Stripe::getApiVersion(); - $this->origAccountId = Stripe::getAccountId(); - - // Set up host and credentials for stripe-mock - Stripe::$apiBase = "http://localhost:" . MOCK_PORT; - Stripe::setApiKey("sk_test_123"); - Stripe::setClientId("ca_123"); - Stripe::setApiVersion(null); - Stripe::setAccountId(null); - - // Set up the HTTP client mocker - $this->clientMock = $this->getMock('\Stripe\HttpClient\ClientInterface'); - - // By default, use the real HTTP client - ApiRequestor::setHttpClient(HttpClient\CurlClient::instance()); - } - - protected function tearDown() - { - // Restore original values - Stripe::$apiBase = $this->origApiBase; - Stripe::setApiKey($this->origApiKey); - Stripe::setClientId($this->origClientId); - Stripe::setApiVersion($this->origApiVersion); - Stripe::setAccountId($this->origAccountId); - } - - /** - * Sets up a request expectation with the provided parameters. The request - * will actually go through and be emitted. - * - * @param string $method HTTP method (e.g. 'post', 'get', etc.) - * @param string $path relative path (e.g. '/v1/charges') - * @param array|null $params array of parameters. If null, parameters will - * not be checked. - * @param string[]|null $headers array of headers. Does not need to be - * exhaustive. If null, headers are not checked. - * @param bool $hasFile Whether the request parameters contains a file. - * Defaults to false. - * @param string|null $base base URL (e.g. 'https://api.stripe.com') - */ - protected function expectsRequest( - $method, - $path, - $params = null, - $headers = null, - $hasFile = false, - $base = null - ) { - $this->prepareRequestMock($method, $path, $params, $headers, $hasFile, $base) - ->will($this->returnCallback( - function ($method, $absUrl, $headers, $params, $hasFile) { - $curlClient = HttpClient\CurlClient::instance(); - ApiRequestor::setHttpClient($curlClient); - return $curlClient->request($method, $absUrl, $headers, $params, $hasFile); - } - )); - } - - /** - * Sets up a request expectation with the provided parameters. The request - * will not actually be emitted, instead the provided response parameters - * will be returned. - * - * @param string $method HTTP method (e.g. 'post', 'get', etc.) - * @param string $path relative path (e.g. '/v1/charges') - * @param array|null $params array of parameters. If null, parameters will - * not be checked. - * @param string[]|null $headers array of headers. Does not need to be - * exhaustive. If null, headers are not checked. - * @param bool $hasFile Whether the request parameters contains a file. - * Defaults to false. - * @param array $response - * @param integer $rcode - * @param string|null $base - * - * @return array - */ - protected function stubRequest( - $method, - $path, - $params = null, - $headers = null, - $hasFile = false, - $response = [], - $rcode = 200, - $base = null - ) { - $this->prepareRequestMock($method, $path, $params, $headers, $hasFile, $base) - ->willReturn([json_encode($response), $rcode, []]); - } - - /** - * Prepares the client mocker for an invocation of the `request` method. - * This helper method is used by both `expectsRequest` and `stubRequest` to - * prepare the client mocker to expect an invocation of the `request` method - * with the provided arguments. - * - * @param string $method HTTP method (e.g. 'post', 'get', etc.) - * @param string $path relative path (e.g. '/v1/charges') - * @param array|null $params array of parameters. If null, parameters will - * not be checked. - * @param string[]|null $headers array of headers. Does not need to be - * exhaustive. If null, headers are not checked. - * @param bool $hasFile Whether the request parameters contains a file. - * Defaults to false. - * @param string|null $base base URL (e.g. 'https://api.stripe.com') - * - * @return PHPUnit_Framework_MockObject_Builder_InvocationMocker - */ - private function prepareRequestMock( - $method, - $path, - $params = null, - $headers = null, - $hasFile = false, - $base = null - ) { - ApiRequestor::setHttpClient($this->clientMock); - - if ($base === null) { - $base = Stripe::$apiBase; - } - $absUrl = $base . $path; - - return $this->clientMock - ->expects($this->once()) - ->method('request') - ->with( - $this->identicalTo(strtolower($method)), - $this->identicalTo($absUrl), - // for headers, we only check that all of the headers provided in $headers are - // present in the list of headers of the actual request - $headers === null ? $this->anything() : $this->callback(function ($array) use ($headers) { - foreach ($headers as $header) { - if (!in_array($header, $array)) { - return false; - } - } - return true; - }), - $params === null ? $this->anything() : $this->identicalTo($params), - $this->identicalTo($hasFile) - ); - } -} diff --git a/vendor/stripe/stripe-php/tests/bootstrap.no_autoload.php b/vendor/stripe/stripe-php/tests/bootstrap.no_autoload.php deleted file mode 100644 index 7011a3f4..00000000 --- a/vendor/stripe/stripe-php/tests/bootstrap.no_autoload.php +++ /dev/null @@ -1,5 +0,0 @@ -<?php - -require_once __DIR__ . '/../init.php'; - -require_once __DIR__ . '/bootstrap.php'; diff --git a/vendor/stripe/stripe-php/tests/bootstrap.php b/vendor/stripe/stripe-php/tests/bootstrap.php deleted file mode 100644 index 8784715f..00000000 --- a/vendor/stripe/stripe-php/tests/bootstrap.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -define("MOCK_MINIMUM_VERSION", "0.33.0"); -define("MOCK_PORT", getenv("STRIPE_MOCK_PORT") ?: 12111); - -// Send a request to stripe-mock -$ch = curl_init("http://localhost:" . MOCK_PORT . "/"); -curl_setopt($ch, CURLOPT_HEADER, 1); -curl_setopt($ch, CURLOPT_NOBODY, 1); -curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); -$resp = curl_exec($ch); - -if (curl_errno($ch)) { - echo "Couldn't reach stripe-mock at `localhost:" . MOCK_PORT . "`. Is " . - "it running? Please see README for setup instructions.\n"; - exit(1); -} - -// Retrieve the Stripe-Mock-Version header -$version = null; -$headers = explode("\n", $resp); -foreach ($headers as $header) { - $pair = explode(":", $header, 2); - if ($pair[0] == "Stripe-Mock-Version") { - $version = trim($pair[1]); - } -} - -if ($version === null) { - echo "Could not retrieve Stripe-Mock-Version header. Are you sure " . - "that the server at `localhost:" . MOCK_PORT . "` is a stripe-mock " . - "instance?"; - exit(1); -} - -if ($version != "master" && version_compare($version, MOCK_MINIMUM_VERSION) == -1) { - echo "Your version of stripe-mock (" . $version . ") is too old. The minimum " . - "version to run this test suite is " . MOCK_MINIMUM_VERSION . ". " . - "Please see its repository for upgrade instructions.\n"; - exit(1); -} - -require_once __DIR__ . '/TestCase.php'; diff --git a/vendor/stripe/stripe-php/tests/data/test.png b/vendor/stripe/stripe-php/tests/data/test.png deleted file mode 100644 index 1914264c08781d1f30ee0b8482bccf44586f2dc1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 95 zcmeAS@N?(olHy`uVBq!ia0vp^j3CU&3?x-=hn)ga%mF?ju0VQumF+E%TuG2$FoVOh l8)-lem#2$k2*>s01R$G<f$@>z9%CSj!PC{xWt~$(697H@6ZHT9 -- GitLab