mirror of
https://github.com/itflow-org/itflow
synced 2026-03-24 22:45:36 +00:00
Updated Client Detail Header for better mobile fit, lots of progress on stripe pay and some other minor updates
This commit is contained in:
14
vendor/stripe-php-7.0.2/.editorconfig
vendored
Normal file
14
vendor/stripe-php-7.0.2/.editorconfig
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
; https://editorconfig.org/
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
|
||||
[*.{json,yml}]
|
||||
indent_size = 2
|
||||
20
vendor/stripe-php-7.0.2/.gitignore
vendored
Normal file
20
vendor/stripe-php-7.0.2/.gitignore
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
# Mac OS X dumps these all over the place.
|
||||
.DS_Store
|
||||
|
||||
# Ignore the SimpleTest library if it is installed to /test/.
|
||||
/test/simpletest/
|
||||
|
||||
# Ignore the /vendor/ directory for people using composer
|
||||
/vendor/
|
||||
|
||||
# If the vendor directory isn't being commited the composer.lock file should also be ignored
|
||||
composer.lock
|
||||
|
||||
# Ignore PHPUnit coverage file
|
||||
clover.xml
|
||||
|
||||
# Ignore IDE's configuration files
|
||||
.idea
|
||||
|
||||
# Ignore PHP CS Fixer cache
|
||||
.php_cs.cache
|
||||
769
vendor/stripe-php-7.0.2/CHANGELOG.md
vendored
Normal file
769
vendor/stripe-php-7.0.2/CHANGELOG.md
vendored
Normal file
@@ -0,0 +1,769 @@
|
||||
# Changelog
|
||||
|
||||
## 7.0.2 - 2019-09-06
|
||||
* [#729](https://github.com/stripe/stripe-php/pull/729) Fix usage of `SignatureVerificationException` in PHPDoc blocks
|
||||
|
||||
## 7.0.1 - 2019-09-05
|
||||
* [#728](https://github.com/stripe/stripe-php/pull/728) Clean up Collection
|
||||
|
||||
## 7.0.0 - 2019-09-03
|
||||
Major version release. The [migration guide](https://github.com/stripe/stripe-php/wiki/Migration-guide-for-v7) contains a detailed list of backwards-incompatible changes with upgrade instructions.
|
||||
|
||||
Pull requests included in this release (cf. [#552](https://github.com/stripe/stripe-php/pull/552)) (⚠️ = breaking changes):
|
||||
* ⚠️ Drop support for PHP 5.4 ([#551](https://github.com/stripe/stripe-php/pull/551))
|
||||
* ⚠️ Drop support for PHP 5.5 ([#554](https://github.com/stripe/stripe-php/pull/554))
|
||||
* Bump dependencies ([#553](https://github.com/stripe/stripe-php/pull/553))
|
||||
* Remove `CURLFile` check ([#555](https://github.com/stripe/stripe-php/pull/555))
|
||||
* Update constant definitions for PHP >= 5.6 ([#556](https://github.com/stripe/stripe-php/pull/556))
|
||||
* ⚠️ Remove `FileUpload` alias ([#557](https://github.com/stripe/stripe-php/pull/557))
|
||||
* Remove `curl_reset` check ([#570](https://github.com/stripe/stripe-php/pull/570))
|
||||
* Use `\Stripe\<class>::class` constant instead of strings ([#643](https://github.com/stripe/stripe-php/pull/643))
|
||||
* Use `array_column` to flatten params ([#686](https://github.com/stripe/stripe-php/pull/686))
|
||||
* ⚠️ Remove deprecated methods ([#692](https://github.com/stripe/stripe-php/pull/692))
|
||||
* ⚠️ Remove `IssuerFraudRecord` ([#696](https://github.com/stripe/stripe-php/pull/696))
|
||||
* Update constructors of Stripe exception classes ([#559](https://github.com/stripe/stripe-php/pull/559))
|
||||
* Fix remaining TODOs ([#700](https://github.com/stripe/stripe-php/pull/700))
|
||||
* Use yield for autopagination ([#703](https://github.com/stripe/stripe-php/pull/703))
|
||||
* ⚠️ Rename fake magic methods and rewrite array conversion ([#704](https://github.com/stripe/stripe-php/pull/704))
|
||||
* Add `ErrorObject` to Stripe exceptions ([#705](https://github.com/stripe/stripe-php/pull/705))
|
||||
* Start using PHP CS Fixer ([#706](https://github.com/stripe/stripe-php/pull/706))
|
||||
* Update error messages for nested resource operations ([#708](https://github.com/stripe/stripe-php/pull/708))
|
||||
* Upgrade retry logic ([#707](https://github.com/stripe/stripe-php/pull/707))
|
||||
* ⚠️ `Collection` improvements / fixes ([#715](https://github.com/stripe/stripe-php/pull/715))
|
||||
* ⚠️ Modernize exceptions ([#709](https://github.com/stripe/stripe-php/pull/709))
|
||||
* Add constants for error codes ([#716](https://github.com/stripe/stripe-php/pull/716))
|
||||
* Update certificate bundle ([#717](https://github.com/stripe/stripe-php/pull/717))
|
||||
* Retry requests on a 429 that's a lock timeout ([#718](https://github.com/stripe/stripe-php/pull/718))
|
||||
* Fix `toArray()` calls ([#719](https://github.com/stripe/stripe-php/pull/719))
|
||||
* Couple of fixes for PHP 7.4 ([#725](https://github.com/stripe/stripe-php/pull/725))
|
||||
|
||||
## 6.43.1 - 2019-08-29
|
||||
* [#722](https://github.com/stripe/stripe-php/pull/722) Make `LoggerInterface::error` compatible with its PSR-3 counterpart
|
||||
* [#714](https://github.com/stripe/stripe-php/pull/714) Add `pending_setup_intent` property in `Subscription`
|
||||
* [#713](https://github.com/stripe/stripe-php/pull/713) Add typehint to `ApiResponse`
|
||||
* [#712](https://github.com/stripe/stripe-php/pull/712) Fix comment
|
||||
* [#701](https://github.com/stripe/stripe-php/pull/701) Start testing PHP 7.3
|
||||
|
||||
## 6.43.0 - 2019-08-09
|
||||
* [#694](https://github.com/stripe/stripe-php/pull/694) Add `SubscriptionItem::createUsageRecord` method
|
||||
|
||||
## 6.42.0 - 2019-08-09
|
||||
* [#688](https://github.com/stripe/stripe-php/pull/688) Remove `SubscriptionScheduleRevision`
|
||||
* Note that this is technically a breaking change, however we've chosen to release it as a minor version in light of the fact that this resource and its API methods were virtually unused.
|
||||
|
||||
## 6.41.0 - 2019-07-31
|
||||
* [#683](https://github.com/stripe/stripe-php/pull/683) Move the List Balance History API to `/v1/balance_transactions`
|
||||
|
||||
## 6.40.0 - 2019-06-27
|
||||
* [#675](https://github.com/stripe/stripe-php/pull/675) Add support for `SetupIntent` resource and APIs
|
||||
|
||||
## 6.39.2 - 2019-06-26
|
||||
* [#676](https://github.com/stripe/stripe-php/pull/676) Fix exception message in `CustomerBalanceTransaction::update()`
|
||||
|
||||
## 6.39.1 - 2019-06-25
|
||||
* [#674](https://github.com/stripe/stripe-php/pull/674) Add new constants for `collection_method` on `Invoice`
|
||||
|
||||
## 6.39.0 - 2019-06-24
|
||||
* [#673](https://github.com/stripe/stripe-php/pull/673) Enable request latency telemetry by default
|
||||
|
||||
## 6.38.0 - 2019-06-17
|
||||
* [#649](https://github.com/stripe/stripe-php/pull/649) Add support for `CustomerBalanceTransaction` resource and APIs
|
||||
|
||||
## 6.37.2 - 2019-06-17
|
||||
* [#671](https://github.com/stripe/stripe-php/pull/671) Add new PHPDoc
|
||||
* [#672](https://github.com/stripe/stripe-php/pull/672) Add constants for `submit_type` on Checkout `Session`
|
||||
|
||||
## 6.37.1 - 2019-06-14
|
||||
* [#670](https://github.com/stripe/stripe-php/pull/670) Add new PHPDoc
|
||||
|
||||
## 6.37.0 - 2019-05-23
|
||||
* [#663](https://github.com/stripe/stripe-php/pull/663) Add support for `radar.early_fraud_warning` resource
|
||||
|
||||
## 6.36.0 - 2019-05-22
|
||||
* [#661](https://github.com/stripe/stripe-php/pull/661) Add constants for new TaxId types
|
||||
* [#662](https://github.com/stripe/stripe-php/pull/662) Add constants for BalanceTransaction types
|
||||
|
||||
## 6.35.2 - 2019-05-20
|
||||
* [#655](https://github.com/stripe/stripe-php/pull/655) Add constants for payment intent statuses
|
||||
* [#659](https://github.com/stripe/stripe-php/pull/659) Fix PHPDoc for various nested Account actions
|
||||
* [#660](https://github.com/stripe/stripe-php/pull/660) Fix various PHPDoc
|
||||
|
||||
## 6.35.1 - 2019-05-20
|
||||
* [#658](https://github.com/stripe/stripe-php/pull/658) Use absolute value when checking timestamp tolerance
|
||||
|
||||
## 6.35.0 - 2019-05-14
|
||||
* [#651](https://github.com/stripe/stripe-php/pull/651) Add support for the Capability resource and APIs
|
||||
|
||||
## 6.34.6 - 2019-05-13
|
||||
* [#654](https://github.com/stripe/stripe-php/pull/654) Fix typo in definition of `Event::PAYMENT_METHOD_ATTACHED` constant
|
||||
|
||||
## 6.34.5 - 2019-05-06
|
||||
* [#647](https://github.com/stripe/stripe-php/pull/647) Set the return type to static for more operations
|
||||
|
||||
## 6.34.4 - 2019-05-06
|
||||
* [#650](https://github.com/stripe/stripe-php/pull/650) Add missing constants for Event types
|
||||
|
||||
## 6.34.3 - 2019-05-01
|
||||
* [#644](https://github.com/stripe/stripe-php/pull/644) Update return type to `static` to improve static analysis
|
||||
* [#645](https://github.com/stripe/stripe-php/pull/645) Fix constant for `payment_intent.payment_failed`
|
||||
|
||||
## 6.34.2 - 2019-04-26
|
||||
* [#642](https://github.com/stripe/stripe-php/pull/642) Fix an issue where existing idempotency keys would be overwritten when using automatic retries
|
||||
|
||||
## 6.34.1 - 2019-04-25
|
||||
* [#640](https://github.com/stripe/stripe-php/pull/640) Add missing phpdocs
|
||||
|
||||
## 6.34.0 - 2019-04-24
|
||||
* [#626](https://github.com/stripe/stripe-php/pull/626) Add support for the `TaxRate` resource and APIs
|
||||
* [#639](https://github.com/stripe/stripe-php/pull/639) Fix multiple phpdoc issues
|
||||
|
||||
## 6.33.0 - 2019-04-22
|
||||
* [#630](https://github.com/stripe/stripe-php/pull/630) Add support for the `TaxId` resource and APIs
|
||||
|
||||
## 6.32.1 - 2019-04-19
|
||||
* [#636](https://github.com/stripe/stripe-php/pull/636) Correct type of `$personId` in PHPDoc
|
||||
|
||||
## 6.32.0 - 2019-04-18
|
||||
* [#621](https://github.com/stripe/stripe-php/pull/621) Add support for `CreditNote`
|
||||
|
||||
## 6.31.5 - 2019-04-12
|
||||
* [#628](https://github.com/stripe/stripe-php/pull/628) Add constants for `person.*` event types
|
||||
* [#628](https://github.com/stripe/stripe-php/pull/628) Add missing constants for `Account` and `Person`
|
||||
|
||||
## 6.31.4 - 2019-04-05
|
||||
* [#624](https://github.com/stripe/stripe-php/pull/624) Fix encoding of nested parameters in multipart requests
|
||||
|
||||
## 6.31.3 - 2019-04-02
|
||||
* [#623](https://github.com/stripe/stripe-php/pull/623) Only use HTTP/2 with curl >= 7.60.0
|
||||
|
||||
## 6.31.2 - 2019-03-25
|
||||
* [#619](https://github.com/stripe/stripe-php/pull/619) Fix PHPDoc return types for list methods for nested resources
|
||||
|
||||
## 6.31.1 - 2019-03-22
|
||||
* [#612](https://github.com/stripe/stripe-php/pull/612) Add a lot of constants
|
||||
* [#614](https://github.com/stripe/stripe-php/pull/614) Add missing subscription status constants
|
||||
|
||||
## 6.31.0 - 2019-03-18
|
||||
* [#600](https://github.com/stripe/stripe-php/pull/600) Add support for the `PaymentMethod` resource and APIs
|
||||
* [#606](https://github.com/stripe/stripe-php/pull/606) Add support for retrieving a Checkout `Session`
|
||||
* [#611](https://github.com/stripe/stripe-php/pull/611) Add support for deleting a Terminal `Location` and `Reader`
|
||||
|
||||
## 6.30.5 - 2019-03-11
|
||||
* [#607](https://github.com/stripe/stripe-php/pull/607) Correctly handle case where a metadata key is called `metadata`
|
||||
|
||||
## 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.
|
||||
|
||||
## 6.19.4 - 2018-10-11
|
||||
* [#534](https://github.com/stripe/stripe-php/pull/534) Fix PSR-4 autoloading for `\Stripe\FileUpload` class alias
|
||||
|
||||
## 6.19.3 - 2018-10-09
|
||||
* [#530](https://github.com/stripe/stripe-php/pull/530) Add constants for `flow` (`FLOW_*`), `status` (`STATUS_*`) and `usage` (`USAGE_*`) on `\Stripe\Source`
|
||||
|
||||
## 6.19.2 - 2018-10-08
|
||||
* [#531](https://github.com/stripe/stripe-php/pull/531) Store HTTP response headers in case-insensitive array
|
||||
|
||||
## 6.19.1 - 2018-09-25
|
||||
* [#526](https://github.com/stripe/stripe-php/pull/526) Ignore null values in request parameters
|
||||
|
||||
## 6.19.0 - 2018-09-24
|
||||
* [#523](https://github.com/stripe/stripe-php/pull/523) Add support for Stripe Terminal
|
||||
|
||||
## 6.18.0 - 2018-09-24
|
||||
* [#520](https://github.com/stripe/stripe-php/pull/520) Rename `\Stripe\FileUpload` to `\Stripe\File`
|
||||
|
||||
## 6.17.2 - 2018-09-18
|
||||
* [#522](https://github.com/stripe/stripe-php/pull/522) Fix warning when adding a new additional owner to an existing array
|
||||
|
||||
## 6.17.1 - 2018-09-14
|
||||
* [#517](https://github.com/stripe/stripe-php/pull/517) Integer-index encode all sequential arrays
|
||||
|
||||
## 6.17.0 - 2018-09-05
|
||||
* [#514](https://github.com/stripe/stripe-php/pull/514) Add support for reporting resources
|
||||
|
||||
## 6.16.0 - 2018-08-23
|
||||
* [#509](https://github.com/stripe/stripe-php/pull/509) Add support for usage record summaries
|
||||
|
||||
## 6.15.0 - 2018-08-03
|
||||
* [#504](https://github.com/stripe/stripe-php/pull/504) Add cancel support for topups
|
||||
|
||||
## 6.14.0 - 2018-08-02
|
||||
* [#505](https://github.com/stripe/stripe-php/pull/505) Add support for file links
|
||||
|
||||
## 6.13.0 - 2018-07-31
|
||||
* [#502](https://github.com/stripe/stripe-php/pull/502) Add `isDeleted()` method to `\Stripe\StripeObject`
|
||||
|
||||
## 6.12.0 - 2018-07-28
|
||||
* [#501](https://github.com/stripe/stripe-php/pull/501) Add support for scheduled query runs (`\Stripe\Sigma\ScheduledQueryRun`) for Sigma
|
||||
|
||||
## 6.11.0 - 2018-07-26
|
||||
* [#500](https://github.com/stripe/stripe-php/pull/500) Add support for Stripe Issuing
|
||||
|
||||
## 6.10.4 - 2018-07-19
|
||||
* [#498](https://github.com/stripe/stripe-php/pull/498) Internal improvements to the `\Stripe\ApiResource.classUrl()` method
|
||||
|
||||
## 6.10.3 - 2018-07-16
|
||||
* [#497](https://github.com/stripe/stripe-php/pull/497) Use HTTP/2 only for HTTPS requests
|
||||
|
||||
## 6.10.2 - 2018-07-11
|
||||
* [#494](https://github.com/stripe/stripe-php/pull/494) Enable HTTP/2 support
|
||||
|
||||
## 6.10.1 - 2018-07-10
|
||||
* [#493](https://github.com/stripe/stripe-php/pull/493) Add PHPDoc for `auto_advance` on `\Stripe\Invoice`
|
||||
|
||||
## 6.10.0 - 2018-06-28
|
||||
* [#488](https://github.com/stripe/stripe-php/pull/488) Add support for `$appPartnerId` to `Stripe::setAppInfo()`
|
||||
|
||||
## 6.9.0 - 2018-06-28
|
||||
* [#487](https://github.com/stripe/stripe-php/pull/487) Add support for payment intents
|
||||
|
||||
## 6.8.2 - 2018-06-24
|
||||
* [#486](https://github.com/stripe/stripe-php/pull/486) Make `Account.deauthorize()` return the `StripeObject` from the API
|
||||
|
||||
## 6.8.1 - 2018-06-13
|
||||
* [#472](https://github.com/stripe/stripe-php/pull/472) Added phpDoc for `ApiRequestor` and others, especially regarding thrown errors
|
||||
|
||||
## 6.8.0 - 2018-06-13
|
||||
* [#481](https://github.com/stripe/stripe-php/pull/481) Add new `\Stripe\Discount` and `\Stripe\OrderItem` classes, add more PHPDoc describing object attributes
|
||||
|
||||
## 6.7.4 - 2018-05-29
|
||||
* [#480](https://github.com/stripe/stripe-php/pull/480) PHPDoc changes for API version 2018-05-21 and the addition of the new `CHARGE_EXPIRED` event type
|
||||
|
||||
## 6.7.3 - 2018-05-28
|
||||
* [#479](https://github.com/stripe/stripe-php/pull/479) Fix unnecessary traits on `\Stripe\InvoiceLineItem`
|
||||
|
||||
## 6.7.2 - 2018-05-28
|
||||
* [#471](https://github.com/stripe/stripe-php/pull/471) Add `OBJECT_NAME` constant to all API resource classes, add `\Stripe\InvoiceLineItem` class
|
||||
|
||||
## 6.7.1 - 2018-05-13
|
||||
* [#468](https://github.com/stripe/stripe-php/pull/468) Update fields in PHP docs for accuracy
|
||||
|
||||
## 6.7.0 - 2018-05-09
|
||||
* [#466](https://github.com/stripe/stripe-php/pull/466) Add support for issuer fraud records
|
||||
|
||||
## 6.6.0 - 2018-04-11
|
||||
* [#460](https://github.com/stripe/stripe-php/pull/460) Add support for flexible billing primitives
|
||||
|
||||
## 6.5.0 - 2018-04-05
|
||||
* [#461](https://github.com/stripe/stripe-php/pull/461) Don't zero keys on non-`metadata` subobjects
|
||||
|
||||
## 6.4.2 - 2018-03-17
|
||||
* [#458](https://github.com/stripe/stripe-php/pull/458) Add PHPDoc for `account` on `\Stripe\Event`
|
||||
|
||||
## 6.4.1 - 2018-03-02
|
||||
* [#455](https://github.com/stripe/stripe-php/pull/455) Fix namespaces in PHPDoc
|
||||
* [#456](https://github.com/stripe/stripe-php/pull/456) Fix namespaces for some exceptions
|
||||
|
||||
## 6.4.0 - 2018-02-28
|
||||
* [#453](https://github.com/stripe/stripe-php/pull/453) Add constants for `reason` (`REASON_*`) and `status` (`STATUS_*`) on `\Stripe\Dispute`
|
||||
|
||||
## 6.3.2 - 2018-02-27
|
||||
* [#452](https://github.com/stripe/stripe-php/pull/452) Add PHPDoc for `amount_paid` and `amount_remaining` on `\Stripe\Invoice`
|
||||
|
||||
## 6.3.1 - 2018-02-26
|
||||
* [#443](https://github.com/stripe/stripe-php/pull/443) Add event types as constants to `\Stripe\Event` class
|
||||
|
||||
## 6.3.0 - 2018-02-23
|
||||
* [#450](https://github.com/stripe/stripe-php/pull/450) Add support for `code` attribute on all Stripe exceptions
|
||||
|
||||
## 6.2.0 - 2018-02-21
|
||||
* [#440](https://github.com/stripe/stripe-php/pull/440) Add support for topups
|
||||
* [#442](https://github.com/stripe/stripe-php/pull/442) Fix PHPDoc for `\Stripe\Error\SignatureVerification`
|
||||
|
||||
## 6.1.0 - 2018-02-12
|
||||
* [#435](https://github.com/stripe/stripe-php/pull/435) Fix header persistence on `Collection` objects
|
||||
* [#436](https://github.com/stripe/stripe-php/pull/436) Introduce new `Idempotency` error class
|
||||
|
||||
## 6.0.0 - 2018-02-07
|
||||
Major version release. List of backwards incompatible changes to watch out for:
|
||||
+ The minimum PHP version is now 5.4.0. If you're using PHP 5.3 or older, consider upgrading to a more recent version.
|
||||
* `\Stripe\AttachedObject` no longer exists. Attributes that used to be instances of `\Stripe\AttachedObject` (such as `metadata`) are now instances of `\Stripe\StripeObject`.
|
||||
+ Attributes that used to be PHP arrays (such as `legal_entity->additional_owners` on `\Stripe\Account` instances) are now instances of `\Stripe\StripeObject`, except when they are empty. `\Stripe\StripeObject` has array semantics so this should not be an issue unless you are actively checking types.
|
||||
* `\Stripe\Collection` now derives from `\Stripe\StripeObject` rather than from `\Stripe\ApiResource`.
|
||||
|
||||
Pull requests included in this release:
|
||||
* [#410](https://github.com/stripe/stripe-php/pull/410) Drop support for PHP 5.3
|
||||
* [#411](https://github.com/stripe/stripe-php/pull/411) Use traits for common API operations
|
||||
* [#414](https://github.com/stripe/stripe-php/pull/414) Use short array syntax
|
||||
* [#404](https://github.com/stripe/stripe-php/pull/404) Fix serialization logic
|
||||
* [#417](https://github.com/stripe/stripe-php/pull/417) Remove `ExternalAccount` class
|
||||
* [#418](https://github.com/stripe/stripe-php/pull/418) Increase test coverage
|
||||
* [#421](https://github.com/stripe/stripe-php/pull/421) Update CA bundle and add script for future updates
|
||||
* [#422](https://github.com/stripe/stripe-php/pull/422) Use vendored CA bundle for all requests
|
||||
* [#428](https://github.com/stripe/stripe-php/pull/428) Support for automatic request retries
|
||||
|
||||
## 5.9.2 - 2018-02-07
|
||||
* [#431](https://github.com/stripe/stripe-php/pull/431) Update PHPDoc @property tags for latest API version
|
||||
|
||||
## 5.9.1 - 2018-02-06
|
||||
* [#427](https://github.com/stripe/stripe-php/pull/427) Add and update PHPDoc @property tags on all API resources
|
||||
|
||||
## 5.9.0 - 2018-01-17
|
||||
* [#421](https://github.com/stripe/stripe-php/pull/421) Updated bundled CA certificates
|
||||
* [#423](https://github.com/stripe/stripe-php/pull/423) Escape unsanitized input in OAuth example
|
||||
|
||||
## 5.8.0 - 2017-12-20
|
||||
* [#403](https://github.com/stripe/stripe-php/pull/403) Add `__debugInfo()` magic method to `StripeObject`
|
||||
|
||||
## 5.7.0 - 2017-11-28
|
||||
* [#390](https://github.com/stripe/stripe-php/pull/390) Remove some unsupported API methods
|
||||
* [#391](https://github.com/stripe/stripe-php/pull/391) Alphabetize the list of API resources in `Util::convertToStripeObject()` and add missing resources
|
||||
* [#393](https://github.com/stripe/stripe-php/pull/393) Fix expiry date update for card sources
|
||||
|
||||
## 5.6.0 - 2017-10-31
|
||||
* [#386](https://github.com/stripe/stripe-php/pull/386) Support for exchange rates APIs
|
||||
|
||||
## 5.5.1 - 2017-10-30
|
||||
* [#387](https://github.com/stripe/stripe-php/pull/387) Allow `personal_address_kana` and `personal_address_kanji` to be updated on an account
|
||||
|
||||
## 5.5.0 - 2017-10-27
|
||||
* [#385](https://github.com/stripe/stripe-php/pull/385) Support for listing source transactions
|
||||
|
||||
## 5.4.0 - 2017-10-24
|
||||
* [#383](https://github.com/stripe/stripe-php/pull/383) Add static methods to manipulate resources from parent
|
||||
* `Account` gains methods for external accounts and login links (e.g. `createExternalAccount`, `createLoginLink`)
|
||||
* `ApplicationFee` gains methods for refunds
|
||||
* `Customer` gains methods for sources
|
||||
* `Transfer` gains methods for reversals
|
||||
|
||||
## 5.3.0 - 2017-10-11
|
||||
* [#378](https://github.com/stripe/stripe-php/pull/378) Rename source `delete` to `detach` (and deprecate the former)
|
||||
|
||||
## 5.2.3 - 2017-09-27
|
||||
* Add PHPDoc for `Card`
|
||||
|
||||
## 5.2.2 - 2017-09-20
|
||||
* Fix deserialization mapping of `FileUpload` objects
|
||||
|
||||
## 5.2.1 - 2017-09-14
|
||||
* Serialized `shipping` nested attribute
|
||||
|
||||
## 5.2.0 - 2017-08-29
|
||||
* Add support for `InvalidClient` OAuth error
|
||||
|
||||
## 5.1.3 - 2017-08-14
|
||||
* Allow `address_kana` and `address_kanji` to be updated for custom accounts
|
||||
|
||||
## 5.1.2 - 2017-08-01
|
||||
* Fix documented return type of `autoPagingIterator()` (was missing namespace)
|
||||
|
||||
## 5.1.1 - 2017-07-03
|
||||
* Fix order returns to use the right URL `/v1/order_returns`
|
||||
|
||||
## 5.1.0 - 2017-06-30
|
||||
* Add support for OAuth
|
||||
|
||||
## 5.0.0 - 2017-06-27
|
||||
* `pay` on invoice now takes params as well as opts
|
||||
|
||||
## 4.13.0 - 2017-06-19
|
||||
* Add support for ephemeral keys
|
||||
|
||||
## 4.12.0 - 2017-06-05
|
||||
* Clients can implement `getUserAgentInfo()` to add additional user agent information
|
||||
|
||||
## 4.11.0 - 2017-06-05
|
||||
* Implement `Countable` for `AttachedObject` (`metadata` and `additional_owners`)
|
||||
|
||||
## 4.10.0 - 2017-05-25
|
||||
* Add support for login links
|
||||
|
||||
## 4.9.1 - 2017-05-10
|
||||
* Fix docs to include arrays on `$id` parameter for retrieve methods
|
||||
|
||||
## 4.9.0 - 2017-04-28
|
||||
* Support for checking webhook signatures
|
||||
|
||||
## 4.8.1 - 2017-04-24
|
||||
* Allow nested field `payout_schedule` to be updated
|
||||
|
||||
## 4.8.0 - 2017-04-20
|
||||
* Add `\Stripe\Stripe::setLogger()` to support an external PSR-3 compatible logger
|
||||
|
||||
## 4.7.0 - 2017-04-10
|
||||
* Add support for payouts and recipient transfers
|
||||
|
||||
## 4.6.0 - 2017-04-06
|
||||
* Please see 4.7.0 instead (no-op release)
|
||||
|
||||
## 4.5.1 - 2017-03-22
|
||||
* Remove hard dependency on cURL
|
||||
|
||||
## 4.5.0 - 2017-03-20
|
||||
* Support for detaching sources from customers
|
||||
|
||||
## 4.4.2 - 2017-02-27
|
||||
* Correct handling of `owner` parameter when updating sources
|
||||
|
||||
## 4.4.1 - 2017-02-24
|
||||
* Correct the error check on a bad JSON decoding
|
||||
|
||||
## 4.4.0 - 2017-01-18
|
||||
* Add support for updating sources
|
||||
|
||||
## 4.3.0 - 2016-11-30
|
||||
* Add support for verifying sources
|
||||
|
||||
## 4.2.0 - 2016-11-21
|
||||
* Add retrieve method for 3-D Secure resources
|
||||
|
||||
## 4.1.1 - 2016-10-21
|
||||
* Add docblock with model properties for `Plan`
|
||||
|
||||
## 4.1.0 - 2016-10-18
|
||||
* Support for 403 status codes (permission denied)
|
||||
|
||||
## 4.0.1 - 2016-10-17
|
||||
* Fix transfer reversal materialization
|
||||
* Fixes for some property definitions in docblocks
|
||||
|
||||
## 4.0.0 - 2016-09-28
|
||||
* Support for subscription items
|
||||
* Drop attempt to force TLS 1.2: please note that this could be breaking if you're using old OS distributions or packages and upgraded recently (so please make sure to test your integration!)
|
||||
|
||||
## 3.23.0 - 2016-09-15
|
||||
* Add support for Apple Pay domains
|
||||
|
||||
## 3.22.0 - 2016-09-13
|
||||
* Add `Stripe::setAppInfo` to allow plugins to register user agent information
|
||||
|
||||
## 3.21.0 - 2016-08-25
|
||||
* Add `Source` model for generic payment sources
|
||||
|
||||
## 3.20.0 - 2016-08-08
|
||||
* Add `getDeclineCode` to card errors
|
||||
|
||||
## 3.19.0 - 2016-07-29
|
||||
* Opt requests directly into TLS 1.2 where OpenSSL >= 1.0.1 (see #277 for context)
|
||||
|
||||
## 3.18.0 - 2016-07-28
|
||||
* Add new `STATUS_` constants for subscriptions
|
||||
|
||||
## 3.17.1 - 2016-07-28
|
||||
* Fix auto-paging iterator so that it plays nicely with `iterator_to_array`
|
||||
|
||||
## 3.17.0 - 2016-07-14
|
||||
* Add field annotations to model classes for better editor hinting
|
||||
|
||||
## 3.16.0 - 2016-07-12
|
||||
* Add `ThreeDSecure` model for 3-D secure payments
|
||||
|
||||
## 3.15.0 - 2016-06-29
|
||||
* Add static `update` method to all resources that can be changed.
|
||||
|
||||
## 3.14.3 - 2016-06-20
|
||||
* Make sure that cURL never sends `Expects: 100-continue`, even on large request bodies
|
||||
|
||||
## 3.14.2 - 2016-06-03
|
||||
* Add `inventory` under `SKU` to list of keys that have nested data and can be updated
|
||||
|
||||
## 3.14.1 - 2016-05-27
|
||||
* Fix some inconsistencies in PHPDoc
|
||||
|
||||
## 3.14.0 - 2016-05-25
|
||||
* Add support for returning Relay orders
|
||||
|
||||
## 3.13.0 - 2016-05-04
|
||||
* Add `list`, `create`, `update`, `retrieve`, and `delete` methods to the Subscription class
|
||||
|
||||
## 3.12.1 - 2016-04-07
|
||||
* Additional check on value arrays for some extra safety
|
||||
|
||||
## 3.12.0 - 2016-03-31
|
||||
* Fix bug `refreshFrom` on `StripeObject` would not take an `$opts` array
|
||||
* Fix bug where `$opts` not passed to parent `save` method in `Account`
|
||||
* Fix bug where non-existent variable was referenced in `reverse` in `Transfer`
|
||||
* Update CA cert bundle for compatibility with OpenSSL versions below 1.0.1
|
||||
|
||||
## 3.11.0 - 2016-03-22
|
||||
* Allow `CurlClient` to be initialized with default `CURLOPT_*` options
|
||||
|
||||
## 3.10.1 - 2016-03-22
|
||||
* Fix bug where request params and options were ignored in `ApplicationFee`'s `refund.`
|
||||
|
||||
## 3.10.0 - 2016-03-15
|
||||
* Add `reject` on `Account` to support the new API feature
|
||||
|
||||
## 3.9.2 - 2016-03-04
|
||||
* Fix error when an object's metadata is set more than once
|
||||
|
||||
## 3.9.1 - 2016-02-24
|
||||
* Fix encoding behavior of nested arrays for requests (see #227)
|
||||
|
||||
## 3.9.0 - 2016-02-09
|
||||
* Add automatic pagination mechanism with `autoPagingIterator()`
|
||||
* Allow global account ID to be set with `Stripe::setAccountId()`
|
||||
|
||||
## 3.8.0 - 2016-02-08
|
||||
* Add `CountrySpec` model for looking up country payment information
|
||||
|
||||
## 3.7.1 - 2016-02-01
|
||||
* Update bundled CA certs
|
||||
|
||||
## 3.7.0 - 2016-01-27
|
||||
* Support deleting Relay products and SKUs
|
||||
|
||||
## 3.6.0 - 2016-01-05
|
||||
* Allow configuration of HTTP client timeouts
|
||||
|
||||
## 3.5.0 - 2015-12-01
|
||||
* Add a verification routine for external accounts
|
||||
|
||||
## 3.4.0 - 2015-09-14
|
||||
* Products, SKUs, and Orders -- https://stripe.com/relay
|
||||
|
||||
## 3.3.0 - 2015-09-11
|
||||
* Add support for 429 Rate Limit response
|
||||
|
||||
## 3.2.0 - 2015-08-17
|
||||
* Add refund listing and retrieval without an associated charge
|
||||
|
||||
## 3.1.0 - 2015-08-03
|
||||
* Add dispute listing and retrieval
|
||||
* Add support for manage account deletion
|
||||
|
||||
## 3.0.0 - 2015-07-28
|
||||
* Rename `\Stripe\Object` to `\Stripe\StripeObject` (PHP 7 compatibility)
|
||||
* Rename `getCode` and `getParam` in exceptions to `getStripeCode` and `getStripeParam`
|
||||
* Add support for calling `json_encode` on Stripe objects in PHP 5.4+
|
||||
* Start supporting/testing PHP 7
|
||||
|
||||
## 2.3.0 - 2015-07-06
|
||||
* Add request ID to all Stripe exceptions
|
||||
|
||||
## 2.2.0 - 2015-06-01
|
||||
* Add support for Alipay accounts as sources
|
||||
* Add support for bank accounts as sources (private beta)
|
||||
* Add support for bank accounts and cards as external_accounts on Account objects
|
||||
|
||||
## 2.1.4 - 2015-05-13
|
||||
* Fix CA certificate file path (thanks @lphilps & @matthewarkin)
|
||||
|
||||
## 2.1.3 - 2015-05-12
|
||||
* Fix to account updating to permit `tos_acceptance` and `personal_address` to be set properly
|
||||
* Fix to Transfer reversal creation (thanks @neatness!)
|
||||
* Network requests are now done through a swappable class for easier mocking
|
||||
|
||||
## 2.1.2 - 2015-04-10
|
||||
* Remove SSL cert revokation checking (all pre-Heartbleed certs have expired)
|
||||
* Bug fixes to account updating
|
||||
|
||||
## 2.1.1 - 2015-02-27
|
||||
* Support transfer reversals
|
||||
|
||||
## 2.1.0 - 2015-02-19
|
||||
* Support new API version (2015-02-18)
|
||||
* Added Bitcoin Receiever update and delete actions
|
||||
* Edited tests to prefer "source" over "card" as per new API version
|
||||
|
||||
## 2.0.1 - 2015-02-16
|
||||
* Fix to fetching endpoints that use a non-default baseUrl (`FileUpload`)
|
||||
|
||||
## 2.0.0 - 2015-02-14
|
||||
* Bumped minimum version to 5.3.3
|
||||
* Switched to Stripe namespace instead of Stripe_ class name prefiexes (thanks @chadicus!)
|
||||
* Switched tests to PHPUnit (thanks @chadicus!)
|
||||
* Switched style guide to PSR2 (thanks @chadicus!)
|
||||
* Added $opts hash to the end of most methods: this permits passing 'idempotency_key', 'stripe_account', or 'stripe_version'. The last 2 will persist across multiple object loads.
|
||||
* Added support for retrieving Account by ID
|
||||
|
||||
## 1.18.0 - 2015-01-21
|
||||
* Support making bitcoin charges through BitcoinReceiver source object
|
||||
|
||||
## 1.17.5 - 2014-12-23
|
||||
* Adding support for creating file uploads.
|
||||
|
||||
## 1.17.4 - 2014-12-15
|
||||
* Saving objects fetched with a custom key now works (thanks @JustinHook & @jpasilan)
|
||||
* Added methods for reporting charges as safe or fraudulent and for specifying the reason for refunds
|
||||
|
||||
## 1.17.3 - 2014-11-06
|
||||
* Better handling of HHVM support for SSL certificate blacklist checking.
|
||||
|
||||
## 1.17.2 - 2014-09-23
|
||||
* Coupons now are backed by a `Stripe_Coupon` instead of `Stripe_Object`, and support updating metadata
|
||||
* Running operations (`create`, `retrieve`, `all`) on upcoming invoice items now works
|
||||
|
||||
## 1.17.1 - 2014-07-31
|
||||
* Requests now send Content-Type header
|
||||
|
||||
## 1.17.0 - 2014-07-29
|
||||
* Application Fee refunds now a list instead of array
|
||||
* HHVM now works
|
||||
* Small bug fixes (thanks @bencromwell & @fastest963)
|
||||
* `__toString` now returns the name of the object in addition to its JSON representation
|
||||
|
||||
## 1.16.0 - 2014-06-17
|
||||
* Add metadata for refunds and disputes
|
||||
|
||||
## 1.15.0 - 2014-05-28
|
||||
* Support canceling transfers
|
||||
|
||||
## 1.14.1 - 2014-05-21
|
||||
* Support cards for recipients.
|
||||
|
||||
## 1.13.1 - 2014-05-15
|
||||
* Fix bug in account resource where `id` wasn't in the result
|
||||
|
||||
## 1.13.0 - 2014-04-10
|
||||
* Add support for certificate blacklisting
|
||||
* Update ca bundle
|
||||
* Drop support for HHVM (Temporarily)
|
||||
|
||||
## 1.12.0 - 2014-04-01
|
||||
* Add Stripe_RateLimitError for catching rate limit errors.
|
||||
* Update to Zend coding style (thanks, @jpiasetz)
|
||||
|
||||
## 1.11.0 - 2014-01-29
|
||||
* Add support for multiple subscriptions per customer
|
||||
|
||||
## 1.10.1 - 2013-12-02
|
||||
* Add new ApplicationFee
|
||||
|
||||
## 1.9.1 - 2013-11-08
|
||||
* Fix a bug where a null nestable object causes warnings to fire.
|
||||
|
||||
## 1.9.0 - 2013-10-16
|
||||
* Add support for metadata API.
|
||||
|
||||
## 1.8.4 - 2013-09-18
|
||||
* Add support for closing disputes.
|
||||
|
||||
## 1.8.3 - 2013-08-13
|
||||
* Add new Balance and BalanceTransaction
|
||||
|
||||
## 1.8.2 - 2013-08-12
|
||||
* Add support for unsetting attributes by updating to NULL. Setting properties to a blank string is now an error.
|
||||
|
||||
## 1.8.1 - 2013-07-12
|
||||
* Add support for multiple cards API (Stripe API version 2013-07-12: https://stripe.com/docs/upgrades#2013-07-05)
|
||||
|
||||
## 1.8.0 - 2013-04-11
|
||||
* Allow Transfers to be creatable
|
||||
* Add new Recipient resource
|
||||
|
||||
## 1.7.15 - 2013-02-21
|
||||
* Add 'id' to the list of permanent object attributes
|
||||
|
||||
## 1.7.14 - 2013-02-20
|
||||
|
||||
* Don't re-encode strings that are already encoded in UTF-8. If you were previously using plan or coupon objects with UTF-8 IDs, they may have been treated as ISO-8859-1 (Latin-1) and encoded to UTF-8 a 2nd time. You may now need to pass the IDs to utf8_encode before passing them to Stripe_Plan::retrieve or Stripe_Coupon::retrieve.
|
||||
* Ensure that all input is encoded in UTF-8 before submitting it to Stripe's servers. (github issue #27)
|
||||
|
||||
## 1.7.13 - 2013-02-01
|
||||
* Add support for passing options when retrieving Stripe objects e.g., Stripe_Charge::retrieve(array("id"=>"foo", "expand" => array("customer"))); Stripe_Charge::retrieve("foo") will continue to work
|
||||
|
||||
## 1.7.12 - 2013-01-15
|
||||
* Add support for setting a Stripe API version override
|
||||
|
||||
## 1.7.11 - 2012-12-30
|
||||
* Version bump to cleanup constants and such (fix issue #26)
|
||||
|
||||
## 1.7.10 - 2012-11-08
|
||||
* Add support for updating charge disputes.
|
||||
* Fix bug preventing retrieval of null attributes
|
||||
|
||||
## 1.7.9 - 2012-11-08
|
||||
* Fix usage under autoloaders such as the one generated by composer (fix issue #22)
|
||||
|
||||
## 1.7.8 - 2012-10-30
|
||||
* Add support for creating invoices.
|
||||
* Add support for new invoice lines return format
|
||||
* Add support for new list objects
|
||||
|
||||
## 1.7.7 - 2012-09-14
|
||||
* Get all of the various version numbers in the repo in sync (no other changes)
|
||||
|
||||
## 1.7.6 - 2012-08-31
|
||||
* Add update and pay methods to Invoice resource
|
||||
|
||||
## 1.7.5 - 2012-08-23
|
||||
* Change internal function names so that Stripe_SingletonApiRequest is E_STRICT-clean (github issue #16)
|
||||
|
||||
## 1.7.4 - 2012-08-21
|
||||
* Bugfix so that Stripe objects (e.g. Customer, Charge objects) used in API calls are transparently converted to their object IDs
|
||||
|
||||
## 1.7.3 - 2012-08-15
|
||||
* Add new Account resource
|
||||
|
||||
## 1.7.2 - 2012-06-26
|
||||
* Make clearer that you should be including lib/Stripe.php, not test/Stripe.php (github issue #14)
|
||||
|
||||
## 1.7.1 - 2012-05-24
|
||||
* Add missing argument to Stripe_InvalidRequestError constructor in Stripe_ApiResource::instanceUrl. Fixes a warning when Stripe_ApiResource::instanceUrl is called on a resource with no ID (fix issue #12)
|
||||
|
||||
## 1.7.0 - 2012-05-17
|
||||
* Support Composer and Packagist (github issue #9)
|
||||
* Add new deleteDiscount method to Stripe_Customer
|
||||
* Add new Transfer resource
|
||||
* Switch from using HTTP Basic auth to Bearer auth. (Note: Stripe will support Basic auth for the indefinite future, but recommends Bearer auth when possible going forward)
|
||||
* Numerous test suite improvements
|
||||
21
vendor/stripe-php-7.0.2/LICENSE
vendored
Normal file
21
vendor/stripe-php-7.0.2/LICENSE
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License
|
||||
|
||||
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
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
268
vendor/stripe-php-7.0.2/README.md
vendored
Normal file
268
vendor/stripe-php-7.0.2/README.md
vendored
Normal file
@@ -0,0 +1,268 @@
|
||||
# Stripe PHP bindings
|
||||
|
||||
[](https://travis-ci.org/stripe/stripe-php)
|
||||
[](https://packagist.org/packages/stripe/stripe-php)
|
||||
[](https://packagist.org/packages/stripe/stripe-php)
|
||||
[](https://packagist.org/packages/stripe/stripe-php)
|
||||
[](https://coveralls.io/r/stripe/stripe-php?branch=master)
|
||||
|
||||
The Stripe PHP library provides convenient access to the Stripe API from
|
||||
applications written in the PHP language. It includes a pre-defined set of
|
||||
classes for API resources that initialize themselves dynamically from API
|
||||
responses which makes it compatible with a wide range of versions of the Stripe
|
||||
API.
|
||||
|
||||
## Requirements
|
||||
|
||||
PHP 5.6.0 and later.
|
||||
|
||||
## Composer
|
||||
|
||||
You can install the bindings via [Composer](http://getcomposer.org/). Run the following command:
|
||||
|
||||
```bash
|
||||
composer require stripe/stripe-php
|
||||
```
|
||||
|
||||
To use the bindings, use Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading):
|
||||
|
||||
```php
|
||||
require_once('vendor/autoload.php');
|
||||
```
|
||||
|
||||
## Manual Installation
|
||||
|
||||
If you do not wish to use Composer, you can download the [latest release](https://github.com/stripe/stripe-php/releases). Then, to use the bindings, include the `init.php` file.
|
||||
|
||||
```php
|
||||
require_once('/path/to/stripe-php/init.php');
|
||||
```
|
||||
|
||||
## Dependencies
|
||||
|
||||
The bindings require the following extensions in order to work properly:
|
||||
|
||||
- [`curl`](https://secure.php.net/manual/en/book.curl.php), although you can use your own non-cURL client if you prefer
|
||||
- [`json`](https://secure.php.net/manual/en/book.json.php)
|
||||
- [`mbstring`](https://secure.php.net/manual/en/book.mbstring.php) (Multibyte String)
|
||||
|
||||
If you use Composer, these dependencies should be handled automatically. If you install manually, you'll want to make sure that these extensions are available.
|
||||
|
||||
## Getting Started
|
||||
|
||||
Simple usage looks like:
|
||||
|
||||
```php
|
||||
\Stripe\Stripe::setApiKey('sk_test_BQokikJOvBiI2HlWgH4olfQ2');
|
||||
$charge = \Stripe\Charge::create(['amount' => 2000, 'currency' => 'usd', 'source' => 'tok_189fqt2eZvKYlo2CTGBeg6Uq']);
|
||||
echo $charge;
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
See the [PHP API docs](https://stripe.com/docs/api/php#intro).
|
||||
|
||||
## Legacy Version Support
|
||||
|
||||
### PHP 5.4 & 5.5
|
||||
|
||||
If you are using PHP 5.4 or 5.5, you can download v6.21.1 ([zip](https://github.com/stripe/stripe-php/archive/v6.21.1.zip), [tar.gz](https://github.com/stripe/stripe-php/archive/v5.9.2.tar.gz)) from our [releases page](https://github.com/stripe/stripe-php/releases). This version will continue to work with new versions of the Stripe API for all common uses.
|
||||
|
||||
### PHP 5.3
|
||||
|
||||
If you are using PHP 5.3, you can download v5.9.2 ([zip](https://github.com/stripe/stripe-php/archive/v5.9.2.zip), [tar.gz](https://github.com/stripe/stripe-php/archive/v5.9.2.tar.gz)) from our [releases page](https://github.com/stripe/stripe-php/releases). This version will continue to work with new versions of the Stripe API for all common uses.
|
||||
|
||||
### PHP 5.2
|
||||
|
||||
If you are using PHP 5.2, you can download v1.18.0 ([zip](https://github.com/stripe/stripe-php/archive/v1.18.0.zip), [tar.gz](https://github.com/stripe/stripe-php/archive/v1.18.0.tar.gz)) from our [releases page](https://github.com/stripe/stripe-php/releases). This version will continue to work with new versions of the Stripe API for all common uses.
|
||||
|
||||
This legacy version may be included via `require_once("/path/to/stripe-php/lib/Stripe.php");`, and used like:
|
||||
|
||||
```php
|
||||
Stripe::setApiKey('d8e8fca2dc0f896fd7cb4cb0031ba249');
|
||||
$charge = Stripe_Charge::create(array('source' => 'tok_XXXXXXXX', 'amount' => 2000, 'currency' => 'usd'));
|
||||
echo $charge;
|
||||
```
|
||||
|
||||
## Custom Request Timeouts
|
||||
|
||||
*NOTE:* We do not recommend decreasing the timeout for non-read-only calls (e.g. charge creation), since even if you locally timeout, the request on Stripe's side can still complete. If you are decreasing timeouts on these calls, make sure to use [idempotency tokens](https://stripe.com/docs/api/php#idempotent_requests) to avoid executing the same transaction twice as a result of timeout retry logic.
|
||||
|
||||
To modify request timeouts (connect or total, in seconds) you'll need to tell the API client to use a CurlClient other than its default. You'll set the timeouts in that CurlClient.
|
||||
|
||||
```php
|
||||
// set up your tweaked Curl client
|
||||
$curl = new \Stripe\HttpClient\CurlClient();
|
||||
$curl->setTimeout(10); // default is \Stripe\HttpClient\CurlClient::DEFAULT_TIMEOUT
|
||||
$curl->setConnectTimeout(5); // default is \Stripe\HttpClient\CurlClient::DEFAULT_CONNECT_TIMEOUT
|
||||
|
||||
echo $curl->getTimeout(); // 10
|
||||
echo $curl->getConnectTimeout(); // 5
|
||||
|
||||
// tell Stripe to use the tweaked client
|
||||
\Stripe\ApiRequestor::setHttpClient($curl);
|
||||
|
||||
// use the Stripe API client as you normally would
|
||||
```
|
||||
|
||||
## Custom cURL Options (e.g. proxies)
|
||||
|
||||
Need to set a proxy for your requests? Pass in the requisite `CURLOPT_*` array to the CurlClient constructor, using the same syntax as `curl_stopt_array()`. This will set the default cURL options for each HTTP request made by the SDK, though many more common options (e.g. timeouts; see above on how to set those) will be overridden by the client even if set here.
|
||||
|
||||
```php
|
||||
// set up your tweaked Curl client
|
||||
$curl = new \Stripe\HttpClient\CurlClient([CURLOPT_PROXY => 'proxy.local:80']);
|
||||
// tell Stripe to use the tweaked client
|
||||
\Stripe\ApiRequestor::setHttpClient($curl);
|
||||
```
|
||||
|
||||
Alternately, a callable can be passed to the CurlClient constructor that returns the above array based on request inputs. See `testDefaultOptions()` in `tests/CurlClientTest.php` for an example of this behavior. Note that the callable is called at the beginning of every API request, before the request is sent.
|
||||
|
||||
### Configuring a Logger
|
||||
|
||||
The library does minimal logging, but it can be configured
|
||||
with a [`PSR-3` compatible logger][psr3] so that messages
|
||||
end up there instead of `error_log`:
|
||||
|
||||
```php
|
||||
\Stripe\Stripe::setLogger($logger);
|
||||
```
|
||||
|
||||
### Accessing response data
|
||||
|
||||
You can access the data from the last API response on any object via `getLastResponse()`.
|
||||
|
||||
```php
|
||||
$charge = \Stripe\Charge::create(['amount' => 2000, 'currency' => 'usd', 'source' => 'tok_visa']);
|
||||
echo $charge->getLastResponse()->headers['Request-Id'];
|
||||
```
|
||||
|
||||
### SSL / TLS compatibility issues
|
||||
|
||||
Stripe's API now requires that [all connections use TLS 1.2](https://stripe.com/blog/upgrading-tls). Some systems (most notably some older CentOS and RHEL versions) are capable of using TLS 1.2 but will use TLS 1.0 or 1.1 by default. In this case, you'd get an `invalid_request_error` with the following error message: "Stripe no longer supports API requests made with TLS 1.0. Please initiate HTTPS connections with TLS 1.2 or later. You can learn more about this at [https://stripe.com/blog/upgrading-tls](https://stripe.com/blog/upgrading-tls).".
|
||||
|
||||
The recommended course of action is to [upgrade your cURL and OpenSSL packages](https://support.stripe.com/questions/how-do-i-upgrade-my-stripe-integration-from-tls-1-0-to-tls-1-2#php) so that TLS 1.2 is used by default, but if that is not possible, you might be able to solve the issue by setting the `CURLOPT_SSLVERSION` option to either `CURL_SSLVERSION_TLSv1` or `CURL_SSLVERSION_TLSv1_2`:
|
||||
|
||||
```php
|
||||
$curl = new \Stripe\HttpClient\CurlClient([CURLOPT_SSLVERSION => CURL_SSLVERSION_TLSv1]);
|
||||
\Stripe\ApiRequestor::setHttpClient($curl);
|
||||
```
|
||||
|
||||
### Per-request Configuration
|
||||
|
||||
For apps that need to use multiple keys during the lifetime of a process, like
|
||||
one that uses [Stripe Connect][connect], it's also possible to set a
|
||||
per-request key and/or account:
|
||||
|
||||
```php
|
||||
\Stripe\Charge::all([], [
|
||||
'api_key' => 'sk_test_...',
|
||||
'stripe_account' => 'acct_...'
|
||||
]);
|
||||
|
||||
\Stripe\Charge::retrieve("ch_18atAXCdGbJFKhCuBAa4532Z", [
|
||||
'api_key' => 'sk_test_...',
|
||||
'stripe_account' => 'acct_...'
|
||||
]);
|
||||
```
|
||||
|
||||
### Configuring CA Bundles
|
||||
|
||||
By default, the library will use its own internal bundle of known CA
|
||||
certificates, but it's possible to configure your own:
|
||||
|
||||
```php
|
||||
\Stripe\Stripe::setCABundlePath("path/to/ca/bundle");
|
||||
```
|
||||
|
||||
### Configuring Automatic Retries
|
||||
|
||||
The library can be configured to automatically retry requests that fail due to
|
||||
an intermittent network problem:
|
||||
|
||||
```php
|
||||
\Stripe\Stripe::setMaxNetworkRetries(2);
|
||||
```
|
||||
|
||||
[Idempotency keys][idempotency-keys] are added to requests to guarantee that
|
||||
retries are safe.
|
||||
|
||||
### Request latency telemetry
|
||||
|
||||
By default, the library sends request latency telemetry to Stripe. These
|
||||
numbers help Stripe improve the overall latency of its API for all users.
|
||||
|
||||
You can disable this behavior if you prefer:
|
||||
|
||||
```php
|
||||
\Stripe\Stripe::setEnableTelemetry(false);
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
Get [Composer][composer]. For example, on Mac OS:
|
||||
|
||||
```bash
|
||||
brew install composer
|
||||
```
|
||||
|
||||
Install dependencies:
|
||||
|
||||
```bash
|
||||
composer install
|
||||
```
|
||||
|
||||
The test suite depends on [stripe-mock], so make sure to fetch and run it from a
|
||||
background terminal ([stripe-mock's README][stripe-mock] also contains
|
||||
instructions for installing via Homebrew and other methods):
|
||||
|
||||
```bash
|
||||
go get -u github.com/stripe/stripe-mock
|
||||
stripe-mock
|
||||
```
|
||||
|
||||
Install dependencies as mentioned above (which will resolve [PHPUnit](http://packagist.org/packages/phpunit/phpunit)), then you can run the test suite:
|
||||
|
||||
```bash
|
||||
./vendor/bin/phpunit
|
||||
```
|
||||
|
||||
Or to run an individual test file:
|
||||
|
||||
```bash
|
||||
./vendor/bin/phpunit tests/UtilTest.php
|
||||
```
|
||||
|
||||
Update bundled CA certificates from the [Mozilla cURL release][curl]:
|
||||
|
||||
```bash
|
||||
./update_certs.php
|
||||
```
|
||||
|
||||
The library uses [PHP CS Fixer][php-cs-fixer] for code formatting. Code must be formatted before PRs are submitted, otherwise CI will fail. Run the formatter with:
|
||||
|
||||
```bash
|
||||
./vendor/bin/php-cs-fixer fix -v .
|
||||
```
|
||||
|
||||
## Attention plugin developers
|
||||
|
||||
Are you writing a plugin that integrates Stripe and embeds our library? Then please use the `setAppInfo` function to identify your plugin. For example:
|
||||
|
||||
```php
|
||||
\Stripe\Stripe::setAppInfo("MyAwesomePlugin", "1.2.34", "https://myawesomeplugin.info");
|
||||
```
|
||||
|
||||
The method should be called once, before any request is sent to the API. The second and third parameters are optional.
|
||||
|
||||
### SSL / TLS configuration option
|
||||
|
||||
See the "SSL / TLS compatibility issues" paragraph above for full context. If you want to ensure that your plugin can be used on all systems, you should add a configuration option to let your users choose between different values for `CURLOPT_SSLVERSION`: none (default), `CURL_SSLVERSION_TLSv1` and `CURL_SSLVERSION_TLSv1_2`.
|
||||
|
||||
[composer]: https://getcomposer.org/
|
||||
[connect]: https://stripe.com/connect
|
||||
[curl]: http://curl.haxx.se/docs/caextract.html
|
||||
[idempotency-keys]: https://stripe.com/docs/api/php#idempotent_requests
|
||||
[php-cs-fixer]: https://github.com/FriendsOfPHP/PHP-CS-Fixer
|
||||
[psr3]: http://www.php-fig.org/psr/psr-3/
|
||||
[stripe-mock]: https://github.com/stripe/stripe-mock
|
||||
1
vendor/stripe-php-7.0.2/VERSION
vendored
Normal file
1
vendor/stripe-php-7.0.2/VERSION
vendored
Normal file
@@ -0,0 +1 @@
|
||||
7.0.2
|
||||
36
vendor/stripe-php-7.0.2/build.php
vendored
Executable file
36
vendor/stripe-php-7.0.2/build.php
vendored
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
chdir(dirname(__FILE__));
|
||||
|
||||
$autoload = (int)$argv[1];
|
||||
$returnStatus = null;
|
||||
|
||||
if (!$autoload) {
|
||||
// Modify composer to not autoload Stripe
|
||||
$composer = json_decode(file_get_contents('composer.json'), true);
|
||||
unset($composer['autoload']);
|
||||
unset($composer['require-dev']['squizlabs/php_codesniffer']);
|
||||
file_put_contents('composer.json', json_encode($composer, JSON_PRETTY_PRINT));
|
||||
}
|
||||
|
||||
passthru('composer update', $returnStatus);
|
||||
if ($returnStatus !== 0) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if ($autoload) {
|
||||
// Only run CS on 1 of the 2 environments
|
||||
passthru(
|
||||
'./vendor/bin/phpcs --standard=PSR2 -n lib tests *.php',
|
||||
$returnStatus
|
||||
);
|
||||
if ($returnStatus !== 0) {
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
$config = $autoload ? 'phpunit.xml' : 'phpunit.no_autoload.xml';
|
||||
passthru("./vendor/bin/phpunit -c $config", $returnStatus);
|
||||
if ($returnStatus !== 0) {
|
||||
exit(1);
|
||||
}
|
||||
38
vendor/stripe-php-7.0.2/composer.json
vendored
Normal file
38
vendor/stripe-php-7.0.2/composer.json
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "stripe/stripe-php",
|
||||
"description": "Stripe PHP Library",
|
||||
"keywords": [
|
||||
"stripe",
|
||||
"payment processing",
|
||||
"api"
|
||||
],
|
||||
"homepage": "https://stripe.com/",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Stripe and contributors",
|
||||
"homepage": "https://github.com/stripe/stripe-php/contributors"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.6.0",
|
||||
"ext-curl": "*",
|
||||
"ext-json": "*",
|
||||
"ext-mbstring": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^5.7",
|
||||
"php-coveralls/php-coveralls": "^2.1",
|
||||
"squizlabs/php_codesniffer": "^3.3",
|
||||
"symfony/process": "~3.4",
|
||||
"friendsofphp/php-cs-fixer": "^2.15"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": { "Stripe\\" : "lib/" }
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.0-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
3476
vendor/stripe-php-7.0.2/data/ca-certificates.crt
vendored
Normal file
3476
vendor/stripe-php-7.0.2/data/ca-certificates.crt
vendored
Normal file
File diff suppressed because it is too large
Load Diff
149
vendor/stripe-php-7.0.2/init.php
vendored
Normal file
149
vendor/stripe-php-7.0.2/init.php
vendored
Normal file
@@ -0,0 +1,149 @@
|
||||
<?php
|
||||
|
||||
// Stripe singleton
|
||||
require(dirname(__FILE__) . '/lib/Stripe.php');
|
||||
|
||||
// Utilities
|
||||
require(dirname(__FILE__) . '/lib/Util/CaseInsensitiveArray.php');
|
||||
require(dirname(__FILE__) . '/lib/Util/LoggerInterface.php');
|
||||
require(dirname(__FILE__) . '/lib/Util/DefaultLogger.php');
|
||||
require(dirname(__FILE__) . '/lib/Util/RandomGenerator.php');
|
||||
require(dirname(__FILE__) . '/lib/Util/RequestOptions.php');
|
||||
require(dirname(__FILE__) . '/lib/Util/Set.php');
|
||||
require(dirname(__FILE__) . '/lib/Util/Util.php');
|
||||
|
||||
// HttpClient
|
||||
require(dirname(__FILE__) . '/lib/HttpClient/ClientInterface.php');
|
||||
require(dirname(__FILE__) . '/lib/HttpClient/CurlClient.php');
|
||||
|
||||
// Exceptions
|
||||
require(dirname(__FILE__) . '/lib/Exception/ExceptionInterface.php');
|
||||
require(dirname(__FILE__) . '/lib/Exception/ApiErrorException.php');
|
||||
require(dirname(__FILE__) . '/lib/Exception/ApiConnectionException.php');
|
||||
require(dirname(__FILE__) . '/lib/Exception/AuthenticationException.php');
|
||||
require(dirname(__FILE__) . '/lib/Exception/BadMethodCallException.php');
|
||||
require(dirname(__FILE__) . '/lib/Exception/CardException.php');
|
||||
require(dirname(__FILE__) . '/lib/Exception/IdempotencyException.php');
|
||||
require(dirname(__FILE__) . '/lib/Exception/InvalidArgumentException.php');
|
||||
require(dirname(__FILE__) . '/lib/Exception/InvalidRequestException.php');
|
||||
require(dirname(__FILE__) . '/lib/Exception/PermissionException.php');
|
||||
require(dirname(__FILE__) . '/lib/Exception/RateLimitException.php');
|
||||
require(dirname(__FILE__) . '/lib/Exception/SignatureVerificationException.php');
|
||||
require(dirname(__FILE__) . '/lib/Exception/UnexpectedValueException.php');
|
||||
require(dirname(__FILE__) . '/lib/Exception/UnknownApiErrorException.php');
|
||||
|
||||
// OAuth exceptions
|
||||
require(dirname(__FILE__) . '/lib/Exception/OAuth/ExceptionInterface.php');
|
||||
require(dirname(__FILE__) . '/lib/Exception/OAuth/OAuthErrorException.php');
|
||||
require(dirname(__FILE__) . '/lib/Exception/OAuth/InvalidClientException.php');
|
||||
require(dirname(__FILE__) . '/lib/Exception/OAuth/InvalidGrantException.php');
|
||||
require(dirname(__FILE__) . '/lib/Exception/OAuth/InvalidRequestException.php');
|
||||
require(dirname(__FILE__) . '/lib/Exception/OAuth/InvalidScopeException.php');
|
||||
require(dirname(__FILE__) . '/lib/Exception/OAuth/UnknownOAuthErrorException.php');
|
||||
require(dirname(__FILE__) . '/lib/Exception/OAuth/UnsupportedGrantTypeException.php');
|
||||
require(dirname(__FILE__) . '/lib/Exception/OAuth/UnsupportedResponseTypeException.php');
|
||||
|
||||
// API operations
|
||||
require(dirname(__FILE__) . '/lib/ApiOperations/All.php');
|
||||
require(dirname(__FILE__) . '/lib/ApiOperations/Create.php');
|
||||
require(dirname(__FILE__) . '/lib/ApiOperations/Delete.php');
|
||||
require(dirname(__FILE__) . '/lib/ApiOperations/NestedResource.php');
|
||||
require(dirname(__FILE__) . '/lib/ApiOperations/Request.php');
|
||||
require(dirname(__FILE__) . '/lib/ApiOperations/Retrieve.php');
|
||||
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');
|
||||
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');
|
||||
require(dirname(__FILE__) . '/lib/ApplicationFeeRefund.php');
|
||||
require(dirname(__FILE__) . '/lib/Balance.php');
|
||||
require(dirname(__FILE__) . '/lib/BalanceTransaction.php');
|
||||
require(dirname(__FILE__) . '/lib/BankAccount.php');
|
||||
require(dirname(__FILE__) . '/lib/BitcoinReceiver.php');
|
||||
require(dirname(__FILE__) . '/lib/BitcoinTransaction.php');
|
||||
require(dirname(__FILE__) . '/lib/Capability.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');
|
||||
require(dirname(__FILE__) . '/lib/CreditNote.php');
|
||||
require(dirname(__FILE__) . '/lib/Customer.php');
|
||||
require(dirname(__FILE__) . '/lib/CustomerBalanceTransaction.php');
|
||||
require(dirname(__FILE__) . '/lib/Discount.php');
|
||||
require(dirname(__FILE__) . '/lib/Dispute.php');
|
||||
require(dirname(__FILE__) . '/lib/EphemeralKey.php');
|
||||
require(dirname(__FILE__) . '/lib/ErrorObject.php');
|
||||
require(dirname(__FILE__) . '/lib/Event.php');
|
||||
require(dirname(__FILE__) . '/lib/ExchangeRate.php');
|
||||
require(dirname(__FILE__) . '/lib/File.php');
|
||||
require(dirname(__FILE__) . '/lib/FileLink.php');
|
||||
require(dirname(__FILE__) . '/lib/Invoice.php');
|
||||
require(dirname(__FILE__) . '/lib/InvoiceItem.php');
|
||||
require(dirname(__FILE__) . '/lib/InvoiceLineItem.php');
|
||||
require(dirname(__FILE__) . '/lib/Issuing/Authorization.php');
|
||||
require(dirname(__FILE__) . '/lib/Issuing/Card.php');
|
||||
require(dirname(__FILE__) . '/lib/Issuing/CardDetails.php');
|
||||
require(dirname(__FILE__) . '/lib/Issuing/Cardholder.php');
|
||||
require(dirname(__FILE__) . '/lib/Issuing/Dispute.php');
|
||||
require(dirname(__FILE__) . '/lib/Issuing/Transaction.php');
|
||||
require(dirname(__FILE__) . '/lib/LoginLink.php');
|
||||
require(dirname(__FILE__) . '/lib/Order.php');
|
||||
require(dirname(__FILE__) . '/lib/OrderItem.php');
|
||||
require(dirname(__FILE__) . '/lib/OrderReturn.php');
|
||||
require(dirname(__FILE__) . '/lib/PaymentIntent.php');
|
||||
require(dirname(__FILE__) . '/lib/PaymentMethod.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/EarlyFraudWarning.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/SetupIntent.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/TaxId.php');
|
||||
require(dirname(__FILE__) . '/lib/TaxRate.php');
|
||||
require(dirname(__FILE__) . '/lib/Terminal/ConnectionToken.php');
|
||||
require(dirname(__FILE__) . '/lib/Terminal/Location.php');
|
||||
require(dirname(__FILE__) . '/lib/Terminal/Reader.php');
|
||||
require(dirname(__FILE__) . '/lib/ThreeDSecure.php');
|
||||
require(dirname(__FILE__) . '/lib/Token.php');
|
||||
require(dirname(__FILE__) . '/lib/Topup.php');
|
||||
require(dirname(__FILE__) . '/lib/Transfer.php');
|
||||
require(dirname(__FILE__) . '/lib/TransferReversal.php');
|
||||
require(dirname(__FILE__) . '/lib/UsageRecord.php');
|
||||
require(dirname(__FILE__) . '/lib/UsageRecordSummary.php');
|
||||
|
||||
// OAuth
|
||||
require(dirname(__FILE__) . '/lib/OAuth.php');
|
||||
require(dirname(__FILE__) . '/lib/OAuthErrorObject.php');
|
||||
|
||||
// Webhooks
|
||||
require(dirname(__FILE__) . '/lib/Webhook.php');
|
||||
require(dirname(__FILE__) . '/lib/WebhookEndpoint.php');
|
||||
require(dirname(__FILE__) . '/lib/WebhookSignature.php');
|
||||
426
vendor/stripe-php-7.0.2/lib/Account.php
vendored
Normal file
426
vendor/stripe-php-7.0.2/lib/Account.php
vendored
Normal file
@@ -0,0 +1,426 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class Account
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @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 string $default_currency
|
||||
* @property bool $details_submitted
|
||||
* @property string $email
|
||||
* @property Collection $external_accounts
|
||||
* @property mixed $individual
|
||||
* @property StripeObject $metadata
|
||||
* @property bool $payouts_enabled
|
||||
* @property mixed $requirements
|
||||
* @property mixed $settings
|
||||
* @property mixed $tos_acceptance
|
||||
* @property string $type
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class Account extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "account";
|
||||
|
||||
use ApiOperations\All;
|
||||
use ApiOperations\Create;
|
||||
use ApiOperations\Delete;
|
||||
use ApiOperations\NestedResource;
|
||||
use ApiOperations\Retrieve {
|
||||
retrieve as protected _retrieve;
|
||||
}
|
||||
use ApiOperations\Update;
|
||||
|
||||
/**
|
||||
* Possible string representations of an account's business type.
|
||||
* @link https://stripe.com/docs/api/accounts/object#account_object-business_type
|
||||
*/
|
||||
const BUSINESS_TYPE_COMPANY = 'company';
|
||||
const BUSINESS_TYPE_INDIVIDUAL = 'individual';
|
||||
|
||||
/**
|
||||
* Possible string representations of an account's capabilities.
|
||||
* @link https://stripe.com/docs/api/accounts/object#account_object-capabilities
|
||||
*/
|
||||
const CAPABILITY_CARD_PAYMENTS = 'card_payments';
|
||||
const CAPABILITY_LEGACY_PAYMENTS = 'legacy_payments';
|
||||
const CAPABILITY_PLATFORM_PAYMENTS = 'platform_payments';
|
||||
|
||||
/**
|
||||
* Possible string representations of an account's capability status.
|
||||
* @link https://stripe.com/docs/api/accounts/object#account_object-capabilities
|
||||
*/
|
||||
const CAPABILITY_STATUS_ACTIVE = 'active';
|
||||
const CAPABILITY_STATUS_INACTIVE = 'inactive';
|
||||
const CAPABILITY_STATUS_PENDING = 'pending';
|
||||
|
||||
/**
|
||||
* Possible string representations of an account's type.
|
||||
* @link https://stripe.com/docs/api/accounts/object#account_object-type
|
||||
*/
|
||||
const TYPE_CUSTOM = 'custom';
|
||||
const TYPE_EXPRESS = 'express';
|
||||
const TYPE_STANDARD = 'standard';
|
||||
|
||||
public static function getSavedNestedResources()
|
||||
{
|
||||
static $savedNestedResources = null;
|
||||
if ($savedNestedResources === null) {
|
||||
$savedNestedResources = new Util\Set([
|
||||
'external_account',
|
||||
'bank_account',
|
||||
]);
|
||||
}
|
||||
return $savedNestedResources;
|
||||
}
|
||||
|
||||
const PATH_CAPABILITIES = '/capabilities';
|
||||
const PATH_EXTERNAL_ACCOUNTS = '/external_accounts';
|
||||
const PATH_LOGIN_LINKS = '/login_links';
|
||||
const PATH_PERSONS = '/persons';
|
||||
|
||||
public function instanceUrl()
|
||||
{
|
||||
if ($this['id'] === null) {
|
||||
return '/v1/account';
|
||||
} else {
|
||||
return parent::instanceUrl();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array|string|null $id The ID of the account to retrieve, or an
|
||||
* options array containing an `id` key.
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return Account
|
||||
*/
|
||||
public static function retrieve($id = null, $opts = null)
|
||||
{
|
||||
if (!$opts && is_string($id) && substr($id, 0, 3) === 'sk_') {
|
||||
$opts = $id;
|
||||
$id = null;
|
||||
}
|
||||
return self::_retrieve($id, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return Account The rejected account.
|
||||
*/
|
||||
public function reject($params = null, $opts = null)
|
||||
{
|
||||
$url = $this->instanceUrl() . '/reject';
|
||||
list($response, $opts) = $this->_request('post', $url, $params, $opts);
|
||||
$this->refreshFrom($response, $opts);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array|null $clientId
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return StripeObject Object containing the response from the API.
|
||||
*/
|
||||
public function deauthorize($clientId = null, $opts = null)
|
||||
{
|
||||
$params = [
|
||||
'client_id' => $clientId,
|
||||
'stripe_user_id' => $this->id,
|
||||
];
|
||||
return OAuth::deauthorize($params, $opts);
|
||||
}
|
||||
|
||||
/*
|
||||
* Capabilities methods
|
||||
* We can not add the capabilities() method today as the Account object already has a
|
||||
* capabilities property which is a hash and not the sub-list of capabilities.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @param string $id The ID of the account to which the capability belongs.
|
||||
* @param string $capabilityId The ID of the capability to retrieve.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return Capability
|
||||
*/
|
||||
public static function retrieveCapability($id, $capabilityId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_retrieveNestedResource($id, static::PATH_CAPABILITIES, $capabilityId, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id The ID of the account to which the capability belongs.
|
||||
* @param string $capabilityId The ID of the capability to update.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @return Capability
|
||||
*/
|
||||
public static function updateCapability($id, $capabilityId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_updateNestedResource($id, static::PATH_CAPABILITIES, $capabilityId, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id The ID of the account on which to retrieve the capabilities.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return Collection The list of capabilities.
|
||||
*/
|
||||
public static function allCapabilities($id, $params = null, $opts = null)
|
||||
{
|
||||
return self::_allNestedResources($id, static::PATH_CAPABILITIES, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id The ID of the account on which to create the external account.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return BankAccount|Card
|
||||
*/
|
||||
public static function createExternalAccount($id, $params = null, $opts = null)
|
||||
{
|
||||
return self::_createNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id The ID of the account to which the external account belongs.
|
||||
* @param string $externalAccountId The ID of the external account to retrieve.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return BankAccount|Card
|
||||
*/
|
||||
public static function retrieveExternalAccount($id, $externalAccountId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_retrieveNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $externalAccountId, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id The ID of the account to which the external account belongs.
|
||||
* @param string $externalAccountId The ID of the external account to update.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return BankAccount|Card
|
||||
*/
|
||||
public static function updateExternalAccount($id, $externalAccountId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_updateNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $externalAccountId, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id The ID of the account to which the external account belongs.
|
||||
* @param string $externalAccountId The ID of the external account to delete.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return BankAccount|Card
|
||||
*/
|
||||
public static function deleteExternalAccount($id, $externalAccountId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_deleteNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $externalAccountId, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id The ID of the account on which to retrieve the external accounts.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return Collection The list of external accounts (BankAccount or Card).
|
||||
*/
|
||||
public static function allExternalAccounts($id, $params = null, $opts = null)
|
||||
{
|
||||
return self::_allNestedResources($id, static::PATH_EXTERNAL_ACCOUNTS, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id The ID of the account on which to create the login link.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return LoginLink
|
||||
*/
|
||||
public static function createLoginLink($id, $params = null, $opts = null)
|
||||
{
|
||||
return self::_createNestedResource($id, static::PATH_LOGIN_LINKS, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array|null $params
|
||||
* @param array|string|null $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @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 string $id The ID of the account on which to create the person.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return Person
|
||||
*/
|
||||
public static function createPerson($id, $params = null, $opts = null)
|
||||
{
|
||||
return self::_createNestedResource($id, static::PATH_PERSONS, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id The ID of the account to which the person belongs.
|
||||
* @param string $personId The ID of the person to retrieve.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return Person
|
||||
*/
|
||||
public static function retrievePerson($id, $personId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_retrieveNestedResource($id, static::PATH_PERSONS, $personId, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id The ID of the account to which the person belongs.
|
||||
* @param string $personId The ID of the person to update.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return Person
|
||||
*/
|
||||
public static function updatePerson($id, $personId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_updateNestedResource($id, static::PATH_PERSONS, $personId, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id The ID of the account to which the person belongs.
|
||||
* @param string $personId The ID of the person to delete.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return Person
|
||||
*/
|
||||
public static function deletePerson($id, $personId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_deleteNestedResource($id, static::PATH_PERSONS, $personId, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id The ID of the account on which to retrieve the persons.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return Collection The list of persons.
|
||||
*/
|
||||
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);
|
||||
if (isset($this->_values['legal_entity'])) {
|
||||
$entity = $this['legal_entity'];
|
||||
if (isset($entity->_values['additional_owners'])) {
|
||||
$owners = $entity['additional_owners'];
|
||||
$entityUpdate = isset($update['legal_entity']) ? $update['legal_entity'] : [];
|
||||
$entityUpdate['additional_owners'] = $this->serializeAdditionalOwners($entity, $owners);
|
||||
$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;
|
||||
}
|
||||
|
||||
private function serializeAdditionalOwners($legalEntity, $additionalOwners)
|
||||
{
|
||||
if (isset($legalEntity->_originalValues['additional_owners'])) {
|
||||
$originalValue = $legalEntity->_originalValues['additional_owners'];
|
||||
} else {
|
||||
$originalValue = [];
|
||||
}
|
||||
if (($originalValue) && (count($originalValue) > count($additionalOwners))) {
|
||||
throw new Exception\InvalidArgumentException(
|
||||
"You cannot delete an item from an array, you must instead set a new array"
|
||||
);
|
||||
}
|
||||
|
||||
$updateArr = [];
|
||||
foreach ($additionalOwners as $i => $v) {
|
||||
$update = ($v instanceof StripeObject) ? $v->serializeParameters() : $v;
|
||||
|
||||
if ($update !== []) {
|
||||
if (!$originalValue ||
|
||||
!array_key_exists($i, $originalValue) ||
|
||||
($update != $legalEntity->serializeParamsValue($originalValue[$i], null, false, true))) {
|
||||
$updateArr[$i] = $update;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $updateArr;
|
||||
}
|
||||
}
|
||||
20
vendor/stripe-php-7.0.2/lib/AccountLink.php
vendored
Normal file
20
vendor/stripe-php-7.0.2/lib/AccountLink.php
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
<?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;
|
||||
}
|
||||
73
vendor/stripe-php-7.0.2/lib/AlipayAccount.php
vendored
Normal file
73
vendor/stripe-php-7.0.2/lib/AlipayAccount.php
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class AlipayAccount
|
||||
*
|
||||
* @package Stripe
|
||||
*
|
||||
* @deprecated Alipay accounts are deprecated. Please use the sources API instead.
|
||||
* @link https://stripe.com/docs/sources/alipay
|
||||
*/
|
||||
class AlipayAccount extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "alipay_account";
|
||||
|
||||
use ApiOperations\Delete;
|
||||
use ApiOperations\Update;
|
||||
|
||||
/**
|
||||
* @return string The instance URL for this resource. It needs to be special
|
||||
* cased because it doesn't fit into the standard resource pattern.
|
||||
*/
|
||||
public function instanceUrl()
|
||||
{
|
||||
if ($this['customer']) {
|
||||
$base = Customer::classUrl();
|
||||
$parent = $this['customer'];
|
||||
$path = 'sources';
|
||||
} else {
|
||||
$msg = "Alipay accounts cannot be accessed without a customer ID.";
|
||||
throw new Exception\UnexpectedValueException($msg);
|
||||
}
|
||||
$parentExtn = urlencode(Util\Util::utf8($parent));
|
||||
$extn = urlencode(Util\Util::utf8($this['id']));
|
||||
return "$base/$parentExtn/$path/$extn";
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array|string $_id
|
||||
* @param array|string|null $_opts
|
||||
*
|
||||
* @throws \Stripe\Exception\BadMethodCallException
|
||||
*
|
||||
* @deprecated Alipay accounts are deprecated. Please use the sources API instead.
|
||||
* @link https://stripe.com/docs/sources/alipay
|
||||
*/
|
||||
public static function retrieve($_id, $_opts = null)
|
||||
{
|
||||
$msg = "Alipay accounts cannot be retrieved without a customer ID. " .
|
||||
"Retrieve an Alipay account using `Customer::retrieveSource(" .
|
||||
"'customer_id', 'alipay_account_id')`.";
|
||||
throw new Exception\BadMethodCallException($msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $_id
|
||||
* @param array|null $_params
|
||||
* @param array|string|null $_options
|
||||
*
|
||||
* @throws \Stripe\Exception\BadMethodCallException
|
||||
*
|
||||
* @deprecated Alipay accounts are deprecated. Please use the sources API instead.
|
||||
* @link https://stripe.com/docs/sources/alipay
|
||||
*/
|
||||
public static function update($_id, $_params = null, $_options = null)
|
||||
{
|
||||
$msg = "Alipay accounts cannot be updated without a customer ID. " .
|
||||
"Update an Alipay account using `Customer::updateSource(" .
|
||||
"'customer_id', 'alipay_account_id', \$updateParams)`.";
|
||||
throw new Exception\BadMethodCallException($msg);
|
||||
}
|
||||
}
|
||||
36
vendor/stripe-php-7.0.2/lib/ApiOperations/All.php
vendored
Normal file
36
vendor/stripe-php-7.0.2/lib/ApiOperations/All.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\ApiOperations;
|
||||
|
||||
/**
|
||||
* Trait for listable resources. Adds a `all()` static method to the class.
|
||||
*
|
||||
* This trait should only be applied to classes that derive from StripeObject.
|
||||
*/
|
||||
trait All
|
||||
{
|
||||
/**
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return \Stripe\Collection of ApiResources
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
self::_validateParams($params);
|
||||
$url = static::classUrl();
|
||||
|
||||
list($response, $opts) = static::_staticRequest('get', $url, $params, $opts);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
if (!($obj instanceof \Stripe\Collection)) {
|
||||
throw new \Stripe\Exception\UnexpectedValueException(
|
||||
'Expected type ' . \Stripe\Collection::class . ', got "' . get_class($obj) . '" instead.'
|
||||
);
|
||||
}
|
||||
$obj->setLastResponse($response);
|
||||
$obj->setFilters($params);
|
||||
return $obj;
|
||||
}
|
||||
}
|
||||
30
vendor/stripe-php-7.0.2/lib/ApiOperations/Create.php
vendored
Normal file
30
vendor/stripe-php-7.0.2/lib/ApiOperations/Create.php
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\ApiOperations;
|
||||
|
||||
/**
|
||||
* Trait for creatable resources. Adds a `create()` static method to the class.
|
||||
*
|
||||
* This trait should only be applied to classes that derive from StripeObject.
|
||||
*/
|
||||
trait Create
|
||||
{
|
||||
/**
|
||||
* @param array|null $params
|
||||
* @param array|string|null $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return static The created resource.
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
self::_validateParams($params);
|
||||
$url = static::classUrl();
|
||||
|
||||
list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
return $obj;
|
||||
}
|
||||
}
|
||||
29
vendor/stripe-php-7.0.2/lib/ApiOperations/Delete.php
vendored
Normal file
29
vendor/stripe-php-7.0.2/lib/ApiOperations/Delete.php
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\ApiOperations;
|
||||
|
||||
/**
|
||||
* Trait for deletable resources. Adds a `delete()` method to the class.
|
||||
*
|
||||
* This trait should only be applied to classes that derive from StripeObject.
|
||||
*/
|
||||
trait Delete
|
||||
{
|
||||
/**
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return static The deleted resource.
|
||||
*/
|
||||
public function delete($params = null, $opts = null)
|
||||
{
|
||||
self::_validateParams($params);
|
||||
|
||||
$url = $this->instanceUrl();
|
||||
list($response, $opts) = $this->_request('delete', $url, $params, $opts);
|
||||
$this->refreshFrom($response, $opts);
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
128
vendor/stripe-php-7.0.2/lib/ApiOperations/NestedResource.php
vendored
Normal file
128
vendor/stripe-php-7.0.2/lib/ApiOperations/NestedResource.php
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\ApiOperations;
|
||||
|
||||
/**
|
||||
* Trait for resources that have nested resources.
|
||||
*
|
||||
* This trait should only be applied to classes that derive from StripeObject.
|
||||
*/
|
||||
trait NestedResource
|
||||
{
|
||||
/**
|
||||
* @param string $method
|
||||
* @param string $url
|
||||
* @param array|null $params
|
||||
* @param array|string|null $options
|
||||
*
|
||||
* @return \Stripe\StripeObject
|
||||
*/
|
||||
protected static function _nestedResourceOperation($method, $url, $params = null, $options = null)
|
||||
{
|
||||
self::_validateParams($params);
|
||||
|
||||
list($response, $opts) = static::_staticRequest($method, $url, $params, $options);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id
|
||||
* @param string $nestedPath
|
||||
* @param string|null $nestedId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected static function _nestedResourceUrl($id, $nestedPath, $nestedId = null)
|
||||
{
|
||||
$url = static::resourceUrl($id) . $nestedPath;
|
||||
if ($nestedId !== null) {
|
||||
$url .= "/$nestedId";
|
||||
}
|
||||
return $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id
|
||||
* @param string $nestedPath
|
||||
* @param array|null $params
|
||||
* @param array|string|null $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return \Stripe\StripeObject
|
||||
*/
|
||||
protected static function _createNestedResource($id, $nestedPath, $params = null, $options = null)
|
||||
{
|
||||
$url = static::_nestedResourceUrl($id, $nestedPath);
|
||||
return self::_nestedResourceOperation('post', $url, $params, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id
|
||||
* @param string $nestedPath
|
||||
* @param string|null $nestedId
|
||||
* @param array|null $params
|
||||
* @param array|string|null $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return \Stripe\StripeObject
|
||||
*/
|
||||
protected static function _retrieveNestedResource($id, $nestedPath, $nestedId, $params = null, $options = null)
|
||||
{
|
||||
$url = static::_nestedResourceUrl($id, $nestedPath, $nestedId);
|
||||
return self::_nestedResourceOperation('get', $url, $params, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id
|
||||
* @param string $nestedPath
|
||||
* @param string|null $nestedId
|
||||
* @param array|null $params
|
||||
* @param array|string|null $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return \Stripe\StripeObject
|
||||
*/
|
||||
protected static function _updateNestedResource($id, $nestedPath, $nestedId, $params = null, $options = null)
|
||||
{
|
||||
$url = static::_nestedResourceUrl($id, $nestedPath, $nestedId);
|
||||
return self::_nestedResourceOperation('post', $url, $params, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id
|
||||
* @param string $nestedPath
|
||||
* @param string|null $nestedId
|
||||
* @param array|null $params
|
||||
* @param array|string|null $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return \Stripe\StripeObject
|
||||
*/
|
||||
protected static function _deleteNestedResource($id, $nestedPath, $nestedId, $params = null, $options = null)
|
||||
{
|
||||
$url = static::_nestedResourceUrl($id, $nestedPath, $nestedId);
|
||||
return self::_nestedResourceOperation('delete', $url, $params, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id
|
||||
* @param string $nestedPath
|
||||
* @param array|null $params
|
||||
* @param array|string|null $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return \Stripe\StripeObject
|
||||
*/
|
||||
protected static function _allNestedResources($id, $nestedPath, $params = null, $options = null)
|
||||
{
|
||||
$url = static::_nestedResourceUrl($id, $nestedPath);
|
||||
return self::_nestedResourceOperation('get', $url, $params, $options);
|
||||
}
|
||||
}
|
||||
65
vendor/stripe-php-7.0.2/lib/ApiOperations/Request.php
vendored
Normal file
65
vendor/stripe-php-7.0.2/lib/ApiOperations/Request.php
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\ApiOperations;
|
||||
|
||||
/**
|
||||
* Trait for resources that need to make API requests.
|
||||
*
|
||||
* This trait should only be applied to classes that derive from StripeObject.
|
||||
*/
|
||||
trait Request
|
||||
{
|
||||
/**
|
||||
* @param array|null|mixed $params The list of parameters to validate
|
||||
*
|
||||
* @throws \Stripe\Exception\InvalidArgumentException if $params exists and is not an array
|
||||
*/
|
||||
protected static function _validateParams($params = null)
|
||||
{
|
||||
if ($params && !is_array($params)) {
|
||||
$message = "You must pass an array as the first argument to Stripe API "
|
||||
. "method calls. (HINT: an example call to create a charge "
|
||||
. "would be: \"Stripe\\Charge::create(['amount' => 100, "
|
||||
. "'currency' => 'usd', 'source' => 'tok_1234'])\")";
|
||||
throw new \Stripe\Exception\InvalidArgumentException($message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $method HTTP method ('get', 'post', etc.)
|
||||
* @param string $url URL for the request
|
||||
* @param array $params list of parameters for the request
|
||||
* @param array|string|null $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return array tuple containing (the JSON response, $options)
|
||||
*/
|
||||
protected function _request($method, $url, $params = [], $options = null)
|
||||
{
|
||||
$opts = $this->_opts->merge($options);
|
||||
list($resp, $options) = static::_staticRequest($method, $url, $params, $opts);
|
||||
$this->setLastResponse($resp);
|
||||
return [$resp->json, $options];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $method HTTP method ('get', 'post', etc.)
|
||||
* @param string $url URL for the request
|
||||
* @param array $params list of parameters for the request
|
||||
* @param array|string|null $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return array tuple containing (the JSON response, $options)
|
||||
*/
|
||||
protected static function _staticRequest($method, $url, $params, $options)
|
||||
{
|
||||
$opts = \Stripe\Util\RequestOptions::parse($options);
|
||||
$baseUrl = isset($opts->apiBase) ? $opts->apiBase : static::baseUrl();
|
||||
$requestor = new \Stripe\ApiRequestor($opts->apiKey, $baseUrl);
|
||||
list($response, $opts->apiKey) = $requestor->request($method, $url, $params, $opts->headers);
|
||||
$opts->discardNonPersistentHeaders();
|
||||
return [$response, $opts];
|
||||
}
|
||||
}
|
||||
29
vendor/stripe-php-7.0.2/lib/ApiOperations/Retrieve.php
vendored
Normal file
29
vendor/stripe-php-7.0.2/lib/ApiOperations/Retrieve.php
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\ApiOperations;
|
||||
|
||||
/**
|
||||
* Trait for retrievable resources. Adds a `retrieve()` static method to the
|
||||
* class.
|
||||
*
|
||||
* This trait should only be applied to classes that derive from StripeObject.
|
||||
*/
|
||||
trait Retrieve
|
||||
{
|
||||
/**
|
||||
* @param array|string $id The ID of the API resource to retrieve,
|
||||
* or an options array containing an `id` key.
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
$opts = \Stripe\Util\RequestOptions::parse($opts);
|
||||
$instance = new static($id, $opts);
|
||||
$instance->refresh();
|
||||
return $instance;
|
||||
}
|
||||
}
|
||||
50
vendor/stripe-php-7.0.2/lib/ApiOperations/Update.php
vendored
Normal file
50
vendor/stripe-php-7.0.2/lib/ApiOperations/Update.php
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\ApiOperations;
|
||||
|
||||
/**
|
||||
* Trait for updatable resources. Adds an `update()` static method and a
|
||||
* `save()` method to the class.
|
||||
*
|
||||
* This trait should only be applied to classes that derive from StripeObject.
|
||||
*/
|
||||
trait Update
|
||||
{
|
||||
/**
|
||||
* @param string $id The ID of the resource to update.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return static The updated resource.
|
||||
*/
|
||||
public static function update($id, $params = null, $opts = null)
|
||||
{
|
||||
self::_validateParams($params);
|
||||
$url = static::resourceUrl($id);
|
||||
|
||||
list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return static The saved resource.
|
||||
*/
|
||||
public function save($opts = null)
|
||||
{
|
||||
$params = $this->serializeParameters();
|
||||
if (count($params) > 0) {
|
||||
$url = $this->instanceUrl();
|
||||
list($response, $opts) = $this->_request('post', $url, $params, $opts);
|
||||
$this->refreshFrom($response, $opts);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
463
vendor/stripe-php-7.0.2/lib/ApiRequestor.php
vendored
Normal file
463
vendor/stripe-php-7.0.2/lib/ApiRequestor.php
vendored
Normal file
@@ -0,0 +1,463 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class ApiRequestor
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class ApiRequestor
|
||||
{
|
||||
/**
|
||||
* @var string|null
|
||||
*/
|
||||
private $_apiKey;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $_apiBase;
|
||||
|
||||
/**
|
||||
* @var HttpClient\ClientInterface
|
||||
*/
|
||||
private static $_httpClient;
|
||||
|
||||
/**
|
||||
* @var RequestTelemetry
|
||||
*/
|
||||
private static $requestTelemetry;
|
||||
|
||||
/**
|
||||
* ApiRequestor constructor.
|
||||
*
|
||||
* @param string|null $apiKey
|
||||
* @param string|null $apiBase
|
||||
*/
|
||||
public function __construct($apiKey = null, $apiBase = null)
|
||||
{
|
||||
$this->_apiKey = $apiKey;
|
||||
if (!$apiBase) {
|
||||
$apiBase = Stripe::$apiBase;
|
||||
}
|
||||
$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
|
||||
*
|
||||
* @param ApiResource|bool|array|mixed $d
|
||||
*
|
||||
* @return ApiResource|array|string|mixed
|
||||
*/
|
||||
private static function _encodeObjects($d)
|
||||
{
|
||||
if ($d instanceof ApiResource) {
|
||||
return Util\Util::utf8($d->id);
|
||||
} elseif ($d === true) {
|
||||
return 'true';
|
||||
} elseif ($d === false) {
|
||||
return 'false';
|
||||
} elseif (is_array($d)) {
|
||||
$res = [];
|
||||
foreach ($d as $k => $v) {
|
||||
$res[$k] = self::_encodeObjects($v);
|
||||
}
|
||||
return $res;
|
||||
} else {
|
||||
return Util\Util::utf8($d);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $method
|
||||
* @param string $url
|
||||
* @param array|null $params
|
||||
* @param array|null $headers
|
||||
*
|
||||
* @return array tuple containing (ApiReponse, API key)
|
||||
*
|
||||
* @throws Exception\ApiErrorException
|
||||
*/
|
||||
public function request($method, $url, $params = null, $headers = null)
|
||||
{
|
||||
$params = $params ?: [];
|
||||
$headers = $headers ?: [];
|
||||
list($rbody, $rcode, $rheaders, $myApiKey) =
|
||||
$this->_requestRaw($method, $url, $params, $headers);
|
||||
$json = $this->_interpretResponse($rbody, $rcode, $rheaders);
|
||||
$resp = new ApiResponse($rbody, $rcode, $rheaders, $json);
|
||||
return [$resp, $myApiKey];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $rbody A JSON string.
|
||||
* @param int $rcode
|
||||
* @param array $rheaders
|
||||
* @param array $resp
|
||||
*
|
||||
* @throws Exception\UnexpectedValueException
|
||||
* @throws Exception\ApiErrorException
|
||||
*/
|
||||
public function handleErrorResponse($rbody, $rcode, $rheaders, $resp)
|
||||
{
|
||||
if (!is_array($resp) || !isset($resp['error'])) {
|
||||
$msg = "Invalid response object from API: $rbody "
|
||||
. "(HTTP response code was $rcode)";
|
||||
throw new Exception\UnexpectedValueException($msg, $rcode, $rbody, $resp, $rheaders);
|
||||
}
|
||||
|
||||
$errorData = $resp['error'];
|
||||
|
||||
$error = null;
|
||||
if (is_string($errorData)) {
|
||||
$error = self::_specificOAuthError($rbody, $rcode, $rheaders, $resp, $errorData);
|
||||
}
|
||||
if (!$error) {
|
||||
$error = self::_specificAPIError($rbody, $rcode, $rheaders, $resp, $errorData);
|
||||
}
|
||||
|
||||
throw $error;
|
||||
}
|
||||
|
||||
/**
|
||||
* @static
|
||||
*
|
||||
* @param string $rbody
|
||||
* @param int $rcode
|
||||
* @param array $rheaders
|
||||
* @param array $resp
|
||||
* @param array $errorData
|
||||
*
|
||||
* @return Exception\ApiErrorException
|
||||
*/
|
||||
private static function _specificAPIError($rbody, $rcode, $rheaders, $resp, $errorData)
|
||||
{
|
||||
$msg = isset($errorData['message']) ? $errorData['message'] : null;
|
||||
$param = isset($errorData['param']) ? $errorData['param'] : null;
|
||||
$code = isset($errorData['code']) ? $errorData['code'] : null;
|
||||
$type = isset($errorData['type']) ? $errorData['type'] : null;
|
||||
$declineCode = isset($errorData['decline_code']) ? $errorData['decline_code'] : null;
|
||||
|
||||
switch ($rcode) {
|
||||
case 400:
|
||||
// 'rate_limit' code is deprecated, but left here for backwards compatibility
|
||||
// for API versions earlier than 2015-09-08
|
||||
if ($code == 'rate_limit') {
|
||||
return Exception\RateLimitException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $param);
|
||||
}
|
||||
if ($type == 'idempotency_error') {
|
||||
return Exception\IdempotencyException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code);
|
||||
}
|
||||
|
||||
// no break
|
||||
case 404:
|
||||
return Exception\InvalidRequestException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $param);
|
||||
case 401:
|
||||
return Exception\AuthenticationException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code);
|
||||
case 402:
|
||||
return Exception\CardException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $declineCode, $param);
|
||||
case 403:
|
||||
return Exception\PermissionException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code);
|
||||
case 429:
|
||||
return Exception\RateLimitException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $param);
|
||||
default:
|
||||
return Exception\UnknownApiErrorException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @static
|
||||
*
|
||||
* @param string|bool $rbody
|
||||
* @param int $rcode
|
||||
* @param array $rheaders
|
||||
* @param array $resp
|
||||
* @param string $errorCode
|
||||
*
|
||||
* @return Exception\OAuth\OAuthErrorException
|
||||
*/
|
||||
private static function _specificOAuthError($rbody, $rcode, $rheaders, $resp, $errorCode)
|
||||
{
|
||||
$description = isset($resp['error_description']) ? $resp['error_description'] : $errorCode;
|
||||
|
||||
switch ($errorCode) {
|
||||
case 'invalid_client':
|
||||
return Exception\OAuth\InvalidClientException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode);
|
||||
case 'invalid_grant':
|
||||
return Exception\OAuth\InvalidGrantException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode);
|
||||
case 'invalid_request':
|
||||
return Exception\OAuth\InvalidRequestException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode);
|
||||
case 'invalid_scope':
|
||||
return Exception\OAuth\InvalidScopeException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode);
|
||||
case 'unsupported_grant_type':
|
||||
return Exception\OAuth\UnsupportedGrantTypeException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode);
|
||||
case 'unsupported_response_type':
|
||||
return Exception\OAuth\UnsupportedResponseTypeException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode);
|
||||
default:
|
||||
return Exception\OAuth\UnknownOAuthErrorException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @static
|
||||
*
|
||||
* @param null|array $appInfo
|
||||
*
|
||||
* @return null|string
|
||||
*/
|
||||
private static function _formatAppInfo($appInfo)
|
||||
{
|
||||
if ($appInfo !== null) {
|
||||
$string = $appInfo['name'];
|
||||
if ($appInfo['version'] !== null) {
|
||||
$string .= '/' . $appInfo['version'];
|
||||
}
|
||||
if ($appInfo['url'] !== null) {
|
||||
$string .= ' (' . $appInfo['url'] . ')';
|
||||
}
|
||||
return $string;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @static
|
||||
*
|
||||
* @param string $apiKey
|
||||
* @param null $clientInfo
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private static function _defaultHeaders($apiKey, $clientInfo = null)
|
||||
{
|
||||
$uaString = 'Stripe/v1 PhpBindings/' . Stripe::VERSION;
|
||||
|
||||
$langVersion = phpversion();
|
||||
$uname = php_uname();
|
||||
|
||||
$appInfo = Stripe::getAppInfo();
|
||||
$ua = [
|
||||
'bindings_version' => Stripe::VERSION,
|
||||
'lang' => 'php',
|
||||
'lang_version' => $langVersion,
|
||||
'publisher' => 'stripe',
|
||||
'uname' => $uname,
|
||||
];
|
||||
if ($clientInfo) {
|
||||
$ua = array_merge($clientInfo, $ua);
|
||||
}
|
||||
if ($appInfo !== null) {
|
||||
$uaString .= ' ' . self::_formatAppInfo($appInfo);
|
||||
$ua['application'] = $appInfo;
|
||||
}
|
||||
|
||||
$defaultHeaders = [
|
||||
'X-Stripe-Client-User-Agent' => json_encode($ua),
|
||||
'User-Agent' => $uaString,
|
||||
'Authorization' => 'Bearer ' . $apiKey,
|
||||
];
|
||||
return $defaultHeaders;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $method
|
||||
* @param string $url
|
||||
* @param array $params
|
||||
* @param array $headers
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @throws Exception\AuthenticationException
|
||||
* @throws Exception\ApiConnectionException
|
||||
*/
|
||||
private function _requestRaw($method, $url, $params, $headers)
|
||||
{
|
||||
$myApiKey = $this->_apiKey;
|
||||
if (!$myApiKey) {
|
||||
$myApiKey = Stripe::$apiKey;
|
||||
}
|
||||
|
||||
if (!$myApiKey) {
|
||||
$msg = 'No API key provided. (HINT: set your API key using '
|
||||
. '"Stripe::setApiKey(<API-KEY>)". You can generate API keys from '
|
||||
. 'the Stripe web interface. See https://stripe.com/api for '
|
||||
. 'details, or email support@stripe.com if you have any questions.';
|
||||
throw new Exception\AuthenticationException($msg);
|
||||
}
|
||||
|
||||
// Clients can supply arbitrary additional keys to be included in the
|
||||
// X-Stripe-Client-User-Agent header via the optional getUserAgentInfo()
|
||||
// method
|
||||
$clientUAInfo = null;
|
||||
if (method_exists($this->httpClient(), 'getUserAgentInfo')) {
|
||||
$clientUAInfo = $this->httpClient()->getUserAgentInfo();
|
||||
}
|
||||
|
||||
$absUrl = $this->_apiBase.$url;
|
||||
$params = self::_encodeObjects($params);
|
||||
$defaultHeaders = $this->_defaultHeaders($myApiKey, $clientUAInfo);
|
||||
if (Stripe::$apiVersion) {
|
||||
$defaultHeaders['Stripe-Version'] = Stripe::$apiVersion;
|
||||
}
|
||||
|
||||
if (Stripe::$accountId) {
|
||||
$defaultHeaders['Stripe-Account'] = Stripe::$accountId;
|
||||
}
|
||||
|
||||
if (Stripe::$enableTelemetry && self::$requestTelemetry != null) {
|
||||
$defaultHeaders["X-Stripe-Client-Telemetry"] = self::_telemetryJson(self::$requestTelemetry);
|
||||
}
|
||||
|
||||
$hasFile = false;
|
||||
foreach ($params as $k => $v) {
|
||||
if (is_resource($v)) {
|
||||
$hasFile = true;
|
||||
$params[$k] = self::_processResourceParam($v);
|
||||
} elseif ($v instanceof \CURLFile) {
|
||||
$hasFile = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($hasFile) {
|
||||
$defaultHeaders['Content-Type'] = 'multipart/form-data';
|
||||
} else {
|
||||
$defaultHeaders['Content-Type'] = 'application/x-www-form-urlencoded';
|
||||
}
|
||||
|
||||
$combinedHeaders = array_merge($defaultHeaders, $headers);
|
||||
$rawHeaders = [];
|
||||
|
||||
foreach ($combinedHeaders as $header => $value) {
|
||||
$rawHeaders[] = $header . ': ' . $value;
|
||||
}
|
||||
|
||||
$requestStartMs = Util\Util::currentTimeMillis();
|
||||
|
||||
list($rbody, $rcode, $rheaders) = $this->httpClient()->request(
|
||||
$method,
|
||||
$absUrl,
|
||||
$rawHeaders,
|
||||
$params,
|
||||
$hasFile
|
||||
);
|
||||
|
||||
if (isset($rheaders['request-id'])) {
|
||||
self::$requestTelemetry = new RequestTelemetry(
|
||||
$rheaders['request-id'],
|
||||
Util\Util::currentTimeMillis() - $requestStartMs
|
||||
);
|
||||
}
|
||||
|
||||
return [$rbody, $rcode, $rheaders, $myApiKey];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param resource $resource
|
||||
*
|
||||
* @return \CURLFile|string
|
||||
*
|
||||
* @throws Exception\InvalidArgumentException
|
||||
*/
|
||||
private function _processResourceParam($resource)
|
||||
{
|
||||
if (get_resource_type($resource) !== 'stream') {
|
||||
throw new Exception\InvalidArgumentException(
|
||||
'Attempted to upload a resource that is not a stream'
|
||||
);
|
||||
}
|
||||
|
||||
$metaData = stream_get_meta_data($resource);
|
||||
if ($metaData['wrapper_type'] !== 'plainfile') {
|
||||
throw new Exception\InvalidArgumentException(
|
||||
'Only plainfile resource streams are supported'
|
||||
);
|
||||
}
|
||||
|
||||
// We don't have the filename or mimetype, but the API doesn't care
|
||||
return new \CURLFile($metaData['uri']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $rbody
|
||||
* @param int $rcode
|
||||
* @param array $rheaders
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @throws Exception\UnexpectedValueException
|
||||
* @throws Exception\ApiErrorException
|
||||
*/
|
||||
private function _interpretResponse($rbody, $rcode, $rheaders)
|
||||
{
|
||||
$resp = json_decode($rbody, true);
|
||||
$jsonError = json_last_error();
|
||||
if ($resp === null && $jsonError !== JSON_ERROR_NONE) {
|
||||
$msg = "Invalid response body from API: $rbody "
|
||||
. "(HTTP response code was $rcode, json_last_error() was $jsonError)";
|
||||
throw new Exception\UnexpectedValueException($msg, $rcode, $rbody);
|
||||
}
|
||||
|
||||
if ($rcode < 200 || $rcode >= 300) {
|
||||
$this->handleErrorResponse($rbody, $rcode, $rheaders, $resp);
|
||||
}
|
||||
return $resp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @static
|
||||
*
|
||||
* @param HttpClient\ClientInterface $client
|
||||
*/
|
||||
public static function setHttpClient($client)
|
||||
{
|
||||
self::$_httpClient = $client;
|
||||
}
|
||||
|
||||
/**
|
||||
* @static
|
||||
*
|
||||
* Resets any stateful telemetry data
|
||||
*/
|
||||
public static function resetTelemetry()
|
||||
{
|
||||
self::$requestTelemetry = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return HttpClient\ClientInterface
|
||||
*/
|
||||
private function httpClient()
|
||||
{
|
||||
if (!self::$_httpClient) {
|
||||
self::$_httpClient = HttpClient\CurlClient::instance();
|
||||
}
|
||||
return self::$_httpClient;
|
||||
}
|
||||
}
|
||||
114
vendor/stripe-php-7.0.2/lib/ApiResource.php
vendored
Normal file
114
vendor/stripe-php-7.0.2/lib/ApiResource.php
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class ApiResource
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
abstract class ApiResource extends StripeObject
|
||||
{
|
||||
use ApiOperations\Request;
|
||||
|
||||
/**
|
||||
* @return \Stripe\Util\Set A list of fields that can be their own type of
|
||||
* API resource (say a nested card under an account for example), and if
|
||||
* that resource is set, it should be transmitted to the API on a create or
|
||||
* update. Doing so is not the default behavior because API resources
|
||||
* should normally be persisted on their own RESTful endpoints.
|
||||
*/
|
||||
public static function getSavedNestedResources()
|
||||
{
|
||||
static $savedNestedResources = null;
|
||||
if ($savedNestedResources === null) {
|
||||
$savedNestedResources = new Util\Set();
|
||||
}
|
||||
return $savedNestedResources;
|
||||
}
|
||||
|
||||
/**
|
||||
* @var boolean A flag that can be set a behavior that will cause this
|
||||
* resource to be encoded and sent up along with an update of its parent
|
||||
* resource. This is usually not desirable because resources are updated
|
||||
* individually on their own endpoints, but there are certain cases,
|
||||
* replacing a customer's source for example, where this is allowed.
|
||||
*/
|
||||
public $saveWithParent = false;
|
||||
|
||||
public function __set($k, $v)
|
||||
{
|
||||
parent::__set($k, $v);
|
||||
$v = $this->$k;
|
||||
if ((static::getSavedNestedResources()->includes($k)) &&
|
||||
($v instanceof ApiResource)) {
|
||||
$v->saveWithParent = true;
|
||||
}
|
||||
return $v;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ApiResource The refreshed resource.
|
||||
*
|
||||
* @throws Exception\ApiErrorException
|
||||
*/
|
||||
public function refresh()
|
||||
{
|
||||
$requestor = new ApiRequestor($this->_opts->apiKey, static::baseUrl());
|
||||
$url = $this->instanceUrl();
|
||||
|
||||
list($response, $this->_opts->apiKey) = $requestor->request(
|
||||
'get',
|
||||
$url,
|
||||
$this->_retrieveOptions,
|
||||
$this->_opts->headers
|
||||
);
|
||||
$this->setLastResponse($response);
|
||||
$this->refreshFrom($response->json, $this->_opts);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string The base URL for the given class.
|
||||
*/
|
||||
public static function baseUrl()
|
||||
{
|
||||
return Stripe::$apiBase;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string The endpoint URL for the given class.
|
||||
*/
|
||||
public static function classUrl()
|
||||
{
|
||||
// Replace dots with slashes for namespaced resources, e.g. if the object's name is
|
||||
// "foo.bar", then its URL will be "/v1/foo/bars".
|
||||
$base = str_replace('.', '/', static::OBJECT_NAME);
|
||||
return "/v1/${base}s";
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string The instance endpoint URL for the given class.
|
||||
*/
|
||||
public static function resourceUrl($id)
|
||||
{
|
||||
if ($id === null) {
|
||||
$class = get_called_class();
|
||||
$message = "Could not determine which URL to request: "
|
||||
. "$class instance has invalid ID: $id";
|
||||
throw new Exception\UnexpectedValueException($message);
|
||||
}
|
||||
$id = Util\Util::utf8($id);
|
||||
$base = static::classUrl();
|
||||
$extn = urlencode($id);
|
||||
return "$base/$extn";
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string The full API URL for this API resource.
|
||||
*/
|
||||
public function instanceUrl()
|
||||
{
|
||||
return static::resourceUrl($this['id']);
|
||||
}
|
||||
}
|
||||
32
vendor/stripe-php-7.0.2/lib/ApiResponse.php
vendored
Normal file
32
vendor/stripe-php-7.0.2/lib/ApiResponse.php
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
use Stripe\Util\CaseInsensitiveArray;
|
||||
|
||||
/**
|
||||
* Class ApiResponse
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class ApiResponse
|
||||
{
|
||||
public $headers;
|
||||
public $body;
|
||||
public $json;
|
||||
public $code;
|
||||
|
||||
/**
|
||||
* @param string $body
|
||||
* @param integer $code
|
||||
* @param array|CaseInsensitiveArray|null $headers
|
||||
* @param array|null $json
|
||||
*/
|
||||
public function __construct($body, $code, $headers, $json)
|
||||
{
|
||||
$this->body = $body;
|
||||
$this->code = $code;
|
||||
$this->headers = $headers;
|
||||
$this->json = $json;
|
||||
}
|
||||
}
|
||||
27
vendor/stripe-php-7.0.2/lib/ApplePayDomain.php
vendored
Normal file
27
vendor/stripe-php-7.0.2/lib/ApplePayDomain.php
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class ApplePayDomain
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class ApplePayDomain extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "apple_pay_domain";
|
||||
|
||||
use ApiOperations\All;
|
||||
use ApiOperations\Create;
|
||||
use ApiOperations\Delete;
|
||||
use ApiOperations\Retrieve;
|
||||
|
||||
/**
|
||||
* @return string The class URL for this resource. It needs to be special
|
||||
* cased because it doesn't fit into the standard resource pattern.
|
||||
*/
|
||||
public static function classUrl()
|
||||
{
|
||||
return '/v1/apple_pay/domains';
|
||||
}
|
||||
}
|
||||
92
vendor/stripe-php-7.0.2/lib/ApplicationFee.php
vendored
Normal file
92
vendor/stripe-php-7.0.2/lib/ApplicationFee.php
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class ApplicationFee
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property string $account
|
||||
* @property int $amount
|
||||
* @property int $amount_refunded
|
||||
* @property string $application
|
||||
* @property string $balance_transaction
|
||||
* @property string $charge
|
||||
* @property int $created
|
||||
* @property string $currency
|
||||
* @property bool $livemode
|
||||
* @property string $originating_transaction
|
||||
* @property bool $refunded
|
||||
* @property Collection $refunds
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class ApplicationFee extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "application_fee";
|
||||
|
||||
use ApiOperations\All;
|
||||
use ApiOperations\NestedResource;
|
||||
use ApiOperations\Retrieve;
|
||||
|
||||
const PATH_REFUNDS = '/refunds';
|
||||
|
||||
/**
|
||||
* @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
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return ApplicationFeeRefund
|
||||
*/
|
||||
public static function createRefund($id, $params = null, $opts = null)
|
||||
{
|
||||
return self::_createNestedResource($id, static::PATH_REFUNDS, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return ApplicationFeeRefund
|
||||
*/
|
||||
public static function retrieveRefund($id, $refundId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_retrieveNestedResource($id, static::PATH_REFUNDS, $refundId, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return ApplicationFeeRefund
|
||||
*/
|
||||
public static function updateRefund($id, $refundId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_updateNestedResource($id, static::PATH_REFUNDS, $refundId, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return Collection The list of refunds.
|
||||
*/
|
||||
public static function allRefunds($id, $params = null, $opts = null)
|
||||
{
|
||||
return self::_allNestedResources($id, static::PATH_REFUNDS, $params, $opts);
|
||||
}
|
||||
}
|
||||
59
vendor/stripe-php-7.0.2/lib/ApplicationFeeRefund.php
vendored
Normal file
59
vendor/stripe-php-7.0.2/lib/ApplicationFeeRefund.php
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class ApplicationFeeRefund
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property int $amount
|
||||
* @property string $balance_transaction
|
||||
* @property int $created
|
||||
* @property string $currency
|
||||
* @property string $fee
|
||||
* @property StripeObject $metadata
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class ApplicationFeeRefund extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "fee_refund";
|
||||
|
||||
use ApiOperations\Update {
|
||||
save as protected _save;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string The API URL for this Stripe refund.
|
||||
*/
|
||||
public function instanceUrl()
|
||||
{
|
||||
$id = $this['id'];
|
||||
$fee = $this['fee'];
|
||||
if (!$id) {
|
||||
throw new Exception\UnexpectedValueException(
|
||||
"Could not determine which URL to request: " .
|
||||
"class instance has invalid ID: $id",
|
||||
null
|
||||
);
|
||||
}
|
||||
$id = Util\Util::utf8($id);
|
||||
$fee = Util\Util::utf8($fee);
|
||||
|
||||
$base = ApplicationFee::classUrl();
|
||||
$feeExtn = urlencode($fee);
|
||||
$extn = urlencode($id);
|
||||
return "$base/$feeExtn/refunds/$extn";
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @return ApplicationFeeRefund The saved refund.
|
||||
*/
|
||||
public function save($opts = null)
|
||||
{
|
||||
return $this->_save($opts);
|
||||
}
|
||||
}
|
||||
31
vendor/stripe-php-7.0.2/lib/Balance.php
vendored
Normal file
31
vendor/stripe-php-7.0.2/lib/Balance.php
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class Balance
|
||||
*
|
||||
* @property string $object
|
||||
* @property array $available
|
||||
* @property array $connect_reserved
|
||||
* @property bool $livemode
|
||||
* @property array $pending
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class Balance extends SingletonApiResource
|
||||
{
|
||||
const OBJECT_NAME = "balance";
|
||||
|
||||
/**
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return Balance
|
||||
*/
|
||||
public static function retrieve($opts = null)
|
||||
{
|
||||
return self::_singletonRetrieve($opts);
|
||||
}
|
||||
}
|
||||
65
vendor/stripe-php-7.0.2/lib/BalanceTransaction.php
vendored
Normal file
65
vendor/stripe-php-7.0.2/lib/BalanceTransaction.php
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class BalanceTransaction
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property int $amount
|
||||
* @property int $available_on
|
||||
* @property int $created
|
||||
* @property string $currency
|
||||
* @property string $description
|
||||
* @property float $exchange_rate
|
||||
* @property int $fee
|
||||
* @property mixed $fee_details
|
||||
* @property int $net
|
||||
* @property string $source
|
||||
* @property string $status
|
||||
* @property string $type
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class BalanceTransaction extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "balance_transaction";
|
||||
|
||||
use ApiOperations\All;
|
||||
use ApiOperations\Retrieve;
|
||||
|
||||
/**
|
||||
* Possible string representations of the type of balance transaction.
|
||||
* @link https://stripe.com/docs/api/balance/balance_transaction#balance_transaction_object-type
|
||||
*/
|
||||
const TYPE_ADJUSTMENT = 'adjustment';
|
||||
const TYPE_ADVANCE = 'advance';
|
||||
const TYPE_ADVANCE_FUNDING = 'advance_funding';
|
||||
const TYPE_APPLICATION_FEE = 'application_fee';
|
||||
const TYPE_APPLICATION_FEE_REFUND = 'application_fee_refund';
|
||||
const TYPE_CHARGE = 'charge';
|
||||
const TYPE_CONNECT_COLLECTION_TRANSFER = 'connect_collection_transfer';
|
||||
const TYPE_ISSUING_AUTHORIZATION_HOLD = 'issuing_authorization_hold';
|
||||
const TYPE_ISSUING_AUTHORIZATION_RELEASE = 'issuing_authorization_release';
|
||||
const TYPE_ISSUING_TRANSACTION = 'issuing_transaction';
|
||||
const TYPE_PAYMENT = 'payment';
|
||||
const TYPE_PAYMENT_FAILURE_REFUND = 'payment_failure_refund';
|
||||
const TYPE_PAYMENT_REFUND = 'payment_refund';
|
||||
const TYPE_PAYOUT = 'payout';
|
||||
const TYPE_PAYOUT_CANCEL = 'payout_cancel';
|
||||
const TYPE_PAYOUT_FAILURE = 'payout_failure';
|
||||
const TYPE_REFUND = 'refund';
|
||||
const TYPE_REFUND_FAILURE = 'refund_failure';
|
||||
const TYPE_RESERVE_TRANSACTION = 'reserve_transaction';
|
||||
const TYPE_RESERVED_FUNDS = 'reserved_funds';
|
||||
const TYPE_STRIPE_FEE = 'stripe_fee';
|
||||
const TYPE_STRIPE_FX_FEE = 'stripe_fx_fee';
|
||||
const TYPE_TAX_FEE = 'tax_fee';
|
||||
const TYPE_TOPUP = 'topup';
|
||||
const TYPE_TOPUP_REVERSAL = 'topup_reversal';
|
||||
const TYPE_TRANSFER = 'transfer';
|
||||
const TYPE_TRANSFER_CANCEL = 'transfer_cancel';
|
||||
const TYPE_TRANSFER_FAILURE = 'transfer_failure';
|
||||
const TYPE_TRANSFER_REFUND = 'transfer_refund';
|
||||
}
|
||||
114
vendor/stripe-php-7.0.2/lib/BankAccount.php
vendored
Normal file
114
vendor/stripe-php-7.0.2/lib/BankAccount.php
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class BankAccount
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property string $account
|
||||
* @property string $account_holder_name
|
||||
* @property string $account_holder_type
|
||||
* @property string $bank_name
|
||||
* @property string $country
|
||||
* @property string $currency
|
||||
* @property string $customer
|
||||
* @property bool $default_for_currency
|
||||
* @property string $fingerprint
|
||||
* @property string $last4
|
||||
* @property StripeObject $metadata
|
||||
* @property string $routing_number
|
||||
* @property string $status
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class BankAccount extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "bank_account";
|
||||
|
||||
use ApiOperations\Delete;
|
||||
use ApiOperations\Update;
|
||||
|
||||
/**
|
||||
* Possible string representations of the bank verification status.
|
||||
* @link https://stripe.com/docs/api/external_account_bank_accounts/object#account_bank_account_object-status
|
||||
*/
|
||||
const STATUS_NEW = 'new';
|
||||
const STATUS_VALIDATED = 'validated';
|
||||
const STATUS_VERIFIED = 'verified';
|
||||
const STATUS_VERIFICATION_FAILED = 'verification_failed';
|
||||
const STATUS_ERRORED = 'errored';
|
||||
|
||||
/**
|
||||
* @return string The instance URL for this resource. It needs to be special
|
||||
* cased because it doesn't fit into the standard resource pattern.
|
||||
*/
|
||||
public function instanceUrl()
|
||||
{
|
||||
if ($this['customer']) {
|
||||
$base = Customer::classUrl();
|
||||
$parent = $this['customer'];
|
||||
$path = 'sources';
|
||||
} elseif ($this['account']) {
|
||||
$base = Account::classUrl();
|
||||
$parent = $this['account'];
|
||||
$path = 'external_accounts';
|
||||
} else {
|
||||
$msg = "Bank accounts cannot be accessed without a customer ID or account ID.";
|
||||
throw new Exception\UnexpectedValueException($msg, null);
|
||||
}
|
||||
$parentExtn = urlencode(Util\Util::utf8($parent));
|
||||
$extn = urlencode(Util\Util::utf8($this['id']));
|
||||
return "$base/$parentExtn/$path/$extn";
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array|string $_id
|
||||
* @param array|string|null $_opts
|
||||
*
|
||||
* @throws \Stripe\Exception\BadMethodCallException
|
||||
*/
|
||||
public static function retrieve($_id, $_opts = null)
|
||||
{
|
||||
$msg = "Bank accounts cannot be retrieved without a customer ID or " .
|
||||
"an account ID. Retrieve a bank account using " .
|
||||
"`Customer::retrieveSource('customer_id', " .
|
||||
"'bank_account_id')` or `Account::retrieveExternalAccount(" .
|
||||
"'account_id', 'bank_account_id')`.";
|
||||
throw new Exception\BadMethodCallException($msg, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $_id
|
||||
* @param array|null $_params
|
||||
* @param array|string|null $_options
|
||||
*
|
||||
* @throws \Stripe\Exception\BadMethodCallException
|
||||
*/
|
||||
public static function update($_id, $_params = null, $_options = null)
|
||||
{
|
||||
$msg = "Bank accounts cannot be updated without a customer ID or an " .
|
||||
"account ID. Update a bank account using " .
|
||||
"`Customer::updateSource('customer_id', 'bank_account_id', " .
|
||||
"\$updateParams)` or `Account::updateExternalAccount(" .
|
||||
"'account_id', 'bank_account_id', \$updateParams)`.";
|
||||
throw new Exception\BadMethodCallException($msg, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array|null $params
|
||||
* @param array|string|null $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return BankAccount The verified bank account.
|
||||
*/
|
||||
public function verify($params = null, $options = null)
|
||||
{
|
||||
$url = $this->instanceUrl() . '/verify';
|
||||
list($response, $opts) = $this->_request('post', $url, $params, $options);
|
||||
$this->refreshFrom($response, $opts);
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
48
vendor/stripe-php-7.0.2/lib/BitcoinReceiver.php
vendored
Normal file
48
vendor/stripe-php-7.0.2/lib/BitcoinReceiver.php
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class BitcoinReceiver
|
||||
*
|
||||
* @package Stripe
|
||||
*
|
||||
* @deprecated Bitcoin receivers are deprecated. Please use the sources API instead.
|
||||
* @link https://stripe.com/docs/sources/bitcoin
|
||||
*/
|
||||
class BitcoinReceiver extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "bitcoin_receiver";
|
||||
|
||||
use ApiOperations\All;
|
||||
use ApiOperations\Retrieve;
|
||||
|
||||
/**
|
||||
* @return string The class URL for this resource. It needs to be special
|
||||
* cased because it doesn't fit into the standard resource pattern.
|
||||
*/
|
||||
public static function classUrl()
|
||||
{
|
||||
return "/v1/bitcoin/receivers";
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string The instance URL for this resource. It needs to be special
|
||||
* cased because it doesn't fit into the standard resource pattern.
|
||||
*/
|
||||
public function instanceUrl()
|
||||
{
|
||||
if ($this['customer']) {
|
||||
$base = Customer::classUrl();
|
||||
$parent = $this['customer'];
|
||||
$path = 'sources';
|
||||
$parentExtn = urlencode(Util\Util::utf8($parent));
|
||||
$extn = urlencode(Util\Util::utf8($this['id']));
|
||||
return "$base/$parentExtn/$path/$extn";
|
||||
} else {
|
||||
$base = BitcoinReceiver::classUrl();
|
||||
$extn = urlencode(Util\Util::utf8($this['id']));
|
||||
return "$base/$extn";
|
||||
}
|
||||
}
|
||||
}
|
||||
13
vendor/stripe-php-7.0.2/lib/BitcoinTransaction.php
vendored
Normal file
13
vendor/stripe-php-7.0.2/lib/BitcoinTransaction.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class BitcoinTransaction
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class BitcoinTransaction extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "bitcoin_transaction";
|
||||
}
|
||||
84
vendor/stripe-php-7.0.2/lib/Capability.php
vendored
Normal file
84
vendor/stripe-php-7.0.2/lib/Capability.php
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class Capability
|
||||
*
|
||||
* @package Stripe
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property string $account
|
||||
* @property bool $requested
|
||||
* @property int $requested_at
|
||||
* @property mixed $requirements
|
||||
* @property string $status
|
||||
*/
|
||||
class Capability extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "capability";
|
||||
|
||||
use ApiOperations\Update;
|
||||
|
||||
/**
|
||||
* Possible string representations of a capability's status.
|
||||
* @link https://stripe.com/docs/api/capabilities/object#capability_object-status
|
||||
*/
|
||||
const STATUS_ACTIVE = 'active';
|
||||
const STATUS_INACTIVE = 'inactive';
|
||||
const STATUS_PENDING = 'pending';
|
||||
const STATUS_UNREQUESTED = 'unrequested';
|
||||
|
||||
/**
|
||||
* @return string The API URL for this Stripe account reversal.
|
||||
*/
|
||||
public function instanceUrl()
|
||||
{
|
||||
$id = $this['id'];
|
||||
$account = $this['account'];
|
||||
if (!$id) {
|
||||
throw new Exception\UnexpectedValueException(
|
||||
"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/capabilities/$extn";
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array|string $_id
|
||||
* @param array|string|null $_opts
|
||||
*
|
||||
* @throws \Stripe\Exception\BadMethodCallException
|
||||
*/
|
||||
public static function retrieve($_id, $_opts = null)
|
||||
{
|
||||
$msg = "Capabilities cannot be retrieved without an account ID. " .
|
||||
"Retrieve a capability using `Account::retrieveCapability(" .
|
||||
"'account_id', 'capability_id')`.";
|
||||
throw new Exception\BadMethodCallException($msg, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $_id
|
||||
* @param array|null $_params
|
||||
* @param array|string|null $_options
|
||||
*
|
||||
* @throws \Stripe\Exception\BadMethodCallException
|
||||
*/
|
||||
public static function update($_id, $_params = null, $_options = null)
|
||||
{
|
||||
$msg = "Capabilities cannot be updated without an account ID. " .
|
||||
"Update a capability using `Account::updateCapability(" .
|
||||
"'account_id', 'capability_id', \$updateParams)`.";
|
||||
throw new Exception\BadMethodCallException($msg, null);
|
||||
}
|
||||
}
|
||||
130
vendor/stripe-php-7.0.2/lib/Card.php
vendored
Normal file
130
vendor/stripe-php-7.0.2/lib/Card.php
vendored
Normal file
@@ -0,0 +1,130 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class Card
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property string $account
|
||||
* @property string $address_city
|
||||
* @property string $address_country
|
||||
* @property string $address_line1
|
||||
* @property string $address_line1_check
|
||||
* @property string $address_line2
|
||||
* @property string $address_state
|
||||
* @property string $address_zip
|
||||
* @property string $address_zip_check
|
||||
* @property string[] $available_payout_methods
|
||||
* @property string $brand
|
||||
* @property string $country
|
||||
* @property string $currency
|
||||
* @property string $customer
|
||||
* @property string $cvc_check
|
||||
* @property bool $default_for_currency
|
||||
* @property string $dynamic_last4
|
||||
* @property int $exp_month
|
||||
* @property int $exp_year
|
||||
* @property string $fingerprint
|
||||
* @property string $funding
|
||||
* @property string $last4
|
||||
* @property StripeObject $metadata
|
||||
* @property string $name
|
||||
* @property string $recipient
|
||||
* @property string $tokenization_method
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class Card extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "card";
|
||||
|
||||
use ApiOperations\Delete;
|
||||
use ApiOperations\Update;
|
||||
|
||||
/**
|
||||
* Possible string representations of the CVC check status.
|
||||
* @link https://stripe.com/docs/api/cards/object#card_object-cvc_check
|
||||
*/
|
||||
const CVC_CHECK_FAIL = 'fail';
|
||||
const CVC_CHECK_PASS = 'pass';
|
||||
const CVC_CHECK_UNAVAILABLE = 'unavailable';
|
||||
const CVC_CHECK_UNCHECKED = 'unchecked';
|
||||
|
||||
/**
|
||||
* Possible string representations of the funding of the card.
|
||||
* @link https://stripe.com/docs/api/cards/object#card_object-funding
|
||||
*/
|
||||
const FUNDING_CREDIT = 'credit';
|
||||
const FUNDING_DEBIT = 'debit';
|
||||
const FUNDING_PREPAID = 'prepaid';
|
||||
const FUNDING_UNKNOWN = 'unknown';
|
||||
|
||||
/**
|
||||
* Possible string representations of the tokenization method when using Apple Pay or Google Pay.
|
||||
* @link https://stripe.com/docs/api/cards/object#card_object-tokenization_method
|
||||
*/
|
||||
const TOKENIZATION_METHOD_APPLE_PAY = 'apple_pay';
|
||||
const TOKENIZATION_METHOD_GOOGLE_PAY = 'google_pay';
|
||||
|
||||
/**
|
||||
* @return string The instance URL for this resource. It needs to be special
|
||||
* cased because cards are nested resources that may belong to different
|
||||
* top-level resources.
|
||||
*/
|
||||
public function instanceUrl()
|
||||
{
|
||||
if ($this['customer']) {
|
||||
$base = Customer::classUrl();
|
||||
$parent = $this['customer'];
|
||||
$path = 'sources';
|
||||
} elseif ($this['account']) {
|
||||
$base = Account::classUrl();
|
||||
$parent = $this['account'];
|
||||
$path = 'external_accounts';
|
||||
} elseif ($this['recipient']) {
|
||||
$base = Recipient::classUrl();
|
||||
$parent = $this['recipient'];
|
||||
$path = 'cards';
|
||||
} else {
|
||||
$msg = "Cards cannot be accessed without a customer ID, account ID or recipient ID.";
|
||||
throw new Exception\UnexpectedValueException($msg);
|
||||
}
|
||||
$parentExtn = urlencode(Util\Util::utf8($parent));
|
||||
$extn = urlencode(Util\Util::utf8($this['id']));
|
||||
return "$base/$parentExtn/$path/$extn";
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array|string $_id
|
||||
* @param array|string|null $_opts
|
||||
*
|
||||
* @throws \Stripe\Exception\BadMethodCallException
|
||||
*/
|
||||
public static function retrieve($_id, $_opts = null)
|
||||
{
|
||||
$msg = "Cards cannot be retrieved without a customer ID or an " .
|
||||
"account ID. Retrieve a card using " .
|
||||
"`Customer::retrieveSource('customer_id', 'card_id')` or " .
|
||||
"`Account::retrieveExternalAccount('account_id', 'card_id')`.";
|
||||
throw new Exception\BadMethodCallException($msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $_id
|
||||
* @param array|null $_params
|
||||
* @param array|string|null $_options
|
||||
*
|
||||
* @throws \Stripe\Exception\BadMethodCallException
|
||||
*/
|
||||
public static function update($_id, $_params = null, $_options = null)
|
||||
{
|
||||
$msg = "Cards cannot be updated without a customer ID or an " .
|
||||
"account ID. Update a card using " .
|
||||
"`Customer::updateSource('customer_id', 'card_id', " .
|
||||
"\$updateParams)` or `Account::updateExternalAccount(" .
|
||||
"'account_id', 'card_id', \$updateParams)`.";
|
||||
throw new Exception\BadMethodCallException($msg);
|
||||
}
|
||||
}
|
||||
135
vendor/stripe-php-7.0.2/lib/Charge.php
vendored
Normal file
135
vendor/stripe-php-7.0.2/lib/Charge.php
vendored
Normal file
@@ -0,0 +1,135 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class Charge
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property int $amount
|
||||
* @property int $amount_refunded
|
||||
* @property string $application
|
||||
* @property string $application_fee
|
||||
* @property int $application_fee_amount
|
||||
* @property string $balance_transaction
|
||||
* @property mixed $billing_details
|
||||
* @property bool $captured
|
||||
* @property int $created
|
||||
* @property string $currency
|
||||
* @property string $customer
|
||||
* @property string $description
|
||||
* @property string $destination
|
||||
* @property string $dispute
|
||||
* @property string $failure_code
|
||||
* @property string $failure_message
|
||||
* @property mixed $fraud_details
|
||||
* @property string $invoice
|
||||
* @property bool $livemode
|
||||
* @property StripeObject $metadata
|
||||
* @property string $on_behalf_of
|
||||
* @property string $order
|
||||
* @property mixed $outcome
|
||||
* @property bool $paid
|
||||
* @property string $payment_intent
|
||||
* @property string $payment_method
|
||||
* @property mixed $payment_method_details
|
||||
* @property string $receipt_email
|
||||
* @property string $receipt_number
|
||||
* @property string $receipt_url
|
||||
* @property bool $refunded
|
||||
* @property Collection $refunds
|
||||
* @property string $review
|
||||
* @property mixed $shipping
|
||||
* @property mixed $source
|
||||
* @property string $source_transfer
|
||||
* @property string $statement_descriptor
|
||||
* @property string $status
|
||||
* @property string $transfer
|
||||
* @property mixed $transfer_data
|
||||
* @property string $transfer_group
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class Charge extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "charge";
|
||||
|
||||
use ApiOperations\All;
|
||||
use ApiOperations\Create;
|
||||
use ApiOperations\Retrieve;
|
||||
use ApiOperations\Update;
|
||||
|
||||
/**
|
||||
* Possible string representations of decline codes.
|
||||
* These strings are applicable to the decline_code property of the \Stripe\Exception\CardException exception.
|
||||
* @link https://stripe.com/docs/declines/codes
|
||||
*/
|
||||
const DECLINED_APPROVE_WITH_ID = 'approve_with_id';
|
||||
const DECLINED_CALL_ISSUER = 'call_issuer';
|
||||
const DECLINED_CARD_NOT_SUPPORTED = 'card_not_supported';
|
||||
const DECLINED_CARD_VELOCITY_EXCEEDED = 'card_velocity_exceeded';
|
||||
const DECLINED_CURRENCY_NOT_SUPPORTED = 'currency_not_supported';
|
||||
const DECLINED_DO_NOT_HONOR = 'do_not_honor';
|
||||
const DECLINED_DO_NOT_TRY_AGAIN = 'do_not_try_again';
|
||||
const DECLINED_DUPLICATED_TRANSACTION = 'duplicate_transaction';
|
||||
const DECLINED_EXPIRED_CARD = 'expired_card';
|
||||
const DECLINED_FRAUDULENT = 'fraudulent';
|
||||
const DECLINED_GENERIC_DECLINE = 'generic_decline';
|
||||
const DECLINED_INCORRECT_NUMBER = 'incorrect_number';
|
||||
const DECLINED_INCORRECT_CVC = 'incorrect_cvc';
|
||||
const DECLINED_INCORRECT_PIN = 'incorrect_pin';
|
||||
const DECLINED_INCORRECT_ZIP = 'incorrect_zip';
|
||||
const DECLINED_INSUFFICIENT_FUNDS = 'insufficient_funds';
|
||||
const DECLINED_INVALID_ACCOUNT = 'invalid_account';
|
||||
const DECLINED_INVALID_AMOUNT = 'invalid_amount';
|
||||
const DECLINED_INVALID_CVC = 'invalid_cvc';
|
||||
const DECLINED_INVALID_EXPIRY_YEAR = 'invalid_expiry_year';
|
||||
const DECLINED_INVALID_NUMBER = 'invalid_number';
|
||||
const DECLINED_INVALID_PIN = 'invalid_pin';
|
||||
const DECLINED_ISSUER_NOT_AVAILABLE = 'issuer_not_available';
|
||||
const DECLINED_LOST_CARD = 'lost_card';
|
||||
const DECLINED_MERCHANT_BLACKLIST = 'merchant_blacklist';
|
||||
const DECLINED_NEW_ACCOUNT_INFORMATION_AVAILABLE = 'new_account_information_available';
|
||||
const DECLINED_NO_ACTION_TAKEN = 'no_action_taken';
|
||||
const DECLINED_NOT_PERMITTED = 'not_permitted';
|
||||
const DECLINED_PICKUP_CARD = 'pickup_card';
|
||||
const DECLINED_PIN_TRY_EXCEEDED = 'pin_try_exceeded';
|
||||
const DECLINED_PROCESSING_ERROR = 'processing_error';
|
||||
const DECLINED_REENTER_TRANSACTION = 'reenter_transaction';
|
||||
const DECLINED_RESTRICTED_CARD = 'restricted_card';
|
||||
const DECLINED_REVOCATION_OF_ALL_AUTHORIZATIONS = 'revocation_of_all_authorizations';
|
||||
const DECLINED_REVOCATION_OF_AUTHORIZATION = 'revocation_of_authorization';
|
||||
const DECLINED_SECURITY_VIOLATION = 'security_violation';
|
||||
const DECLINED_SERVICE_NOT_ALLOWED = 'service_not_allowed';
|
||||
const DECLINED_STOLEN_CARD = 'stolen_card';
|
||||
const DECLINED_STOP_PAYMENT_ORDER = 'stop_payment_order';
|
||||
const DECLINED_TESTMODE_DECLINE = 'testmode_decline';
|
||||
const DECLINED_TRANSACTION_NOT_ALLOWED = 'transaction_not_allowed';
|
||||
const DECLINED_TRY_AGAIN_LATER = 'try_again_later';
|
||||
const DECLINED_WITHDRAWAL_COUNT_LIMIT_EXCEEDED = 'withdrawal_count_limit_exceeded';
|
||||
|
||||
/**
|
||||
* Possible string representations of the status of the charge.
|
||||
* @link https://stripe.com/docs/api/charges/object#charge_object-status
|
||||
*/
|
||||
const STATUS_FAILED = 'failed';
|
||||
const STATUS_PENDING = 'pending';
|
||||
const STATUS_SUCCEEDED = 'succeeded';
|
||||
|
||||
/**
|
||||
* @param array|null $params
|
||||
* @param array|string|null $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return Charge The captured charge.
|
||||
*/
|
||||
public function capture($params = null, $options = null)
|
||||
{
|
||||
$url = $this->instanceUrl() . '/capture';
|
||||
list($response, $opts) = $this->_request('post', $url, $params, $options);
|
||||
$this->refreshFrom($response, $opts);
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
39
vendor/stripe-php-7.0.2/lib/Checkout/Session.php
vendored
Normal file
39
vendor/stripe-php-7.0.2/lib/Checkout/Session.php
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Checkout;
|
||||
|
||||
/**
|
||||
* Class Session
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property string $cancel_url
|
||||
* @property string $client_reference_id
|
||||
* @property string $customer
|
||||
* @property string $customer_email
|
||||
* @property mixed $display_items
|
||||
* @property bool $livemode
|
||||
* @property string $payment_intent
|
||||
* @property string[] $payment_method_types
|
||||
* @property string $submit_type
|
||||
* @property string $subscription
|
||||
* @property string $success_url
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class Session extends \Stripe\ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "checkout.session";
|
||||
|
||||
use \Stripe\ApiOperations\Create;
|
||||
use \Stripe\ApiOperations\Retrieve;
|
||||
|
||||
/**
|
||||
* Possible string representations of submit type.
|
||||
* @link https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-submit_type
|
||||
*/
|
||||
const SUBMIT_TYPE_AUTO = 'auto';
|
||||
const SUBMIT_TYPE_BOOK = 'book';
|
||||
const SUBMIT_TYPE_DONATE = 'donate';
|
||||
const SUBMIT_TYPE_PAY = 'pay';
|
||||
}
|
||||
229
vendor/stripe-php-7.0.2/lib/Collection.php
vendored
Normal file
229
vendor/stripe-php-7.0.2/lib/Collection.php
vendored
Normal file
@@ -0,0 +1,229 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class Collection
|
||||
*
|
||||
* @property string $object
|
||||
* @property string $url
|
||||
* @property bool $has_more
|
||||
* @property mixed $data
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class Collection extends StripeObject implements \IteratorAggregate
|
||||
{
|
||||
const OBJECT_NAME = "list";
|
||||
|
||||
use ApiOperations\Request;
|
||||
|
||||
protected $filters = [];
|
||||
|
||||
/**
|
||||
* @return string The base URL for the given class.
|
||||
*/
|
||||
public static function baseUrl()
|
||||
{
|
||||
return Stripe::$apiBase;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the filters.
|
||||
*
|
||||
* @return array The filters.
|
||||
*/
|
||||
public function getFilters()
|
||||
{
|
||||
return $this->filters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the filters, removing paging options.
|
||||
*
|
||||
* @param array $filters The filters.
|
||||
*/
|
||||
public function setFilters($filters)
|
||||
{
|
||||
$this->filters = $filters;
|
||||
unset($this->filters['starting_after']);
|
||||
unset($this->filters['ending_before']);
|
||||
}
|
||||
|
||||
public function offsetGet($k)
|
||||
{
|
||||
if (is_string($k)) {
|
||||
return parent::offsetGet($k);
|
||||
} else {
|
||||
$msg = "You tried to access the {$k} index, but Collection " .
|
||||
"types only support string keys. (HINT: List calls " .
|
||||
"return an object with a `data` (which is the data " .
|
||||
"array). You likely want to call ->data[{$k}])";
|
||||
throw new Exception\InvalidArgumentException($msg);
|
||||
}
|
||||
}
|
||||
|
||||
public function all($params = null, $opts = null)
|
||||
{
|
||||
self::_validateParams($params);
|
||||
list($url, $params) = $this->extractPathAndUpdateParams($params);
|
||||
|
||||
list($response, $opts) = $this->_request('get', $url, $params, $opts);
|
||||
$obj = Util\Util::convertToStripeObject($response, $opts);
|
||||
if (!($obj instanceof \Stripe\Collection)) {
|
||||
throw new \Stripe\Exception\UnexpectedValueException(
|
||||
'Expected type ' . \Stripe\Collection::class . ', got "' . get_class($obj) . '" instead.'
|
||||
);
|
||||
}
|
||||
$obj->setFilters($params);
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public function create($params = null, $opts = null)
|
||||
{
|
||||
self::_validateParams($params);
|
||||
list($url, $params) = $this->extractPathAndUpdateParams($params);
|
||||
|
||||
list($response, $opts) = $this->_request('post', $url, $params, $opts);
|
||||
return Util\Util::convertToStripeObject($response, $opts);
|
||||
}
|
||||
|
||||
public function retrieve($id, $params = null, $opts = null)
|
||||
{
|
||||
self::_validateParams($params);
|
||||
list($url, $params) = $this->extractPathAndUpdateParams($params);
|
||||
|
||||
$id = Util\Util::utf8($id);
|
||||
$extn = urlencode($id);
|
||||
list($response, $opts) = $this->_request(
|
||||
'get',
|
||||
"$url/$extn",
|
||||
$params,
|
||||
$opts
|
||||
);
|
||||
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 \Generator|StripeObject[] A generator that can be used to
|
||||
* iterate across all objects across all pages. As page boundaries are
|
||||
* encountered, the next page will be fetched automatically for
|
||||
* continued iteration.
|
||||
*/
|
||||
public function autoPagingIterator()
|
||||
{
|
||||
$page = $this;
|
||||
|
||||
while (true) {
|
||||
foreach ($page as $item) {
|
||||
yield $item;
|
||||
}
|
||||
|
||||
$page = $page->nextPage();
|
||||
|
||||
if ($page->isEmpty()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an empty collection. This is returned from {@see nextPage()}
|
||||
* when we know that there isn't a next page in order to replicate the
|
||||
* behavior of the API when it attempts to return a page beyond the last.
|
||||
*
|
||||
* @param array|string|null $opts
|
||||
* @return Collection
|
||||
*/
|
||||
public static function emptyCollection($opts = null)
|
||||
{
|
||||
return Collection::constructFrom(['data' => []], $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the page object contains no element.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function isEmpty()
|
||||
{
|
||||
return empty($this->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the next page in the resource list (if there is one).
|
||||
*
|
||||
* This method will try to respect the limit of the current page. If none
|
||||
* was given, the default limit will be fetched again.
|
||||
*
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
* @return Collection
|
||||
*/
|
||||
public function nextPage($params = null, $opts = null)
|
||||
{
|
||||
if (!$this->has_more) {
|
||||
return static::emptyCollection($opts);
|
||||
}
|
||||
|
||||
$lastId = end($this->data)->id;
|
||||
|
||||
$params = array_merge(
|
||||
$this->filters,
|
||||
['starting_after' => $lastId],
|
||||
$params ?: []
|
||||
);
|
||||
|
||||
return $this->all($params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the previous page in the resource list (if there is one).
|
||||
*
|
||||
* This method will try to respect the limit of the current page. If none
|
||||
* was given, the default limit will be fetched again.
|
||||
*
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
* @return Collection
|
||||
*/
|
||||
public function previousPage($params = null, $opts = null)
|
||||
{
|
||||
$firstId = $this->data[0]->id;
|
||||
|
||||
$params = array_merge(
|
||||
$this->filters,
|
||||
['ending_before' => $firstId],
|
||||
$params ?: []
|
||||
);
|
||||
|
||||
return $this->all($params, $opts);
|
||||
}
|
||||
|
||||
private function extractPathAndUpdateParams($params)
|
||||
{
|
||||
$url = parse_url($this->url);
|
||||
if (!isset($url['path'])) {
|
||||
throw new Exception\UnexpectedValueException("Could not parse list url into parts: $url");
|
||||
}
|
||||
|
||||
if (isset($url['query'])) {
|
||||
// If the URL contains a query param, parse it out into $params so they
|
||||
// don't interact weirdly with each other.
|
||||
$query = [];
|
||||
parse_str($url['query'], $query);
|
||||
$params = array_merge($params ?: [], $query);
|
||||
}
|
||||
|
||||
return [$url['path'], $params];
|
||||
}
|
||||
}
|
||||
25
vendor/stripe-php-7.0.2/lib/CountrySpec.php
vendored
Normal file
25
vendor/stripe-php-7.0.2/lib/CountrySpec.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class CountrySpec
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property string $default_currency
|
||||
* @property mixed $supported_bank_account_currencies
|
||||
* @property string[] $supported_payment_currencies
|
||||
* @property string[] $supported_payment_methods
|
||||
* @property string[] $supported_transfer_countries
|
||||
* @property mixed $verification_fields
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class CountrySpec extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "country_spec";
|
||||
|
||||
use ApiOperations\All;
|
||||
use ApiOperations\Retrieve;
|
||||
}
|
||||
35
vendor/stripe-php-7.0.2/lib/Coupon.php
vendored
Normal file
35
vendor/stripe-php-7.0.2/lib/Coupon.php
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class Coupon
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property int $amount_off
|
||||
* @property int $created
|
||||
* @property string $currency
|
||||
* @property string $duration
|
||||
* @property int $duration_in_months
|
||||
* @property bool $livemode
|
||||
* @property int $max_redemptions
|
||||
* @property StripeObject $metadata
|
||||
* @property string $name
|
||||
* @property float $percent_off
|
||||
* @property int $redeem_by
|
||||
* @property int $times_redeemed
|
||||
* @property bool $valid
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class Coupon extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "coupon";
|
||||
|
||||
use ApiOperations\All;
|
||||
use ApiOperations\Create;
|
||||
use ApiOperations\Delete;
|
||||
use ApiOperations\Retrieve;
|
||||
use ApiOperations\Update;
|
||||
}
|
||||
75
vendor/stripe-php-7.0.2/lib/CreditNote.php
vendored
Normal file
75
vendor/stripe-php-7.0.2/lib/CreditNote.php
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class CreditNote
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property int $amount
|
||||
* @property string $customer_balance_transaction
|
||||
* @property int $created
|
||||
* @property string $currency
|
||||
* @property string $customer
|
||||
* @property string $invoice
|
||||
* @property bool $livemode
|
||||
* @property string $memo
|
||||
* @property StripeObject $metadata
|
||||
* @property string $number
|
||||
* @property string $pdf
|
||||
* @property string $reason
|
||||
* @property string $refund
|
||||
* @property string $status
|
||||
* @property string $type
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class CreditNote extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "credit_note";
|
||||
|
||||
use ApiOperations\All;
|
||||
use ApiOperations\Create;
|
||||
use ApiOperations\Retrieve;
|
||||
use ApiOperations\Update;
|
||||
|
||||
/**
|
||||
* Possible string representations of the credit note reason.
|
||||
* @link https://stripe.com/docs/api/credit_notes/object#credit_note_object-reason
|
||||
*/
|
||||
const REASON_DUPLICATE = 'duplicate';
|
||||
const REASON_FRAUDULENT = 'fraudulent';
|
||||
const REASON_ORDER_CHANGE = 'order_change';
|
||||
const REASON_PRODUCT_UNSATISFACTORY = 'product_unsatisfactory';
|
||||
|
||||
/**
|
||||
* Possible string representations of the credit note status.
|
||||
* @link https://stripe.com/docs/api/credit_notes/object#credit_note_object-status
|
||||
*/
|
||||
const STATUS_ISSUED = 'issued';
|
||||
const STATUS_VOID = 'void';
|
||||
|
||||
/**
|
||||
* Possible string representations of the credit note type.
|
||||
* @link https://stripe.com/docs/api/credit_notes/object#credit_note_object-status
|
||||
*/
|
||||
const TYPE_POST_PAYMENT = 'post_payment';
|
||||
const TYPE_PRE_PAYMENT = 'pre_payment';
|
||||
|
||||
/**
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return CreditNote The voided credit note.
|
||||
*/
|
||||
public function voidCreditNote($params = null, $opts = null)
|
||||
{
|
||||
$url = $this->instanceUrl() . '/void';
|
||||
list($response, $opts) = $this->_request('post', $url, $params, $opts);
|
||||
$this->refreshFrom($response, $opts);
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
264
vendor/stripe-php-7.0.2/lib/Customer.php
vendored
Normal file
264
vendor/stripe-php-7.0.2/lib/Customer.php
vendored
Normal file
@@ -0,0 +1,264 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class Customer
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property mixed $address
|
||||
* @property int $balance
|
||||
* @property string $created
|
||||
* @property string $currency
|
||||
* @property string $default_source
|
||||
* @property bool $delinquent
|
||||
* @property string $description
|
||||
* @property Discount $discount
|
||||
* @property string $email
|
||||
* @property string $invoice_prefix
|
||||
* @property mixed $invoice_settings
|
||||
* @property bool $livemode
|
||||
* @property StripeObject $metadata
|
||||
* @property string $name
|
||||
* @property string $phone
|
||||
* @property string[] preferred_locales
|
||||
* @property mixed $shipping
|
||||
* @property Collection $sources
|
||||
* @property Collection $subscriptions
|
||||
* @property string $tax_exempt
|
||||
* @property Collection $tax_ids
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class Customer extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "customer";
|
||||
|
||||
use ApiOperations\All;
|
||||
use ApiOperations\Create;
|
||||
use ApiOperations\Delete;
|
||||
use ApiOperations\NestedResource;
|
||||
use ApiOperations\Retrieve;
|
||||
use ApiOperations\Update;
|
||||
|
||||
/**
|
||||
* Possible string representations of the customer's type of tax exemption.
|
||||
* @link https://stripe.com/docs/api/customers/object#customer_object-tax_exempt
|
||||
*/
|
||||
const TAX_EXEMPT_NONE = 'none';
|
||||
const TAX_EXEMPT_EXEMPT = 'exempt';
|
||||
const TAX_EXEMPT_REVERSE = 'reverse';
|
||||
|
||||
public static function getSavedNestedResources()
|
||||
{
|
||||
static $savedNestedResources = null;
|
||||
if ($savedNestedResources === null) {
|
||||
$savedNestedResources = new Util\Set([
|
||||
'source',
|
||||
]);
|
||||
}
|
||||
return $savedNestedResources;
|
||||
}
|
||||
|
||||
const PATH_BALANCE_TRANSACTIONS = '/balance_transactions';
|
||||
const PATH_SOURCES = '/sources';
|
||||
const PATH_TAX_IDS = '/tax_ids';
|
||||
|
||||
/**
|
||||
* @return Customer The updated customer.
|
||||
*/
|
||||
public function deleteDiscount()
|
||||
{
|
||||
$url = $this->instanceUrl() . '/discount';
|
||||
list($response, $opts) = $this->_request('delete', $url);
|
||||
$this->refreshFrom(['discount' => null], $opts, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $id The ID of the customer on which to create the source.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return ApiResource
|
||||
*/
|
||||
public static function createSource($id, $params = null, $opts = null)
|
||||
{
|
||||
return self::_createNestedResource($id, static::PATH_SOURCES, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return ApiResource
|
||||
*/
|
||||
public static function retrieveSource($id, $sourceId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_retrieveNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return ApiResource
|
||||
*/
|
||||
public static function updateSource($id, $sourceId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_updateNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return ApiResource
|
||||
*/
|
||||
public static function deleteSource($id, $sourceId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_deleteNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $id The ID of the customer on which to retrieve the sources.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return Collection The list of sources.
|
||||
*/
|
||||
public static function allSources($id, $params = null, $opts = null)
|
||||
{
|
||||
return self::_allNestedResources($id, static::PATH_SOURCES, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $id The ID of the customer on which to create the tax id.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return ApiResource
|
||||
*/
|
||||
public static function createTaxId($id, $params = null, $opts = null)
|
||||
{
|
||||
return self::_createNestedResource($id, static::PATH_TAX_IDS, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $id The ID of the customer to which the tax id belongs.
|
||||
* @param string|null $taxIdId The ID of the tax id to retrieve.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return ApiResource
|
||||
*/
|
||||
public static function retrieveTaxId($id, $taxIdId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_retrieveNestedResource($id, static::PATH_TAX_IDS, $taxIdId, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $id The ID of the customer to which the tax id belongs.
|
||||
* @param string|null $taxIdId The ID of the tax id to delete.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return ApiResource
|
||||
*/
|
||||
public static function deleteTaxId($id, $taxIdId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_deleteNestedResource($id, static::PATH_TAX_IDS, $taxIdId, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $id The ID of the customer on which to retrieve the tax ids.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return Collection The list of tax ids.
|
||||
*/
|
||||
public static function allTaxIds($id, $params = null, $opts = null)
|
||||
{
|
||||
return self::_allNestedResources($id, static::PATH_TAX_IDS, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $id The ID of the customer on which to create the balance transaction.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @return ApiResource
|
||||
*/
|
||||
public static function createBalanceTransaction($id, $params = null, $opts = null)
|
||||
{
|
||||
return self::_createNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $id The ID of the customer to which the balance transaction belongs.
|
||||
* @param string|null $balanceTransactionId The ID of the balance transaction to retrieve.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return ApiResource
|
||||
*/
|
||||
public static function retrieveBalanceTransaction($id, $balanceTransactionId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_retrieveNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $id The ID of the customer on which to update the balance transaction.
|
||||
* @param string|null $balanceTransactionId The ID of the balance transaction to update.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return ApiResource
|
||||
*/
|
||||
public static function updateBalanceTransaction($id, $balanceTransactionId, $params = null, $opts = null)
|
||||
{
|
||||
return self::_updateNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $id The ID of the customer on which to retrieve the customer balance transactions.
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return Collection The list of customer balance transactions.
|
||||
*/
|
||||
public static function allBalanceTransactions($id, $params = null, $opts = null)
|
||||
{
|
||||
return self::_allNestedResources($id, static::PATH_BALANCE_TRANSACTIONS, $params, $opts);
|
||||
}
|
||||
}
|
||||
92
vendor/stripe-php-7.0.2/lib/CustomerBalanceTransaction.php
vendored
Normal file
92
vendor/stripe-php-7.0.2/lib/CustomerBalanceTransaction.php
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class CustomerBalanceTransaction
|
||||
*
|
||||
* @package Stripe
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property int $amount
|
||||
* @property string $credit_note
|
||||
* @property int $created
|
||||
* @property string $currency
|
||||
* @property string $customer
|
||||
* @property string $description
|
||||
* @property int $ending_balance
|
||||
* @property string $invoice
|
||||
* @property bool $livemode
|
||||
* @property StripeObject $metadata
|
||||
* @property string $type
|
||||
*/
|
||||
class CustomerBalanceTransaction extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "customer_balance_transaction";
|
||||
|
||||
/**
|
||||
* Possible string representations of a balance transaction's type.
|
||||
* @link https://stripe.com/docs/api/customers/customer_balance_transaction_object#customer_balance_transaction_object-type
|
||||
*/
|
||||
const TYPE_ADJUSTEMENT = 'adjustment';
|
||||
const TYPE_APPLIED_TO_INVOICE = 'applied_to_invoice';
|
||||
const TYPE_CREDIT_NOTE = 'credit_note';
|
||||
const TYPE_INITIAL = 'initial';
|
||||
const TYPE_INVOICE_TOO_LARGE = 'invoice_too_large';
|
||||
const TYPE_INVOICE_TOO_SMALL = 'invoice_too_small';
|
||||
const TYPE_UNSPENT_RECEIVER_CREDIT = 'unspent_receiver_credit';
|
||||
|
||||
/**
|
||||
* @return string The API URL for this balance transaction.
|
||||
*/
|
||||
public function instanceUrl()
|
||||
{
|
||||
$id = $this['id'];
|
||||
$customer = $this['customer'];
|
||||
if (!$id) {
|
||||
throw new Exception\UnexpectedValueException(
|
||||
"Could not determine which URL to request: class instance has invalid ID: $id",
|
||||
null
|
||||
);
|
||||
}
|
||||
$id = Util\Util::utf8($id);
|
||||
$customer = Util\Util::utf8($customer);
|
||||
|
||||
$base = Customer::classUrl();
|
||||
$customerExtn = urlencode($customer);
|
||||
$extn = urlencode($id);
|
||||
return "$base/$customerExtn/balance_transactions/$extn";
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array|string $_id
|
||||
* @param array|string|null $_opts
|
||||
*
|
||||
* @throws \Stripe\Exception\BadMethodCallException
|
||||
*/
|
||||
public static function retrieve($_id, $_opts = null)
|
||||
{
|
||||
$msg = "Customer Balance Transactions cannot be retrieved without a " .
|
||||
"customer ID. Retrieve a Customer Balance Transaction using " .
|
||||
"`Customer::retrieveBalanceTransaction('customer_id', " .
|
||||
"'balance_transaction_id')`.";
|
||||
throw new Exception\BadMethodCallException($msg, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $_id
|
||||
* @param array|null $_params
|
||||
* @param array|string|null $_options
|
||||
*
|
||||
* @throws \Stripe\Exception\BadMethodCallException
|
||||
*/
|
||||
public static function update($_id, $_params = null, $_options = null)
|
||||
{
|
||||
$msg = "Customer Balance Transactions cannot be updated without a " .
|
||||
"customer ID. Update a Customer Balance Transaction using " .
|
||||
"`Customer::updateBalanceTransaction('customer_id', " .
|
||||
"'balance_transaction_id', \$updateParams)`.";
|
||||
throw new Exception\BadMethodCallException($msg, null);
|
||||
}
|
||||
}
|
||||
20
vendor/stripe-php-7.0.2/lib/Discount.php
vendored
Normal file
20
vendor/stripe-php-7.0.2/lib/Discount.php
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class Discount
|
||||
*
|
||||
* @property string $object
|
||||
* @property Coupon $coupon
|
||||
* @property string $customer
|
||||
* @property int $end
|
||||
* @property int $start
|
||||
* @property string $subscription
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class Discount extends StripeObject
|
||||
{
|
||||
const OBJECT_NAME = "discount";
|
||||
}
|
||||
79
vendor/stripe-php-7.0.2/lib/Dispute.php
vendored
Normal file
79
vendor/stripe-php-7.0.2/lib/Dispute.php
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class Dispute
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property int $amount
|
||||
* @property BalanceTransaction[] $balance_transactions
|
||||
* @property string $charge
|
||||
* @property int $created
|
||||
* @property string $currency
|
||||
* @property mixed $evidence
|
||||
* @property mixed $evidence_details
|
||||
* @property bool $is_charge_refundable
|
||||
* @property bool $livemode
|
||||
* @property StripeObject $metadata
|
||||
* @property string $reason
|
||||
* @property string $status
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class Dispute extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "dispute";
|
||||
|
||||
use ApiOperations\All;
|
||||
use ApiOperations\Retrieve;
|
||||
use ApiOperations\Update;
|
||||
|
||||
/**
|
||||
* Possible string representations of dispute reasons.
|
||||
* @link https://stripe.com/docs/api#dispute_object
|
||||
*/
|
||||
const REASON_BANK_CANNOT_PROCESS = 'bank_cannot_process';
|
||||
const REASON_CHECK_RETURNED = 'check_returned';
|
||||
const REASON_CREDIT_NOT_PROCESSED = 'credit_not_processed';
|
||||
const REASON_CUSTOMER_INITIATED = 'customer_initiated';
|
||||
const REASON_DEBIT_NOT_AUTHORIZED = 'debit_not_authorized';
|
||||
const REASON_DUPLICATE = 'duplicate';
|
||||
const REASON_FRAUDULENT = 'fraudulent';
|
||||
const REASON_GENERAL = 'general';
|
||||
const REASON_INCORRECT_ACCOUNT_DETAILS = 'incorrect_account_details';
|
||||
const REASON_INSUFFICIENT_FUNDS = 'insufficient_funds';
|
||||
const REASON_PRODUCT_NOT_RECEIVED = 'product_not_received';
|
||||
const REASON_PRODUCT_UNACCEPTABLE = 'product_unacceptable';
|
||||
const REASON_SUBSCRIPTION_CANCELED = 'subscription_canceled';
|
||||
const REASON_UNRECOGNIZED = 'unrecognized';
|
||||
|
||||
/**
|
||||
* Possible string representations of dispute statuses.
|
||||
* @link https://stripe.com/docs/api#dispute_object
|
||||
*/
|
||||
const STATUS_CHARGE_REFUNDED = 'charge_refunded';
|
||||
const STATUS_LOST = 'lost';
|
||||
const STATUS_NEEDS_RESPONSE = 'needs_response';
|
||||
const STATUS_UNDER_REVIEW = 'under_review';
|
||||
const STATUS_WARNING_CLOSED = 'warning_closed';
|
||||
const STATUS_WARNING_NEEDS_RESPONSE = 'warning_needs_response';
|
||||
const STATUS_WARNING_UNDER_REVIEW = 'warning_under_review';
|
||||
const STATUS_WON = 'won';
|
||||
|
||||
/**
|
||||
* @param array|string|null $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return Dispute The closed dispute.
|
||||
*/
|
||||
public function close($options = null)
|
||||
{
|
||||
$url = $this->instanceUrl() . '/close';
|
||||
list($response, $opts) = $this->_request('post', $url, null, $options);
|
||||
$this->refreshFrom($response, $opts);
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
43
vendor/stripe-php-7.0.2/lib/EphemeralKey.php
vendored
Normal file
43
vendor/stripe-php-7.0.2/lib/EphemeralKey.php
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class EphemeralKey
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property int $created
|
||||
* @property int $expires
|
||||
* @property bool $livemode
|
||||
* @property string $secret
|
||||
* @property array $associated_objects
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class EphemeralKey extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "ephemeral_key";
|
||||
|
||||
use ApiOperations\Create {
|
||||
create as protected _create;
|
||||
}
|
||||
use ApiOperations\Delete;
|
||||
|
||||
/**
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\InvalidArgumentException if stripe_version is missing
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return EphemeralKey The created key.
|
||||
*/
|
||||
public static function create($params = null, $opts = null)
|
||||
{
|
||||
if (!$opts || !isset($opts['stripe_version'])) {
|
||||
throw new Exception\InvalidArgumentException('stripe_version must be specified to create an ephemeral key');
|
||||
}
|
||||
return self::_create($params, $opts);
|
||||
}
|
||||
}
|
||||
162
vendor/stripe-php-7.0.2/lib/ErrorObject.php
vendored
Normal file
162
vendor/stripe-php-7.0.2/lib/ErrorObject.php
vendored
Normal file
@@ -0,0 +1,162 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class ErrorObject
|
||||
*
|
||||
* @property string $charge For card errors, the ID of the failed charge.
|
||||
* @property string $code For some errors that could be handled
|
||||
* programmatically, a short string indicating the error code reported.
|
||||
* @property string $decline_code For card errors resulting from a card issuer
|
||||
* decline, a short string indicating the card issuer's reason for the
|
||||
* decline if they provide one.
|
||||
* @property string $doc_url A URL to more information about the error code
|
||||
* reported.
|
||||
* @property string $message A human-readable message providing more details
|
||||
* about the error. For card errors, these messages can be shown to your
|
||||
* users.
|
||||
* @property string $param If the error is parameter-specific, the parameter
|
||||
* related to the error. For example, you can use this to display a message
|
||||
* near the correct form field.
|
||||
* @property PaymentIntent $payment_intent The PaymentIntent object for errors
|
||||
* returned on a request involving a PaymentIntent.
|
||||
* @property PaymentMethod $payment_method The PaymentMethod object for errors
|
||||
* returned on a request involving a PaymentMethod.
|
||||
* @property SetupIntent $setup_intent The SetupIntent object for errors
|
||||
* returned on a request involving a SetupIntent.
|
||||
* @property StripeObject $source The source object for errors returned on a
|
||||
* request involving a source.
|
||||
* @property string $type The type of error returned. One of
|
||||
* `api_connection_error`, `api_error`, `authentication_error`,
|
||||
* `card_error`, `idempotency_error`, `invalid_request_error`, or
|
||||
* `rate_limit_error`.
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class ErrorObject extends StripeObject
|
||||
{
|
||||
/**
|
||||
* Possible string representations of an error's code.
|
||||
* @link https://stripe.com/docs/error-codes
|
||||
*/
|
||||
const CODE_ACCOUNT_ALREADY_EXISTS = 'account_already_exists';
|
||||
const CODE_ACCOUNT_COUNTRY_INVALID_ADDRESS = 'account_country_invalid_address';
|
||||
const CODE_ACCOUNT_INVALID = 'account_invalid';
|
||||
const CODE_ACCOUNT_NUMBER_INVALID = 'account_number_invalid';
|
||||
const CODE_ALIPAY_UPGRADE_REQUIRED = 'alipay_upgrade_required';
|
||||
const CODE_AMOUNT_TOO_LARGE = 'amount_too_large';
|
||||
const CODE_AMOUNT_TOO_SMALL = 'amount_too_small';
|
||||
const CODE_API_KEY_EXPIRED = 'api_key_expired';
|
||||
const CODE_BALANCE_INSUFFICIENT = 'balance_insufficient';
|
||||
const CODE_BANK_ACCOUNT_EXISTS = 'bank_account_exists';
|
||||
const CODE_BANK_ACCOUNT_UNUSABLE = 'bank_account_unusable';
|
||||
const CODE_BANK_ACCOUNT_UNVERIFIED = 'bank_account_unverified';
|
||||
const CODE_BITCOIN_UPGRADE_REQUIRED = 'bitcoin_upgrade_required';
|
||||
const CODE_CARD_DECLINED = 'card_declined';
|
||||
const CODE_CHARGE_ALREADY_CAPTURED = 'charge_already_captured';
|
||||
const CODE_CHARGE_ALREADY_REFUNDED = 'charge_already_refunded';
|
||||
const CODE_CHARGE_DISPUTED = 'charge_disputed';
|
||||
const CODE_CHARGE_EXCEEDS_SOURCE_LIMIT = 'charge_exceeds_source_limit';
|
||||
const CODE_CHARGE_EXPIRED_FOR_CAPTURE = 'charge_expired_for_capture';
|
||||
const CODE_COUNTRY_UNSUPPORTED = 'country_unsupported';
|
||||
const CODE_COUPON_EXPIRED = 'coupon_expired';
|
||||
const CODE_CUSTOMER_MAX_SUBSCRIPTIONS = 'customer_max_subscriptions';
|
||||
const CODE_EMAIL_INVALID = 'email_invalid';
|
||||
const CODE_EXPIRED_CARD = 'expired_card';
|
||||
const CODE_IDEMPOTENCY_KEY_IN_USE = 'idempotency_key_in_use';
|
||||
const CODE_INCORRECT_ADDRESS = 'incorrect_address';
|
||||
const CODE_INCORRECT_CVC = 'incorrect_cvc';
|
||||
const CODE_INCORRECT_NUMBER = 'incorrect_number';
|
||||
const CODE_INCORRECT_ZIP = 'incorrect_zip';
|
||||
const CODE_INSTANT_PAYOUTS_UNSUPPORTED = 'instant_payouts_unsupported';
|
||||
const CODE_INVALID_CARD_TYPE = 'invalid_card_type';
|
||||
const CODE_INVALID_CHARGE_AMOUNT = 'invalid_charge_amount';
|
||||
const CODE_INVALID_CVC = 'invalid_cvc';
|
||||
const CODE_INVALID_EXPIRY_MONTH = 'invalid_expiry_month';
|
||||
const CODE_INVALID_EXPIRY_YEAR = 'invalid_expiry_year';
|
||||
const CODE_INVALID_NUMBER = 'invalid_number';
|
||||
const CODE_INVALID_SOURCE_USAGE = 'invalid_source_usage';
|
||||
const CODE_INVOICE_NO_CUSTOMER_LINE_ITEMS = 'invoice_no_customer_line_items';
|
||||
const CODE_INVOICE_NO_SUBSCRIPTION_LINE_ITEMS = 'invoice_no_subscription_line_items';
|
||||
const CODE_INVOICE_NOT_EDITABLE = 'invoice_not_editable';
|
||||
const CODE_INVOICE_PAYMENT_INTENT_REQUIRES_ACTION = 'invoice_payment_intent_requires_action';
|
||||
const CODE_INVOICE_UPCOMING_NONE = 'invoice_upcoming_none';
|
||||
const CODE_LIVEMODE_MISMATCH = 'livemode_mismatch';
|
||||
const CODE_LOCK_TIMEOUT = 'lock_timeout';
|
||||
const CODE_MISSING = 'missing';
|
||||
const CODE_NOT_ALLOWED_ON_STANDARD_ACCOUNT = 'not_allowed_on_standard_account';
|
||||
const CODE_ORDER_CREATION_FAILED = 'order_creation_failed';
|
||||
const CODE_ORDER_REQUIRED_SETTINGS = 'order_required_settings';
|
||||
const CODE_ORDER_STATUS_INVALID = 'order_status_invalid';
|
||||
const CODE_ORDER_UPSTREAM_TIMEOUT = 'order_upstream_timeout';
|
||||
const CODE_OUT_OF_INVENTORY = 'out_of_inventory';
|
||||
const CODE_PARAMETER_INVALID_EMPTY = 'parameter_invalid_empty';
|
||||
const CODE_PARAMETER_INVALID_INTEGER = 'parameter_invalid_integer';
|
||||
const CODE_PARAMETER_INVALID_STRING_BLANK = 'parameter_invalid_string_blank';
|
||||
const CODE_PARAMETER_INVALID_STRING_EMPTY = 'parameter_invalid_string_empty';
|
||||
const CODE_PARAMETER_MISSING = 'parameter_missing';
|
||||
const CODE_PARAMETER_UNKNOWN = 'parameter_unknown';
|
||||
const CODE_PARAMETERS_EXCLUSIVE = 'parameters_exclusive';
|
||||
const CODE_PAYMENT_INTENT_AUTHENTICATION_FAILURE = 'payment_intent_authentication_failure';
|
||||
const CODE_PAYMENT_INTENT_INCOMPATIBLE_PAYMENT_METHOD = 'payment_intent_incompatible_payment_method';
|
||||
const CODE_PAYMENT_INTENT_INVALID_PARAMETER = 'payment_intent_invalid_parameter';
|
||||
const CODE_PAYMENT_INTENT_PAYMENT_ATTEMPT_FAILED = 'payment_intent_payment_attempt_failed';
|
||||
const CODE_PAYMENT_INTENT_UNEXPECTED_STATE = 'payment_intent_unexpected_state';
|
||||
const CODE_PAYMENT_METHOD_UNACTIVATED = 'payment_method_unactivated';
|
||||
const CODE_PAYMENT_METHOD_UNEXPECTED_STATE = 'payment_method_unexpected_state';
|
||||
const CODE_PAYOUTS_NOT_ALLOWED = 'payouts_not_allowed';
|
||||
const CODE_PLATFORM_API_KEY_EXPIRED = 'platform_api_key_expired';
|
||||
const CODE_POSTAL_CODE_INVALID = 'postal_code_invalid';
|
||||
const CODE_PROCESSING_ERROR = 'processing_error';
|
||||
const CODE_PRODUCT_INACTIVE = 'product_inactive';
|
||||
const CODE_RATE_LIMIT = 'rate_limit';
|
||||
const CODE_RESOURCE_ALREADY_EXISTS = 'resource_already_exists';
|
||||
const CODE_RESOURCE_MISSING = 'resource_missing';
|
||||
const CODE_ROUTING_NUMBER_INVALID = 'routing_number_invalid';
|
||||
const CODE_SECRET_KEY_REQUIRED = 'secret_key_required';
|
||||
const CODE_SEPA_UNSUPPORTED_ACCOUNT = 'sepa_unsupported_account';
|
||||
const CODE_SETUP_ATTEMPT_FAILED = 'setup_attempt_failed';
|
||||
const CODE_SETUP_INTENT_AUTHENTICATION_FAILURE = 'setup_intent_authentication_failure';
|
||||
const CODE_SETUP_INTENT_UNEXPECTED_STATE = 'setup_intent_unexpected_state';
|
||||
const CODE_SHIPPING_CALCULATION_FAILED = 'shipping_calculation_failed';
|
||||
const CODE_SKU_INACTIVE = 'sku_inactive';
|
||||
const CODE_STATE_UNSUPPORTED = 'state_unsupported';
|
||||
const CODE_TAX_ID_INVALID = 'tax_id_invalid';
|
||||
const CODE_TAXES_CALCULATION_FAILED = 'taxes_calculation_failed';
|
||||
const CODE_TESTMODE_CHARGES_ONLY = 'testmode_charges_only';
|
||||
const CODE_TLS_VERSION_UNSUPPORTED = 'tls_version_unsupported';
|
||||
const CODE_TOKEN_ALREADY_USED = 'token_already_used';
|
||||
const CODE_TOKEN_IN_USE = 'token_in_use';
|
||||
const CODE_TRANSFERS_NOT_ALLOWED = 'transfers_not_allowed';
|
||||
const CODE_UPSTREAM_ORDER_CREATION_FAILED = 'upstream_order_creation_failed';
|
||||
const CODE_URL_INVALID = 'url_invalid';
|
||||
|
||||
/**
|
||||
* Refreshes this object using the provided values.
|
||||
*
|
||||
* @param array $values
|
||||
* @param null|string|array|Util\RequestOptions $opts
|
||||
* @param boolean $partial Defaults to false.
|
||||
*/
|
||||
public function refreshFrom($values, $opts, $partial = false)
|
||||
{
|
||||
// Unlike most other API resources, the API will omit attributes in
|
||||
// error objects when they have a null value. We manually set default
|
||||
// values here to facilitate generic error handling.
|
||||
$values = array_merge([
|
||||
'charge' => null,
|
||||
'code' => null,
|
||||
'decline_code' => null,
|
||||
'doc_url' => null,
|
||||
'message' => null,
|
||||
'param' => null,
|
||||
'payment_intent' => null,
|
||||
'payment_method' => null,
|
||||
'setup_intent' => null,
|
||||
'source' => null,
|
||||
'type' => null,
|
||||
], $values);
|
||||
parent::refreshFrom($values, $opts, $partial);
|
||||
}
|
||||
}
|
||||
167
vendor/stripe-php-7.0.2/lib/Event.php
vendored
Normal file
167
vendor/stripe-php-7.0.2/lib/Event.php
vendored
Normal file
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class Event
|
||||
*
|
||||
* @property string $id
|
||||
* @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 string $type
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
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_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 CHECKOUT_SESSION_COMPLETED = 'checkout.session.completed';
|
||||
const COUPON_CREATED = 'coupon.created';
|
||||
const COUPON_DELETED = 'coupon.deleted';
|
||||
const COUPON_UPDATED = 'coupon.updated';
|
||||
const CREDIT_NOTE_CREATED = 'credit_note.created';
|
||||
const CREDIT_NOTE_UPDATED = 'credit_note.updated';
|
||||
const CREDIT_NOTE_VOIDED = 'credit_note.voided';
|
||||
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_ACTION_REQUIRED = 'invoice.payment_action_required';
|
||||
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_REQUEST = 'issuing_authorization.request';
|
||||
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_DISPUTE_CREATED = 'issuing_dispute.created';
|
||||
const ISSUING_DISPUTE_UPDATED = 'issuing_dispute.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_PAYMENT_FAILED = 'payment_intent.payment_failed';
|
||||
const PAYMENT_INTENT_SUCCEEDED = 'payment_intent.succeeded';
|
||||
const PAYMENT_METHOD_ATTACHED = 'payment_method.attached';
|
||||
const PAYMENT_METHOD_CARD_AUTOMATICALLY_UPDATED = 'payment_method.card_automatically_updated';
|
||||
const PAYMENT_METHOD_DETACHED = 'payment_method.detached';
|
||||
const PAYMENT_METHOD_UPDATED = 'payment_method.updated';
|
||||
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 PERSON_CREATED = 'person.created';
|
||||
const PERSON_DELETED = 'person.deleted';
|
||||
const PERSON_UPDATED = 'person.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 TAX_RATE_CREATED = 'tax_rate.created';
|
||||
const TAX_RATE_UPDATED = 'tax_rate.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;
|
||||
}
|
||||
14
vendor/stripe-php-7.0.2/lib/Exception/ApiConnectionException.php
vendored
Normal file
14
vendor/stripe-php-7.0.2/lib/Exception/ApiConnectionException.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Exception;
|
||||
|
||||
/**
|
||||
* ApiConnection is thrown in the event that the SDK can't connect to Stripe's
|
||||
* servers. That can be for a variety of different reasons from a downed
|
||||
* network to a bad TLS certificate.
|
||||
*
|
||||
* @package Stripe\Exception
|
||||
*/
|
||||
class ApiConnectionException extends ApiErrorException
|
||||
{
|
||||
}
|
||||
218
vendor/stripe-php-7.0.2/lib/Exception/ApiErrorException.php
vendored
Normal file
218
vendor/stripe-php-7.0.2/lib/Exception/ApiErrorException.php
vendored
Normal file
@@ -0,0 +1,218 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Exception;
|
||||
|
||||
/**
|
||||
* Implements properties and methods common to all (non-SPL) Stripe exceptions.
|
||||
*/
|
||||
abstract class ApiErrorException extends \Exception implements ExceptionInterface
|
||||
{
|
||||
protected $error;
|
||||
protected $httpBody;
|
||||
protected $httpHeaders;
|
||||
protected $httpStatus;
|
||||
protected $jsonBody;
|
||||
protected $requestId;
|
||||
protected $stripeCode;
|
||||
|
||||
/**
|
||||
* Creates a new API error exception.
|
||||
*
|
||||
* @param string $message The exception message.
|
||||
* @param int|null $httpStatus The HTTP status code.
|
||||
* @param string|null $httpBody The HTTP body as a string.
|
||||
* @param array|null $jsonBody The JSON deserialized body.
|
||||
* @param array|\Stripe\Util\CaseInsensitiveArray|null $httpHeaders The HTTP headers array.
|
||||
* @param string|null $stripeCode The Stripe error code.
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public static function factory(
|
||||
$message,
|
||||
$httpStatus = null,
|
||||
$httpBody = null,
|
||||
$jsonBody = null,
|
||||
$httpHeaders = null,
|
||||
$stripeCode = null
|
||||
) {
|
||||
$instance = new static($message);
|
||||
$instance->setHttpStatus($httpStatus);
|
||||
$instance->setHttpBody($httpBody);
|
||||
$instance->setJsonBody($jsonBody);
|
||||
$instance->setHttpHeaders($httpHeaders);
|
||||
$instance->setStripeCode($stripeCode);
|
||||
|
||||
$instance->setRequestId(null);
|
||||
if ($httpHeaders && isset($httpHeaders['Request-Id'])) {
|
||||
$instance->setRequestId($httpHeaders['Request-Id']);
|
||||
}
|
||||
|
||||
$instance->setError($instance->constructErrorObject());
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Stripe error object.
|
||||
*
|
||||
* @return \Stripe\ErrorObject|null
|
||||
*/
|
||||
public function getError()
|
||||
{
|
||||
return $this->error;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Stripe error object.
|
||||
*
|
||||
* @param \Stripe\ErrorObject|null $error
|
||||
*/
|
||||
public function setError($error)
|
||||
{
|
||||
$this->error = $error;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the HTTP body as a string.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getHttpBody()
|
||||
{
|
||||
return $this->httpBody;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the HTTP body as a string.
|
||||
*
|
||||
* @param string|null $httpBody
|
||||
*/
|
||||
public function setHttpBody($httpBody)
|
||||
{
|
||||
$this->httpBody = $httpBody;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the HTTP headers array.
|
||||
*
|
||||
* @return array|\Stripe\Util\CaseInsensitiveArray|null
|
||||
*/
|
||||
public function getHttpHeaders()
|
||||
{
|
||||
return $this->httpHeaders;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the HTTP headers array.
|
||||
*
|
||||
* @param array|\Stripe\Util\CaseInsensitiveArray|null $httpHeaders
|
||||
*/
|
||||
public function setHttpHeaders($httpHeaders)
|
||||
{
|
||||
$this->httpHeaders = $httpHeaders;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the HTTP status code.
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function getHttpStatus()
|
||||
{
|
||||
return $this->httpStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the HTTP status code.
|
||||
*
|
||||
* @param int|null $httpStatus
|
||||
*/
|
||||
public function setHttpStatus($httpStatus)
|
||||
{
|
||||
$this->httpStatus = $httpStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the JSON deserialized body.
|
||||
*
|
||||
* @return array|null
|
||||
*/
|
||||
public function getJsonBody()
|
||||
{
|
||||
return $this->jsonBody;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the JSON deserialized body.
|
||||
*
|
||||
* @param array|null $jsonBody
|
||||
*/
|
||||
public function setJsonBody($jsonBody)
|
||||
{
|
||||
$this->jsonBody = $jsonBody;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Stripe request ID.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getRequestId()
|
||||
{
|
||||
return $this->requestId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Stripe request ID.
|
||||
*
|
||||
* @param string|null $requestId
|
||||
*/
|
||||
public function setRequestId($requestId)
|
||||
{
|
||||
$this->requestId = $requestId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Stripe error code.
|
||||
*
|
||||
* Cf. the `CODE_*` constants on {@see \Stripe\ErrorObject} for possible
|
||||
* values.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getStripeCode()
|
||||
{
|
||||
return $this->stripeCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Stripe error code.
|
||||
*
|
||||
* @param string|null $stripeCode
|
||||
*/
|
||||
public function setStripeCode($stripeCode)
|
||||
{
|
||||
$this->stripeCode = $stripeCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the string representation of the exception.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
$statusStr = ($this->getHttpStatus() == null) ? "" : "(Status {$this->getHttpStatus()}) ";
|
||||
$idStr = ($this->getRequestId() == null) ? "" : "(Request {$this->getRequestId()}) ";
|
||||
return "{$statusStr}{$idStr}{$this->getMessage()}";
|
||||
}
|
||||
|
||||
protected function constructErrorObject()
|
||||
{
|
||||
if (is_null($this->jsonBody) || !array_key_exists('error', $this->jsonBody)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return \Stripe\ErrorObject::constructFrom($this->jsonBody['error']);
|
||||
}
|
||||
}
|
||||
13
vendor/stripe-php-7.0.2/lib/Exception/AuthenticationException.php
vendored
Normal file
13
vendor/stripe-php-7.0.2/lib/Exception/AuthenticationException.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Exception;
|
||||
|
||||
/**
|
||||
* AuthenticationException is thrown when invalid credentials are used to
|
||||
* connect to Stripe's servers.
|
||||
*
|
||||
* @package Stripe\Exception
|
||||
*/
|
||||
class AuthenticationException extends ApiErrorException
|
||||
{
|
||||
}
|
||||
7
vendor/stripe-php-7.0.2/lib/Exception/BadMethodCallException.php
vendored
Normal file
7
vendor/stripe-php-7.0.2/lib/Exception/BadMethodCallException.php
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Exception;
|
||||
|
||||
class BadMethodCallException extends \BadMethodCallException implements ExceptionInterface
|
||||
{
|
||||
}
|
||||
86
vendor/stripe-php-7.0.2/lib/Exception/CardException.php
vendored
Normal file
86
vendor/stripe-php-7.0.2/lib/Exception/CardException.php
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Exception;
|
||||
|
||||
/**
|
||||
* CardException is thrown when a user enters a card that can't be charged for
|
||||
* some reason.
|
||||
*
|
||||
* @package Stripe\Exception
|
||||
*/
|
||||
class CardException extends ApiErrorException
|
||||
{
|
||||
protected $declineCode;
|
||||
protected $stripeParam;
|
||||
|
||||
/**
|
||||
* Creates a new CardException exception.
|
||||
*
|
||||
* @param string $message The exception message.
|
||||
* @param int|null $httpStatus The HTTP status code.
|
||||
* @param string|null $httpBody The HTTP body as a string.
|
||||
* @param array|null $jsonBody The JSON deserialized body.
|
||||
* @param array|\Stripe\Util\CaseInsensitiveArray|null $httpHeaders The HTTP headers array.
|
||||
* @param string|null $stripeCode The Stripe error code.
|
||||
* @param string|null $declineCode The decline code.
|
||||
* @param string|null $stripeParam The parameter related to the error.
|
||||
*
|
||||
* @return CardException
|
||||
*/
|
||||
public static function factory(
|
||||
$message,
|
||||
$httpStatus = null,
|
||||
$httpBody = null,
|
||||
$jsonBody = null,
|
||||
$httpHeaders = null,
|
||||
$stripeCode = null,
|
||||
$declineCode = null,
|
||||
$stripeParam = null
|
||||
) {
|
||||
$instance = parent::factory($message, $httpStatus, $httpBody, $jsonBody, $httpHeaders, $stripeCode);
|
||||
$instance->setDeclineCode($declineCode);
|
||||
$instance->setStripeParam($stripeParam);
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the decline code.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getDeclineCode()
|
||||
{
|
||||
return $this->declineCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the decline code.
|
||||
*
|
||||
* @param string|null $declineCode
|
||||
*/
|
||||
public function setDeclineCode($declineCode)
|
||||
{
|
||||
$this->declineCode = $declineCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the parameter related to the error.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getStripeParam()
|
||||
{
|
||||
return $this->stripeParam;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the parameter related to the error.
|
||||
*
|
||||
* @param string|null $stripeParam
|
||||
*/
|
||||
public function setStripeParam($stripeParam)
|
||||
{
|
||||
$this->stripeParam = $stripeParam;
|
||||
}
|
||||
}
|
||||
26
vendor/stripe-php-7.0.2/lib/Exception/ExceptionInterface.php
vendored
Normal file
26
vendor/stripe-php-7.0.2/lib/Exception/ExceptionInterface.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Exception;
|
||||
|
||||
// TODO: remove this check once we drop support for PHP 5
|
||||
if (interface_exists(\Throwable::class)) {
|
||||
/**
|
||||
* The base interface for all Stripe exceptions.
|
||||
*
|
||||
* @package Stripe\Exception
|
||||
*/
|
||||
interface ExceptionInterface extends \Throwable
|
||||
{
|
||||
}
|
||||
} else {
|
||||
/**
|
||||
* The base interface for all Stripe exceptions.
|
||||
*
|
||||
* @package Stripe\Exception
|
||||
*/
|
||||
// phpcs:disable PSR1.Classes.ClassDeclaration.MultipleClasses
|
||||
interface ExceptionInterface
|
||||
{
|
||||
}
|
||||
// phpcs:enable
|
||||
}
|
||||
13
vendor/stripe-php-7.0.2/lib/Exception/IdempotencyException.php
vendored
Normal file
13
vendor/stripe-php-7.0.2/lib/Exception/IdempotencyException.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Exception;
|
||||
|
||||
/**
|
||||
* IdempotencyException is thrown in cases where an idempotency key was used
|
||||
* improperly.
|
||||
*
|
||||
* @package Stripe\Exception
|
||||
*/
|
||||
class IdempotencyException extends ApiErrorException
|
||||
{
|
||||
}
|
||||
7
vendor/stripe-php-7.0.2/lib/Exception/InvalidArgumentException.php
vendored
Normal file
7
vendor/stripe-php-7.0.2/lib/Exception/InvalidArgumentException.php
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Exception;
|
||||
|
||||
class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
|
||||
{
|
||||
}
|
||||
62
vendor/stripe-php-7.0.2/lib/Exception/InvalidRequestException.php
vendored
Normal file
62
vendor/stripe-php-7.0.2/lib/Exception/InvalidRequestException.php
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Exception;
|
||||
|
||||
/**
|
||||
* InvalidRequestException is thrown when a request is initiated with invalid
|
||||
* parameters.
|
||||
*
|
||||
* @package Stripe\Exception
|
||||
*/
|
||||
class InvalidRequestException extends ApiErrorException
|
||||
{
|
||||
protected $stripeParam;
|
||||
|
||||
/**
|
||||
* Creates a new InvalidRequestException exception.
|
||||
*
|
||||
* @param string $message The exception message.
|
||||
* @param int|null $httpStatus The HTTP status code.
|
||||
* @param string|null $httpBody The HTTP body as a string.
|
||||
* @param array|null $jsonBody The JSON deserialized body.
|
||||
* @param array|\Stripe\Util\CaseInsensitiveArray|null $httpHeaders The HTTP headers array.
|
||||
* @param string|null $stripeCode The Stripe error code.
|
||||
* @param string|null $stripeParam The parameter related to the error.
|
||||
*
|
||||
* @return InvalidRequestException
|
||||
*/
|
||||
public static function factory(
|
||||
$message,
|
||||
$httpStatus = null,
|
||||
$httpBody = null,
|
||||
$jsonBody = null,
|
||||
$httpHeaders = null,
|
||||
$stripeCode = null,
|
||||
$stripeParam = null
|
||||
) {
|
||||
$instance = parent::factory($message, $httpStatus, $httpBody, $jsonBody, $httpHeaders, $stripeCode);
|
||||
$instance->setStripeParam($stripeParam);
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the parameter related to the error.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getStripeParam()
|
||||
{
|
||||
return $this->stripeParam;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the parameter related to the error.
|
||||
*
|
||||
* @param string|null $stripeParam
|
||||
*/
|
||||
public function setStripeParam($stripeParam)
|
||||
{
|
||||
$this->stripeParam = $stripeParam;
|
||||
}
|
||||
}
|
||||
10
vendor/stripe-php-7.0.2/lib/Exception/OAuth/ExceptionInterface.php
vendored
Normal file
10
vendor/stripe-php-7.0.2/lib/Exception/OAuth/ExceptionInterface.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Exception\OAuth;
|
||||
|
||||
/**
|
||||
* The base interface for all Stripe OAuth exceptions.
|
||||
*/
|
||||
interface ExceptionInterface extends \Stripe\Exception\ExceptionInterface
|
||||
{
|
||||
}
|
||||
14
vendor/stripe-php-7.0.2/lib/Exception/OAuth/InvalidClientException.php
vendored
Normal file
14
vendor/stripe-php-7.0.2/lib/Exception/OAuth/InvalidClientException.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Exception\OAuth;
|
||||
|
||||
/**
|
||||
* InvalidClientException is thrown when the client_id does not belong to you,
|
||||
* the stripe_user_id does not exist or is not connected to your application,
|
||||
* or the API key mode (live or test mode) does not match the client_id mode.
|
||||
*
|
||||
* @package Stripe\Exception\OAuth
|
||||
*/
|
||||
class InvalidClientException extends OAuthErrorException
|
||||
{
|
||||
}
|
||||
15
vendor/stripe-php-7.0.2/lib/Exception/OAuth/InvalidGrantException.php
vendored
Normal file
15
vendor/stripe-php-7.0.2/lib/Exception/OAuth/InvalidGrantException.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Exception\OAuth;
|
||||
|
||||
/**
|
||||
* InvalidGrantException is thrown when a specified code doesn't exist, is
|
||||
* expired, has been used, or doesn't belong to you; a refresh token doesn't
|
||||
* exist, or doesn't belong to you; or if an API key's mode (live or test)
|
||||
* doesn't match the mode of a code or refresh token.
|
||||
*
|
||||
* @package Stripe\Exception\OAuth
|
||||
*/
|
||||
class InvalidGrantException extends OAuthErrorException
|
||||
{
|
||||
}
|
||||
13
vendor/stripe-php-7.0.2/lib/Exception/OAuth/InvalidRequestException.php
vendored
Normal file
13
vendor/stripe-php-7.0.2/lib/Exception/OAuth/InvalidRequestException.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Exception\OAuth;
|
||||
|
||||
/**
|
||||
* InvalidRequestException is thrown when a code, refresh token, or grant
|
||||
* type parameter is not provided, but was required.
|
||||
*
|
||||
* @package Stripe\Exception\OAuth
|
||||
*/
|
||||
class InvalidRequestException extends OAuthErrorException
|
||||
{
|
||||
}
|
||||
12
vendor/stripe-php-7.0.2/lib/Exception/OAuth/InvalidScopeException.php
vendored
Normal file
12
vendor/stripe-php-7.0.2/lib/Exception/OAuth/InvalidScopeException.php
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Exception\OAuth;
|
||||
|
||||
/**
|
||||
* InvalidScopeException is thrown when an invalid scope parameter is provided.
|
||||
*
|
||||
* @package Stripe\Exception\OAuth
|
||||
*/
|
||||
class InvalidScopeException extends OAuthErrorException
|
||||
{
|
||||
}
|
||||
19
vendor/stripe-php-7.0.2/lib/Exception/OAuth/OAuthErrorException.php
vendored
Normal file
19
vendor/stripe-php-7.0.2/lib/Exception/OAuth/OAuthErrorException.php
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Exception\OAuth;
|
||||
|
||||
/**
|
||||
* Implements properties and methods common to all (non-SPL) Stripe OAuth
|
||||
* exceptions.
|
||||
*/
|
||||
abstract class OAuthErrorException extends \Stripe\Exception\ApiErrorException
|
||||
{
|
||||
protected function constructErrorObject()
|
||||
{
|
||||
if (is_null($this->jsonBody)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return \Stripe\OAuthErrorObject::constructFrom($this->jsonBody);
|
||||
}
|
||||
}
|
||||
14
vendor/stripe-php-7.0.2/lib/Exception/OAuth/UnknownOAuthErrorException.php
vendored
Normal file
14
vendor/stripe-php-7.0.2/lib/Exception/OAuth/UnknownOAuthErrorException.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Exception\OAuth;
|
||||
|
||||
/**
|
||||
* UnknownApiErrorException is thrown when the client library receives an
|
||||
* error from the OAuth API it doesn't know about. Receiving this error usually
|
||||
* means that your client library is outdated and should be upgraded.
|
||||
*
|
||||
* @package Stripe\Exception
|
||||
*/
|
||||
class UnknownOAuthErrorException extends OAuthErrorException
|
||||
{
|
||||
}
|
||||
13
vendor/stripe-php-7.0.2/lib/Exception/OAuth/UnsupportedGrantTypeException.php
vendored
Normal file
13
vendor/stripe-php-7.0.2/lib/Exception/OAuth/UnsupportedGrantTypeException.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Exception\OAuth;
|
||||
|
||||
/**
|
||||
* UnsupportedGrantTypeException is thrown when an unuspported grant type
|
||||
* parameter is specified.
|
||||
*
|
||||
* @package Stripe\Exception\OAuth
|
||||
*/
|
||||
class UnsupportedGrantTypeException extends OAuthErrorException
|
||||
{
|
||||
}
|
||||
13
vendor/stripe-php-7.0.2/lib/Exception/OAuth/UnsupportedResponseTypeException.php
vendored
Normal file
13
vendor/stripe-php-7.0.2/lib/Exception/OAuth/UnsupportedResponseTypeException.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Exception\OAuth;
|
||||
|
||||
/**
|
||||
* UnsupportedResponseTypeException is thrown when an unsupported response type
|
||||
* parameter is specified.
|
||||
*
|
||||
* @package Stripe\Exception\OAuth
|
||||
*/
|
||||
class UnsupportedResponseTypeException extends OAuthErrorException
|
||||
{
|
||||
}
|
||||
13
vendor/stripe-php-7.0.2/lib/Exception/PermissionException.php
vendored
Normal file
13
vendor/stripe-php-7.0.2/lib/Exception/PermissionException.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Exception;
|
||||
|
||||
/**
|
||||
* PermissionException is thrown in cases where access was attempted on a
|
||||
* resource that wasn't allowed.
|
||||
*
|
||||
* @package Stripe\Exception
|
||||
*/
|
||||
class PermissionException extends ApiErrorException
|
||||
{
|
||||
}
|
||||
14
vendor/stripe-php-7.0.2/lib/Exception/RateLimitException.php
vendored
Normal file
14
vendor/stripe-php-7.0.2/lib/Exception/RateLimitException.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Exception;
|
||||
|
||||
/**
|
||||
* RateLimitException is thrown in cases where an account is putting too much
|
||||
* load on Stripe's API servers (usually by performing too many requests).
|
||||
* Please back off on request rate.
|
||||
*
|
||||
* @package Stripe\Exception
|
||||
*/
|
||||
class RateLimitException extends InvalidRequestException
|
||||
{
|
||||
}
|
||||
76
vendor/stripe-php-7.0.2/lib/Exception/SignatureVerificationException.php
vendored
Normal file
76
vendor/stripe-php-7.0.2/lib/Exception/SignatureVerificationException.php
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Exception;
|
||||
|
||||
/**
|
||||
* SignatureVerificationException is thrown when the signature verification for
|
||||
* a webhook fails.
|
||||
*
|
||||
* @package Stripe\Exception
|
||||
*/
|
||||
class SignatureVerificationException extends \Exception implements ExceptionInterface
|
||||
{
|
||||
protected $httpBody;
|
||||
protected $sigHeader;
|
||||
|
||||
/**
|
||||
* Creates a new SignatureVerificationException exception.
|
||||
*
|
||||
* @param string $message The exception message.
|
||||
* @param string|null $httpBody The HTTP body as a string.
|
||||
* @param string|null $sigHeader The `Stripe-Signature` HTTP header.
|
||||
*
|
||||
* @return SignatureVerificationException
|
||||
*/
|
||||
public static function factory(
|
||||
$message,
|
||||
$httpBody = null,
|
||||
$sigHeader = null
|
||||
) {
|
||||
$instance = new static($message);
|
||||
$instance->setHttpBody($httpBody);
|
||||
$instance->setSigHeader($sigHeader);
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the HTTP body as a string.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getHttpBody()
|
||||
{
|
||||
return $this->httpBody;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the HTTP body as a string.
|
||||
*
|
||||
* @param string|null $httpBody
|
||||
*/
|
||||
public function setHttpBody($httpBody)
|
||||
{
|
||||
$this->httpBody = $httpBody;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `Stripe-Signature` HTTP header.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getSigHeader()
|
||||
{
|
||||
return $this->sigHeader;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the `Stripe-Signature` HTTP header.
|
||||
*
|
||||
* @param string|null $sigHeader
|
||||
*/
|
||||
public function setSigHeader($sigHeader)
|
||||
{
|
||||
$this->sigHeader = $sigHeader;
|
||||
}
|
||||
}
|
||||
7
vendor/stripe-php-7.0.2/lib/Exception/UnexpectedValueException.php
vendored
Normal file
7
vendor/stripe-php-7.0.2/lib/Exception/UnexpectedValueException.php
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Exception;
|
||||
|
||||
class UnexpectedValueException extends \UnexpectedValueException implements ExceptionInterface
|
||||
{
|
||||
}
|
||||
14
vendor/stripe-php-7.0.2/lib/Exception/UnknownApiErrorException.php
vendored
Normal file
14
vendor/stripe-php-7.0.2/lib/Exception/UnknownApiErrorException.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Exception;
|
||||
|
||||
/**
|
||||
* UnknownApiErrorException is thrown when the client library receives an
|
||||
* error from the API it doesn't know about. Receiving this error usually
|
||||
* means that your client library is outdated and should be upgraded.
|
||||
*
|
||||
* @package Stripe\Exception
|
||||
*/
|
||||
class UnknownApiErrorException extends ApiErrorException
|
||||
{
|
||||
}
|
||||
16
vendor/stripe-php-7.0.2/lib/ExchangeRate.php
vendored
Normal file
16
vendor/stripe-php-7.0.2/lib/ExchangeRate.php
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class ExchangeRate
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class ExchangeRate extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "exchange_rate";
|
||||
|
||||
use ApiOperations\All;
|
||||
use ApiOperations\Retrieve;
|
||||
}
|
||||
60
vendor/stripe-php-7.0.2/lib/File.php
vendored
Normal file
60
vendor/stripe-php-7.0.2/lib/File.php
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class File
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property int $created
|
||||
* @property string $filename
|
||||
* @property Collection $links
|
||||
* @property string $purpose
|
||||
* @property int $size
|
||||
* @property string $title
|
||||
* @property string $type
|
||||
* @property string $url
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class File extends ApiResource
|
||||
{
|
||||
// This resource can have two different object names. In latter API
|
||||
// versions, only `file` is used, but since stripe-php may be used with
|
||||
// any API version, we need to support deserializing the older
|
||||
// `file_upload` object into the same class.
|
||||
const OBJECT_NAME = "file";
|
||||
const OBJECT_NAME_ALT = "file_upload";
|
||||
|
||||
use ApiOperations\All;
|
||||
use ApiOperations\Create {
|
||||
create as protected _create;
|
||||
}
|
||||
use ApiOperations\Retrieve;
|
||||
|
||||
public static function classUrl()
|
||||
{
|
||||
return '/v1/files';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array|null $params
|
||||
* @param array|string|null $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return \Stripe\File The created resource.
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
$opts = \Stripe\Util\RequestOptions::parse($options);
|
||||
if (is_null($opts->apiBase)) {
|
||||
$opts->apiBase = Stripe::$apiUploadBase;
|
||||
}
|
||||
// Manually flatten params, otherwise curl's multipart encoder will
|
||||
// choke on nested arrays.
|
||||
$flatParams = array_column(\Stripe\Util\Util::flattenParams($params), 1, 0);
|
||||
return static::_create($flatParams, $opts);
|
||||
}
|
||||
}
|
||||
28
vendor/stripe-php-7.0.2/lib/FileLink.php
vendored
Normal file
28
vendor/stripe-php-7.0.2/lib/FileLink.php
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class FileLink
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property int $created
|
||||
* @property bool $expired
|
||||
* @property int $expires_at
|
||||
* @property string $file
|
||||
* @property bool $livemode
|
||||
* @property StripeObject $metadata
|
||||
* @property string $url
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class FileLink extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "file_link";
|
||||
|
||||
use ApiOperations\All;
|
||||
use ApiOperations\Create;
|
||||
use ApiOperations\Retrieve;
|
||||
use ApiOperations\Update;
|
||||
}
|
||||
21
vendor/stripe-php-7.0.2/lib/HttpClient/ClientInterface.php
vendored
Normal file
21
vendor/stripe-php-7.0.2/lib/HttpClient/ClientInterface.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\HttpClient;
|
||||
|
||||
interface ClientInterface
|
||||
{
|
||||
/**
|
||||
* @param string $method The HTTP method being used
|
||||
* @param string $absUrl The URL being requested, including domain and protocol
|
||||
* @param array $headers Headers to be used in the request (full strings, not KV pairs)
|
||||
* @param array $params KV pairs for parameters. Can be nested for arrays and hashes
|
||||
* @param boolean $hasFile Whether or not $params references a file (via an @ prefix or
|
||||
* CURLFile)
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiConnectionException
|
||||
* @throws \Stripe\Exception\UnexpectedValueException
|
||||
* @return array An array whose first element is raw request body, second
|
||||
* element is HTTP status code and third array of HTTP headers.
|
||||
*/
|
||||
public function request($method, $absUrl, $headers, $params, $hasFile);
|
||||
}
|
||||
495
vendor/stripe-php-7.0.2/lib/HttpClient/CurlClient.php
vendored
Normal file
495
vendor/stripe-php-7.0.2/lib/HttpClient/CurlClient.php
vendored
Normal file
@@ -0,0 +1,495 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\HttpClient;
|
||||
|
||||
use Stripe\Stripe;
|
||||
use Stripe\Exception;
|
||||
use Stripe\Util;
|
||||
|
||||
// @codingStandardsIgnoreStart
|
||||
// PSR2 requires all constants be upper case. Sadly, the CURL_SSLVERSION
|
||||
// constants do not abide by those rules.
|
||||
|
||||
// Note the values come from their position in the enums that
|
||||
// defines them in cURL's source code.
|
||||
|
||||
// Available since PHP 5.5.19 and 5.6.3
|
||||
if (!defined('CURL_SSLVERSION_TLSv1_2')) {
|
||||
define('CURL_SSLVERSION_TLSv1_2', 6);
|
||||
}
|
||||
// @codingStandardsIgnoreEnd
|
||||
|
||||
// Available since PHP 7.0.7 and cURL 7.47.0
|
||||
if (!defined('CURL_HTTP_VERSION_2TLS')) {
|
||||
define('CURL_HTTP_VERSION_2TLS', 4);
|
||||
}
|
||||
|
||||
class CurlClient implements ClientInterface
|
||||
{
|
||||
private static $instance;
|
||||
|
||||
public static function instance()
|
||||
{
|
||||
if (!self::$instance) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
protected $defaultOptions;
|
||||
|
||||
protected $userAgentInfo;
|
||||
|
||||
protected $enablePersistentConnections = true;
|
||||
|
||||
protected $enableHttp2 = null;
|
||||
|
||||
protected $curlHandle = null;
|
||||
|
||||
/**
|
||||
* CurlClient constructor.
|
||||
*
|
||||
* Pass in a callable to $defaultOptions that returns an array of CURLOPT_* values to start
|
||||
* off a request with, or an flat array with the same format used by curl_setopt_array() to
|
||||
* provide a static set of options. Note that many options are overridden later in the request
|
||||
* call, including timeouts, which can be set via setTimeout() and setConnectTimeout().
|
||||
*
|
||||
* Note that request() will silently ignore a non-callable, non-array $defaultOptions, and will
|
||||
* throw an exception if $defaultOptions returns a non-array value.
|
||||
*
|
||||
* @param array|callable|null $defaultOptions
|
||||
*/
|
||||
public function __construct($defaultOptions = null, $randomGenerator = null)
|
||||
{
|
||||
$this->defaultOptions = $defaultOptions;
|
||||
$this->randomGenerator = $randomGenerator ?: new Util\RandomGenerator();
|
||||
$this->initUserAgentInfo();
|
||||
|
||||
$this->enableHttp2 = $this->canSafelyUseHttp2();
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
$this->closeCurlHandle();
|
||||
}
|
||||
|
||||
public function initUserAgentInfo()
|
||||
{
|
||||
$curlVersion = curl_version();
|
||||
$this->userAgentInfo = [
|
||||
'httplib' => 'curl ' . $curlVersion['version'],
|
||||
'ssllib' => $curlVersion['ssl_version'],
|
||||
];
|
||||
}
|
||||
|
||||
public function getDefaultOptions()
|
||||
{
|
||||
return $this->defaultOptions;
|
||||
}
|
||||
|
||||
public function getUserAgentInfo()
|
||||
{
|
||||
return $this->userAgentInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return boolean
|
||||
*/
|
||||
public function getEnablePersistentConnections()
|
||||
{
|
||||
return $this->enablePersistentConnections;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param boolean $enable
|
||||
*/
|
||||
public function setEnablePersistentConnections($enable)
|
||||
{
|
||||
$this->enablePersistentConnections = $enable;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return boolean
|
||||
*/
|
||||
public function getEnableHttp2()
|
||||
{
|
||||
return $this->enableHttp2;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param boolean $enable
|
||||
*/
|
||||
public function setEnableHttp2($enable)
|
||||
{
|
||||
$this->enableHttp2 = $enable;
|
||||
}
|
||||
|
||||
// USER DEFINED TIMEOUTS
|
||||
|
||||
const DEFAULT_TIMEOUT = 80;
|
||||
const DEFAULT_CONNECT_TIMEOUT = 30;
|
||||
|
||||
private $timeout = self::DEFAULT_TIMEOUT;
|
||||
private $connectTimeout = self::DEFAULT_CONNECT_TIMEOUT;
|
||||
|
||||
public function setTimeout($seconds)
|
||||
{
|
||||
$this->timeout = (int) max($seconds, 0);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setConnectTimeout($seconds)
|
||||
{
|
||||
$this->connectTimeout = (int) max($seconds, 0);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTimeout()
|
||||
{
|
||||
return $this->timeout;
|
||||
}
|
||||
|
||||
public function getConnectTimeout()
|
||||
{
|
||||
return $this->connectTimeout;
|
||||
}
|
||||
|
||||
// END OF USER DEFINED TIMEOUTS
|
||||
|
||||
public function request($method, $absUrl, $headers, $params, $hasFile)
|
||||
{
|
||||
$method = strtolower($method);
|
||||
|
||||
$opts = [];
|
||||
if (is_callable($this->defaultOptions)) { // call defaultOptions callback, set options to return value
|
||||
$opts = call_user_func_array($this->defaultOptions, func_get_args());
|
||||
if (!is_array($opts)) {
|
||||
throw new Exception\UnexpectedValueException("Non-array value returned by defaultOptions CurlClient callback");
|
||||
}
|
||||
} elseif (is_array($this->defaultOptions)) { // set default curlopts from array
|
||||
$opts = $this->defaultOptions;
|
||||
}
|
||||
|
||||
$params = Util\Util::objectsToIds($params);
|
||||
|
||||
if ($method == 'get') {
|
||||
if ($hasFile) {
|
||||
throw new Exception\UnexpectedValueException(
|
||||
"Issuing a GET request with a file parameter"
|
||||
);
|
||||
}
|
||||
$opts[CURLOPT_HTTPGET] = 1;
|
||||
if (count($params) > 0) {
|
||||
$encoded = Util\Util::encodeParameters($params);
|
||||
$absUrl = "$absUrl?$encoded";
|
||||
}
|
||||
} elseif ($method == 'post') {
|
||||
$opts[CURLOPT_POST] = 1;
|
||||
$opts[CURLOPT_POSTFIELDS] = $hasFile ? $params : Util\Util::encodeParameters($params);
|
||||
} elseif ($method == 'delete') {
|
||||
$opts[CURLOPT_CUSTOMREQUEST] = 'DELETE';
|
||||
if (count($params) > 0) {
|
||||
$encoded = Util\Util::encodeParameters($params);
|
||||
$absUrl = "$absUrl?$encoded";
|
||||
}
|
||||
} else {
|
||||
throw new Exception\UnexpectedValueException("Unrecognized method $method");
|
||||
}
|
||||
|
||||
// It is only safe to retry network failures on POST requests if we
|
||||
// add an Idempotency-Key header
|
||||
if (($method == 'post') && (Stripe::$maxNetworkRetries > 0)) {
|
||||
if (!$this->hasHeader($headers, "Idempotency-Key")) {
|
||||
array_push($headers, 'Idempotency-Key: ' . $this->randomGenerator->uuid());
|
||||
}
|
||||
}
|
||||
|
||||
// Create a callback to capture HTTP headers for the response
|
||||
$rheaders = new Util\CaseInsensitiveArray();
|
||||
$headerCallback = function ($curl, $header_line) use (&$rheaders) {
|
||||
// Ignore the HTTP request line (HTTP/1.1 200 OK)
|
||||
if (strpos($header_line, ":") === false) {
|
||||
return strlen($header_line);
|
||||
}
|
||||
list($key, $value) = explode(":", trim($header_line), 2);
|
||||
$rheaders[trim($key)] = trim($value);
|
||||
return strlen($header_line);
|
||||
};
|
||||
|
||||
// By default for large request body sizes (> 1024 bytes), cURL will
|
||||
// send a request without a body and with a `Expect: 100-continue`
|
||||
// header, which gives the server a chance to respond with an error
|
||||
// status code in cases where one can be determined right away (say
|
||||
// on an authentication problem for example), and saves the "large"
|
||||
// request body from being ever sent.
|
||||
//
|
||||
// Unfortunately, the bindings don't currently correctly handle the
|
||||
// success case (in which the server sends back a 100 CONTINUE), so
|
||||
// we'll error under that condition. To compensate for that problem
|
||||
// for the time being, override cURL's behavior by simply always
|
||||
// sending an empty `Expect:` header.
|
||||
array_push($headers, 'Expect: ');
|
||||
|
||||
$absUrl = Util\Util::utf8($absUrl);
|
||||
$opts[CURLOPT_URL] = $absUrl;
|
||||
$opts[CURLOPT_RETURNTRANSFER] = true;
|
||||
$opts[CURLOPT_CONNECTTIMEOUT] = $this->connectTimeout;
|
||||
$opts[CURLOPT_TIMEOUT] = $this->timeout;
|
||||
$opts[CURLOPT_HEADERFUNCTION] = $headerCallback;
|
||||
$opts[CURLOPT_HTTPHEADER] = $headers;
|
||||
$opts[CURLOPT_CAINFO] = Stripe::getCABundlePath();
|
||||
if (!Stripe::getVerifySslCerts()) {
|
||||
$opts[CURLOPT_SSL_VERIFYPEER] = false;
|
||||
}
|
||||
|
||||
if (!isset($opts[CURLOPT_HTTP_VERSION]) && $this->getEnableHttp2()) {
|
||||
// For HTTPS requests, enable HTTP/2, if supported
|
||||
$opts[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_2TLS;
|
||||
}
|
||||
|
||||
list($rbody, $rcode) = $this->executeRequestWithRetries($opts, $absUrl);
|
||||
|
||||
return [$rbody, $rcode, $rheaders];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $opts cURL options
|
||||
*/
|
||||
private function executeRequestWithRetries($opts, $absUrl)
|
||||
{
|
||||
$numRetries = 0;
|
||||
$isPost = array_key_exists(CURLOPT_POST, $opts) && $opts[CURLOPT_POST] == 1;
|
||||
|
||||
while (true) {
|
||||
$rcode = 0;
|
||||
$errno = 0;
|
||||
|
||||
$this->resetCurlHandle();
|
||||
curl_setopt_array($this->curlHandle, $opts);
|
||||
$rbody = curl_exec($this->curlHandle);
|
||||
|
||||
if ($rbody === false) {
|
||||
$errno = curl_errno($this->curlHandle);
|
||||
$message = curl_error($this->curlHandle);
|
||||
} else {
|
||||
$rcode = curl_getinfo($this->curlHandle, CURLINFO_HTTP_CODE);
|
||||
}
|
||||
if (!$this->getEnablePersistentConnections()) {
|
||||
$this->closeCurlHandle();
|
||||
}
|
||||
|
||||
if ($this->shouldRetry($errno, $isPost, $rcode, $rbody, $numRetries)) {
|
||||
$numRetries += 1;
|
||||
$sleepSeconds = $this->sleepTime($numRetries);
|
||||
usleep(intval($sleepSeconds * 1000000));
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($rbody === false) {
|
||||
$this->handleCurlError($absUrl, $errno, $message, $numRetries);
|
||||
}
|
||||
|
||||
return [$rbody, $rcode];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
* @param int $errno
|
||||
* @param string $message
|
||||
* @param int $numRetries
|
||||
* @throws Exception\ApiConnectionException
|
||||
*/
|
||||
private function handleCurlError($url, $errno, $message, $numRetries)
|
||||
{
|
||||
switch ($errno) {
|
||||
case CURLE_COULDNT_CONNECT:
|
||||
case CURLE_COULDNT_RESOLVE_HOST:
|
||||
case CURLE_OPERATION_TIMEOUTED:
|
||||
$msg = "Could not connect to Stripe ($url). Please check your "
|
||||
. "internet connection and try again. If this problem persists, "
|
||||
. "you should check Stripe's service status at "
|
||||
. "https://twitter.com/stripestatus, or";
|
||||
break;
|
||||
case CURLE_SSL_CACERT:
|
||||
case CURLE_SSL_PEER_CERTIFICATE:
|
||||
$msg = "Could not verify Stripe's SSL certificate. Please make sure "
|
||||
. "that your network is not intercepting certificates. "
|
||||
. "(Try going to $url in your browser.) "
|
||||
. "If this problem persists,";
|
||||
break;
|
||||
default:
|
||||
$msg = "Unexpected error communicating with Stripe. "
|
||||
. "If this problem persists,";
|
||||
}
|
||||
$msg .= " let us know at support@stripe.com.";
|
||||
|
||||
$msg .= "\n\n(Network error [errno $errno]: $message)";
|
||||
|
||||
if ($numRetries > 0) {
|
||||
$msg .= "\n\nRequest was retried $numRetries times.";
|
||||
}
|
||||
|
||||
throw new Exception\ApiConnectionException($msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if an error is a problem that we should retry on. This includes both
|
||||
* socket errors that may represent an intermittent problem and some special
|
||||
* HTTP statuses.
|
||||
*
|
||||
* @param int $errno
|
||||
* @param bool $isPost
|
||||
* @param int $rcode
|
||||
* @param string $rbody
|
||||
* @param int $numRetries
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function shouldRetry($errno, $isPost, $rcode, $rbody, $numRetries)
|
||||
{
|
||||
if ($numRetries >= Stripe::getMaxNetworkRetries()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Retry on timeout-related problems (either on open or read).
|
||||
if ($errno === CURLE_OPERATION_TIMEOUTED) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Destination refused the connection, the connection was reset, or a
|
||||
// variety of other connection failures. This could occur from a single
|
||||
// saturated server, so retry in case it's intermittent.
|
||||
if ($errno === CURLE_COULDNT_CONNECT) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 409 Conflict
|
||||
if ($rcode === 409) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 429 Too Many Requests
|
||||
//
|
||||
// There are a few different problems that can lead to a 429. The most
|
||||
// common is rate limiting, on which we *don't* want to retry because
|
||||
// that'd likely contribute to more contention problems. However, some
|
||||
// 429s are lock timeouts, which is when a request conflicted with
|
||||
// another request or an internal process on some particular object.
|
||||
// These 429s are safe to retry.
|
||||
if ($rcode === 429) {
|
||||
// It's not great that we're doing this here. In a future version,
|
||||
// we should decouple the retry logic from the CurlClient instance,
|
||||
// so that we don't need to deserialize here (and also so that the
|
||||
// retry logic applies to non-curl clients).
|
||||
$resp = json_decode($rbody, true);
|
||||
if ($resp !== null && array_key_exists('error', $resp)) {
|
||||
$error = \Stripe\ErrorObject::constructFrom($resp['error']);
|
||||
if ($error->code === \Stripe\ErrorObject::CODE_LOCK_TIMEOUT) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 500 Internal Server Error
|
||||
//
|
||||
// We only bother retrying these for non-POST requests. POSTs end up
|
||||
// being cached by the idempotency layer so there's no purpose in
|
||||
// retrying them.
|
||||
if ($rcode >= 500 && !$isPost) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 503 Service Unavailable
|
||||
if ($rcode == 503) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private function sleepTime($numRetries)
|
||||
{
|
||||
// Apply exponential backoff with $initialNetworkRetryDelay on the
|
||||
// number of $numRetries so far as inputs. Do not allow the number to exceed
|
||||
// $maxNetworkRetryDelay.
|
||||
$sleepSeconds = min(
|
||||
Stripe::getInitialNetworkRetryDelay() * 1.0 * pow(2, $numRetries - 1),
|
||||
Stripe::getMaxNetworkRetryDelay()
|
||||
);
|
||||
|
||||
// Apply some jitter by randomizing the value in the range of
|
||||
// ($sleepSeconds / 2) to ($sleepSeconds).
|
||||
$sleepSeconds *= 0.5 * (1 + $this->randomGenerator->randFloat());
|
||||
|
||||
// But never sleep less than the base sleep seconds.
|
||||
$sleepSeconds = max(Stripe::getInitialNetworkRetryDelay(), $sleepSeconds);
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether it is safe to use HTTP/2 or not.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
private function canSafelyUseHttp2()
|
||||
{
|
||||
// Versions of curl older than 7.60.0 don't respect GOAWAY frames
|
||||
// (cf. https://github.com/curl/curl/issues/2416), which Stripe use.
|
||||
$curlVersion = curl_version()['version'];
|
||||
return (version_compare($curlVersion, '7.60.0') >= 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a list of headers contains a specific header name.
|
||||
*
|
||||
* @param string[] $headers
|
||||
* @param string $name
|
||||
* @return boolean
|
||||
*/
|
||||
private function hasHeader($headers, $name)
|
||||
{
|
||||
foreach ($headers as $header) {
|
||||
if (strncasecmp($header, "{$name}: ", strlen($name) + 2) === 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
214
vendor/stripe-php-7.0.2/lib/Invoice.php
vendored
Normal file
214
vendor/stripe-php-7.0.2/lib/Invoice.php
vendored
Normal file
@@ -0,0 +1,214 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class Invoice
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property string $account_country
|
||||
* @property string $account_name
|
||||
* @property int $amount_due
|
||||
* @property int $amount_paid
|
||||
* @property int $amount_remaining
|
||||
* @property int $application_fee_amount
|
||||
* @property int $attempt_count
|
||||
* @property bool $attempted
|
||||
* @property bool $auto_advance
|
||||
* @property string $billing
|
||||
* @property string $billing_reason
|
||||
* @property string $charge
|
||||
* @property string $collection_method
|
||||
* @property int $created
|
||||
* @property string $currency
|
||||
* @property array $custom_fields
|
||||
* @property string $customer
|
||||
* @property mixed $customer_address
|
||||
* @property string $customer_email
|
||||
* @property string $customer_name
|
||||
* @property string $customer_phone
|
||||
* @property mixed $customer_shipping
|
||||
* @property string $customer_tax_exempt
|
||||
* @property array $customer_tax_ids
|
||||
* @property string $default_payment_method
|
||||
* @property string $default_source
|
||||
* @property array $default_tax_rates
|
||||
* @property string $description
|
||||
* @property Discount $discount
|
||||
* @property int $due_date
|
||||
* @property int $ending_balance
|
||||
* @property string $footer
|
||||
* @property string $hosted_invoice_url
|
||||
* @property string $invoice_pdf
|
||||
* @property Collection $lines
|
||||
* @property bool $livemode
|
||||
* @property StripeObject $metadata
|
||||
* @property int $next_payment_attempt
|
||||
* @property string $number
|
||||
* @property bool $paid
|
||||
* @property string $payment_intent
|
||||
* @property int $period_end
|
||||
* @property int $period_start
|
||||
* @property int $post_payment_credit_notes_amount
|
||||
* @property int $pre_payment_credit_notes_amount
|
||||
* @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 mixed $threshold_reason
|
||||
* @property int $total
|
||||
* @property array $total_tax_amounts
|
||||
* @property int $webhooks_delivered_at
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class Invoice extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "invoice";
|
||||
|
||||
use ApiOperations\All;
|
||||
use ApiOperations\Create;
|
||||
use ApiOperations\Delete;
|
||||
use ApiOperations\Retrieve;
|
||||
use ApiOperations\Update;
|
||||
|
||||
/**
|
||||
* Possible string representations of the billing reason.
|
||||
* @link https://stripe.com/docs/api/invoices/object#invoice_object-billing_reason
|
||||
*/
|
||||
const BILLING_REASON_MANUAL = 'manual';
|
||||
const BILLING_REASON_SUBSCRIPTION = 'subscription';
|
||||
const BILLING_REASON_SUBSCRIPTION_CREATE = 'subscription_create';
|
||||
const BILLING_REASON_SUBSCRIPTION_CYCLE = 'subscription_cycle';
|
||||
const BILLING_REASON_SUBSCRIPTION_THRESHOLD = 'subscription_threshold';
|
||||
const BILLING_REASON_SUBSCRIPTION_UPDATE = 'subscription_update';
|
||||
const BILLING_REASON_UPCOMING = 'upcoming';
|
||||
|
||||
/**
|
||||
* Possible string representations of the `collection_method` property.
|
||||
* @link https://stripe.com/docs/api/invoices/object#invoice_object-collection_method
|
||||
*/
|
||||
const COLLECTION_METHOD_CHARGE_AUTOMATICALLY = 'charge_automatically';
|
||||
const COLLECTION_METHOD_SEND_INVOICE = 'send_invoice';
|
||||
|
||||
/**
|
||||
* Possible string representations of the invoice status.
|
||||
* @link https://stripe.com/docs/api/invoices/object#invoice_object-status
|
||||
*/
|
||||
const STATUS_DRAFT = 'draft';
|
||||
const STATUS_OPEN = 'open';
|
||||
const STATUS_PAID = 'paid';
|
||||
const STATUS_UNCOLLECTIBLE = 'uncollectible';
|
||||
const STATUS_VOID = 'void';
|
||||
|
||||
/**
|
||||
* Possible string representations of the `billing` property.
|
||||
* @deprecated Use `collection_method` instead.
|
||||
* @link https://stripe.com/docs/api/invoices/object#invoice_object-billing
|
||||
*/
|
||||
const BILLING_CHARGE_AUTOMATICALLY = 'charge_automatically';
|
||||
const BILLING_SEND_INVOICE = 'send_invoice';
|
||||
|
||||
/**
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @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
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @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
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @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
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @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
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return Invoice The upcoming invoice.
|
||||
*/
|
||||
public static function upcoming($params = null, $opts = null)
|
||||
{
|
||||
$url = static::classUrl() . '/upcoming';
|
||||
list($response, $opts) = static::_staticRequest('get', $url, $params, $opts);
|
||||
$obj = Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return Invoice The voided invoice.
|
||||
*/
|
||||
public function voidInvoice($params = null, $opts = null)
|
||||
{
|
||||
$url = $this->instanceUrl() . '/void';
|
||||
list($response, $opts) = $this->_request('post', $url, $params, $opts);
|
||||
$this->refreshFrom($response, $opts);
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
39
vendor/stripe-php-7.0.2/lib/InvoiceItem.php
vendored
Normal file
39
vendor/stripe-php-7.0.2/lib/InvoiceItem.php
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class InvoiceItem
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property int $amount
|
||||
* @property string $currency
|
||||
* @property string $customer
|
||||
* @property int $date
|
||||
* @property string $description
|
||||
* @property bool $discountable
|
||||
* @property string $invoice
|
||||
* @property bool $livemode
|
||||
* @property StripeObject $metadata
|
||||
* @property mixed $period
|
||||
* @property Plan $plan
|
||||
* @property bool $proration
|
||||
* @property int $quantity
|
||||
* @property string $subscription
|
||||
* @property string $subscription_item
|
||||
* @property array $tax_rates
|
||||
* @property int $unit_amount
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class InvoiceItem extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "invoiceitem";
|
||||
|
||||
use ApiOperations\All;
|
||||
use ApiOperations\Create;
|
||||
use ApiOperations\Delete;
|
||||
use ApiOperations\Retrieve;
|
||||
use ApiOperations\Update;
|
||||
}
|
||||
32
vendor/stripe-php-7.0.2/lib/InvoiceLineItem.php
vendored
Normal file
32
vendor/stripe-php-7.0.2/lib/InvoiceLineItem.php
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class InvoiceLineItem
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property int $amount
|
||||
* @property string $currency
|
||||
* @property string $description
|
||||
* @property bool $discountable
|
||||
* @property string $invoice_item
|
||||
* @property bool $livemode
|
||||
* @property StripeObject $metadata
|
||||
* @property mixed $period
|
||||
* @property Plan $plan
|
||||
* @property bool $proration
|
||||
* @property int $quantity
|
||||
* @property string $subscription
|
||||
* @property string $subscription_item
|
||||
* @property array $tax_amounts
|
||||
* @property array $tax_rates
|
||||
* @property string $type
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class InvoiceLineItem extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "line_item";
|
||||
}
|
||||
72
vendor/stripe-php-7.0.2/lib/Issuing/Authorization.php
vendored
Normal file
72
vendor/stripe-php-7.0.2/lib/Issuing/Authorization.php
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Issuing;
|
||||
|
||||
/**
|
||||
* Class Authorization
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property bool $approved
|
||||
* @property string $authorization_method
|
||||
* @property int $authorized_amount
|
||||
* @property string $authorized_currency
|
||||
* @property \Stripe\Collection $balance_transactions
|
||||
* @property Card $card
|
||||
* @property Cardholder $cardholder
|
||||
* @property int $created
|
||||
* @property int $held_amount
|
||||
* @property string $held_currency
|
||||
* @property bool $is_held_amount_controllable
|
||||
* @property bool $livemode
|
||||
* @property mixed $merchant_data
|
||||
* @property \Stripe\StripeObject $metadata
|
||||
* @property int $pending_authorized_amount
|
||||
* @property int $pending_held_amount
|
||||
* @property mixed $request_history
|
||||
* @property string $status
|
||||
* @property \Stripe\Collection $transactions
|
||||
* @property mixed $verification_data
|
||||
*
|
||||
* @package Stripe\Issuing
|
||||
*/
|
||||
class Authorization extends \Stripe\ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "issuing.authorization";
|
||||
|
||||
use \Stripe\ApiOperations\All;
|
||||
use \Stripe\ApiOperations\Retrieve;
|
||||
use \Stripe\ApiOperations\Update;
|
||||
|
||||
/**
|
||||
* @param array|null $params
|
||||
* @param array|string|null $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return Authorization The approved authorization.
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array|null $params
|
||||
* @param array|string|null $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return Authorization The declined authorization.
|
||||
*/
|
||||
public function decline($params = null, $options = null)
|
||||
{
|
||||
$url = $this->instanceUrl() . '/decline';
|
||||
list($response, $opts) = $this->_request('post', $url, $params, $options);
|
||||
$this->refreshFrom($response, $opts);
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
53
vendor/stripe-php-7.0.2/lib/Issuing/Card.php
vendored
Normal file
53
vendor/stripe-php-7.0.2/lib/Issuing/Card.php
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Issuing;
|
||||
|
||||
/**
|
||||
* Class Card
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property mixed $authorization_controls
|
||||
* @property mixed $billing
|
||||
* @property string $brand
|
||||
* @property Cardholder $cardholder
|
||||
* @property int $created
|
||||
* @property string $currency
|
||||
* @property int $exp_month
|
||||
* @property int $exp_year
|
||||
* @property string $last4
|
||||
* @property bool $livemode
|
||||
* @property \Stripe\StripeObject $metadata
|
||||
* @property string $name
|
||||
* @property mixed $shipping
|
||||
* @property string $status
|
||||
* @property string $type
|
||||
*
|
||||
* @package Stripe\Issuing
|
||||
*/
|
||||
class Card extends \Stripe\ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "issuing.card";
|
||||
|
||||
use \Stripe\ApiOperations\All;
|
||||
use \Stripe\ApiOperations\Create;
|
||||
use \Stripe\ApiOperations\Retrieve;
|
||||
use \Stripe\ApiOperations\Update;
|
||||
|
||||
/**
|
||||
* @param array|null $params
|
||||
* @param array|string|null $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return CardDetails The card details associated with that issuing card.
|
||||
*/
|
||||
public function details($params = null, $options = null)
|
||||
{
|
||||
$url = $this->instanceUrl() . '/details';
|
||||
list($response, $opts) = $this->_request('get', $url, $params, $options);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
return $obj;
|
||||
}
|
||||
}
|
||||
21
vendor/stripe-php-7.0.2/lib/Issuing/CardDetails.php
vendored
Normal file
21
vendor/stripe-php-7.0.2/lib/Issuing/CardDetails.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Issuing;
|
||||
|
||||
/**
|
||||
* Class CardDetails
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property Card $card
|
||||
* @property string $cvc
|
||||
* @property int $exp_month
|
||||
* @property int $exp_year
|
||||
* @property string $number
|
||||
*
|
||||
* @package Stripe\Issuing
|
||||
*/
|
||||
class CardDetails extends \Stripe\ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "issuing.card_details";
|
||||
}
|
||||
30
vendor/stripe-php-7.0.2/lib/Issuing/Cardholder.php
vendored
Normal file
30
vendor/stripe-php-7.0.2/lib/Issuing/Cardholder.php
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Issuing;
|
||||
|
||||
/**
|
||||
* Class Cardholder
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property mixed $billing
|
||||
* @property int $created
|
||||
* @property string $email
|
||||
* @property bool $livemode
|
||||
* @property \Stripe\StripeObject $metadata
|
||||
* @property string $name
|
||||
* @property string $phone_number
|
||||
* @property string $status
|
||||
* @property string $type
|
||||
*
|
||||
* @package Stripe\Issuing
|
||||
*/
|
||||
class Cardholder extends \Stripe\ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "issuing.cardholder";
|
||||
|
||||
use \Stripe\ApiOperations\All;
|
||||
use \Stripe\ApiOperations\Create;
|
||||
use \Stripe\ApiOperations\Retrieve;
|
||||
use \Stripe\ApiOperations\Update;
|
||||
}
|
||||
30
vendor/stripe-php-7.0.2/lib/Issuing/Dispute.php
vendored
Normal file
30
vendor/stripe-php-7.0.2/lib/Issuing/Dispute.php
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Issuing;
|
||||
|
||||
/**
|
||||
* Class Dispute
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property int $amount
|
||||
* @property int $created
|
||||
* @property string $currency
|
||||
* @property mixed $evidence
|
||||
* @property bool $livemode
|
||||
* @property \Stripe\StripeObject $metadata
|
||||
* @property string $reason
|
||||
* @property string $status
|
||||
* @property Transaction $transaction
|
||||
*
|
||||
* @package Stripe\Issuing
|
||||
*/
|
||||
class Dispute extends \Stripe\ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "issuing.dispute";
|
||||
|
||||
use \Stripe\ApiOperations\All;
|
||||
use \Stripe\ApiOperations\Create;
|
||||
use \Stripe\ApiOperations\Retrieve;
|
||||
use \Stripe\ApiOperations\Update;
|
||||
}
|
||||
35
vendor/stripe-php-7.0.2/lib/Issuing/Transaction.php
vendored
Normal file
35
vendor/stripe-php-7.0.2/lib/Issuing/Transaction.php
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Issuing;
|
||||
|
||||
/**
|
||||
* Class Transaction
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property int $amount
|
||||
* @property string $authorization
|
||||
* @property string $balance_transaction
|
||||
* @property string $card
|
||||
* @property string $cardholder
|
||||
* @property int $created
|
||||
* @property string $currency
|
||||
* @property string $dispute
|
||||
* @property bool $livemode
|
||||
* @property mixed $merchant_data
|
||||
* @property int $merchant_amount
|
||||
* @property string $merchant_currency
|
||||
* @property \Stripe\StripeObject $metadata
|
||||
* @property string $type
|
||||
*
|
||||
* @package Stripe\Issuing
|
||||
*/
|
||||
class Transaction extends \Stripe\ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "issuing.transaction";
|
||||
|
||||
use \Stripe\ApiOperations\All;
|
||||
use \Stripe\ApiOperations\Create;
|
||||
use \Stripe\ApiOperations\Retrieve;
|
||||
use \Stripe\ApiOperations\Update;
|
||||
}
|
||||
17
vendor/stripe-php-7.0.2/lib/LoginLink.php
vendored
Normal file
17
vendor/stripe-php-7.0.2/lib/LoginLink.php
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class LoginLink
|
||||
*
|
||||
* @property string $object
|
||||
* @property int $created
|
||||
* @property string $url
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class LoginLink extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "login_link";
|
||||
}
|
||||
97
vendor/stripe-php-7.0.2/lib/OAuth.php
vendored
Normal file
97
vendor/stripe-php-7.0.2/lib/OAuth.php
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
abstract class OAuth
|
||||
{
|
||||
/**
|
||||
* Generates a URL to Stripe's OAuth form.
|
||||
*
|
||||
* @param array|null $params
|
||||
* @param array|null $opts
|
||||
*
|
||||
* @return string The URL to Stripe's OAuth form.
|
||||
*/
|
||||
public static function authorizeUrl($params = null, $opts = null)
|
||||
{
|
||||
$params = $params ?: [];
|
||||
|
||||
$base = ($opts && array_key_exists('connect_base', $opts)) ? $opts['connect_base'] : Stripe::$connectBase;
|
||||
|
||||
$params['client_id'] = self::_getClientId($params);
|
||||
if (!array_key_exists('response_type', $params)) {
|
||||
$params['response_type'] = 'code';
|
||||
}
|
||||
$query = Util\Util::encodeParameters($params);
|
||||
|
||||
return $base . '/oauth/authorize?' . $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use an authoriztion code to connect an account to your platform and
|
||||
* fetch the user's credentials.
|
||||
*
|
||||
* @param array|null $params
|
||||
* @param array|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\OAuth\OAuthErrorException if the request fails
|
||||
*
|
||||
* @return StripeObject Object containing the response from the API.
|
||||
*/
|
||||
public static function token($params = null, $opts = null)
|
||||
{
|
||||
$base = ($opts && array_key_exists('connect_base', $opts)) ? $opts['connect_base'] : Stripe::$connectBase;
|
||||
$requestor = new ApiRequestor(null, $base);
|
||||
list($response, $apiKey) = $requestor->request(
|
||||
'post',
|
||||
'/oauth/token',
|
||||
$params,
|
||||
null
|
||||
);
|
||||
return Util\Util::convertToStripeObject($response->json, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* Disconnects an account from your platform.
|
||||
*
|
||||
* @param array|null $params
|
||||
* @param array|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\OAuth\OAuthErrorException if the request fails
|
||||
*
|
||||
* @return StripeObject Object containing the response from the API.
|
||||
*/
|
||||
public static function deauthorize($params = null, $opts = null)
|
||||
{
|
||||
$params = $params ?: [];
|
||||
$base = ($opts && array_key_exists('connect_base', $opts)) ? $opts['connect_base'] : Stripe::$connectBase;
|
||||
$requestor = new ApiRequestor(null, $base);
|
||||
$params['client_id'] = self::_getClientId($params);
|
||||
list($response, $apiKey) = $requestor->request(
|
||||
'post',
|
||||
'/oauth/deauthorize',
|
||||
$params,
|
||||
null
|
||||
);
|
||||
return Util\Util::convertToStripeObject($response->json, $opts);
|
||||
}
|
||||
|
||||
private static function _getClientId($params = null)
|
||||
{
|
||||
$clientId = ($params && array_key_exists('client_id', $params)) ? $params['client_id'] : null;
|
||||
if ($clientId === null) {
|
||||
$clientId = Stripe::getClientId();
|
||||
}
|
||||
if ($clientId === null) {
|
||||
$msg = 'No client_id provided. (HINT: set your client_id using '
|
||||
. '"Stripe::setClientId(<CLIENT-ID>)". You can find your client_ids '
|
||||
. 'in your Stripe dashboard at '
|
||||
. 'https://dashboard.stripe.com/account/applications/settings, '
|
||||
. 'after registering your account as a platform. See '
|
||||
. 'https://stripe.com/docs/connect/standard-accounts for details, '
|
||||
. 'or email support@stripe.com if you have any questions.';
|
||||
throw new Exception\AuthenticationException($msg);
|
||||
}
|
||||
return $clientId;
|
||||
}
|
||||
}
|
||||
33
vendor/stripe-php-7.0.2/lib/OAuthErrorObject.php
vendored
Normal file
33
vendor/stripe-php-7.0.2/lib/OAuthErrorObject.php
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class OAuthErrorObject
|
||||
*
|
||||
* @property string $error
|
||||
* @property string $error_description
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class OAuthErrorObject extends StripeObject
|
||||
{
|
||||
/**
|
||||
* Refreshes this object using the provided values.
|
||||
*
|
||||
* @param array $values
|
||||
* @param null|string|array|Util\RequestOptions $opts
|
||||
* @param boolean $partial Defaults to false.
|
||||
*/
|
||||
public function refreshFrom($values, $opts, $partial = false)
|
||||
{
|
||||
// Unlike most other API resources, the API will omit attributes in
|
||||
// error objects when they have a null value. We manually set default
|
||||
// values here to facilitate generic error handling.
|
||||
$values = array_merge([
|
||||
'error' => null,
|
||||
'error_description' => null,
|
||||
], $values);
|
||||
parent::refreshFrom($values, $opts, $partial);
|
||||
}
|
||||
}
|
||||
67
vendor/stripe-php-7.0.2/lib/Order.php
vendored
Normal file
67
vendor/stripe-php-7.0.2/lib/Order.php
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class Order
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property int $amount
|
||||
* @property int $amount_returned
|
||||
* @property string $application
|
||||
* @property int $application_fee
|
||||
* @property string $charge
|
||||
* @property int $created
|
||||
* @property string $currency
|
||||
* @property string $customer
|
||||
* @property string $email
|
||||
* @property string $external_coupon_code
|
||||
* @property OrderItem[] $items
|
||||
* @property bool $livemode
|
||||
* @property StripeObject $metadata
|
||||
* @property Collection $returns
|
||||
* @property string $selected_shipping_method
|
||||
* @property mixed $shipping
|
||||
* @property array $shipping_methods
|
||||
* @property string $status
|
||||
* @property mixed $status_transitions
|
||||
* @property int $updated
|
||||
* @property string $upstream_id
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class Order extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "order";
|
||||
|
||||
use ApiOperations\All;
|
||||
use ApiOperations\Create;
|
||||
use ApiOperations\Retrieve;
|
||||
use ApiOperations\Update;
|
||||
|
||||
/**
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return Order The paid order.
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return OrderReturn The newly created return.
|
||||
*/
|
||||
public function returnOrder($params = null, $opts = null)
|
||||
{
|
||||
$url = $this->instanceUrl() . '/returns';
|
||||
list($response, $opts) = $this->_request('post', $url, $params, $opts);
|
||||
return Util\Util::convertToStripeObject($response, $opts);
|
||||
}
|
||||
}
|
||||
21
vendor/stripe-php-7.0.2/lib/OrderItem.php
vendored
Normal file
21
vendor/stripe-php-7.0.2/lib/OrderItem.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class OrderItem
|
||||
*
|
||||
* @property string $object
|
||||
* @property int $amount
|
||||
* @property string $currency
|
||||
* @property string $description
|
||||
* @property string $parent
|
||||
* @property int $quantity
|
||||
* @property string $type
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class OrderItem extends StripeObject
|
||||
{
|
||||
const OBJECT_NAME = "order_item";
|
||||
}
|
||||
26
vendor/stripe-php-7.0.2/lib/OrderReturn.php
vendored
Normal file
26
vendor/stripe-php-7.0.2/lib/OrderReturn.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class OrderReturn
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property int $amount
|
||||
* @property int $created
|
||||
* @property string $currency
|
||||
* @property OrderItem[] $items
|
||||
* @property bool $livemode
|
||||
* @property string $order
|
||||
* @property string $refund
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class OrderReturn extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "order_return";
|
||||
|
||||
use ApiOperations\All;
|
||||
use ApiOperations\Retrieve;
|
||||
}
|
||||
112
vendor/stripe-php-7.0.2/lib/PaymentIntent.php
vendored
Normal file
112
vendor/stripe-php-7.0.2/lib/PaymentIntent.php
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class PaymentIntent
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property int $amount
|
||||
* @property int $amount_capturable
|
||||
* @property int $amount_received
|
||||
* @property string $application
|
||||
* @property int $application_fee_amount
|
||||
* @property int $canceled_at
|
||||
* @property string $cancellation_reason
|
||||
* @property string $capture_method
|
||||
* @property Collection $charges
|
||||
* @property string $client_secret
|
||||
* @property string $confirmation_method
|
||||
* @property int $created
|
||||
* @property string $currency
|
||||
* @property string $customer
|
||||
* @property string $description
|
||||
* @property mixed $last_payment_error
|
||||
* @property bool $livemode
|
||||
* @property StripeObject $metadata
|
||||
* @property mixed $next_action
|
||||
* @property string $on_behalf_of
|
||||
* @property string $payment_method
|
||||
* @property string[] $payment_method_types
|
||||
* @property string $receipt_email
|
||||
* @property string $review
|
||||
* @property mixed $shipping
|
||||
* @property string $source
|
||||
* @property string $statement_descriptor
|
||||
* @property string $status
|
||||
* @property mixed $transfer_data
|
||||
* @property string $transfer_group
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class PaymentIntent extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "payment_intent";
|
||||
|
||||
use ApiOperations\All;
|
||||
use ApiOperations\Create;
|
||||
use ApiOperations\Retrieve;
|
||||
use ApiOperations\Update;
|
||||
|
||||
/**
|
||||
* These constants are possible representations of the status field.
|
||||
*
|
||||
* @link https://stripe.com/docs/api/payment_intents/object#payment_intent_object-status
|
||||
*/
|
||||
const STATUS_CANCELED = 'canceled';
|
||||
const STATUS_PROCESSING = 'processing';
|
||||
const STATUS_REQUIRES_ACTION = 'requires_action';
|
||||
const STATUS_REQUIRES_CAPTURE = 'requires_capture';
|
||||
const STATUS_REQUIRES_CONFIRMATION = 'requires_confirmation';
|
||||
const STATUS_REQUIRES_PAYMENT_METHOD = 'requires_payment_method';
|
||||
const STATUS_SUCCEEDED = 'succeeded';
|
||||
|
||||
/**
|
||||
* @param array|null $params
|
||||
* @param array|string|null $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return PaymentIntent The canceled payment intent.
|
||||
*/
|
||||
public function cancel($params = null, $options = null)
|
||||
{
|
||||
$url = $this->instanceUrl() . '/cancel';
|
||||
list($response, $opts) = $this->_request('post', $url, $params, $options);
|
||||
$this->refreshFrom($response, $opts);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array|null $params
|
||||
* @param array|string|null $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return PaymentIntent The captured payment intent.
|
||||
*/
|
||||
public function capture($params = null, $options = null)
|
||||
{
|
||||
$url = $this->instanceUrl() . '/capture';
|
||||
list($response, $opts) = $this->_request('post', $url, $params, $options);
|
||||
$this->refreshFrom($response, $opts);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array|null $params
|
||||
* @param array|string|null $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return PaymentIntent The confirmed payment intent.
|
||||
*/
|
||||
public function confirm($params = null, $options = null)
|
||||
{
|
||||
$url = $this->instanceUrl() . '/confirm';
|
||||
list($response, $opts) = $this->_request('post', $url, $params, $options);
|
||||
$this->refreshFrom($response, $opts);
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
63
vendor/stripe-php-7.0.2/lib/PaymentMethod.php
vendored
Normal file
63
vendor/stripe-php-7.0.2/lib/PaymentMethod.php
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class PaymentMethod
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property mixed $billing_details
|
||||
* @property mixed $card
|
||||
* @property mixed $card_present
|
||||
* @property int $created
|
||||
* @property string $customer
|
||||
* @property mixed $ideal
|
||||
* @property bool $livemode
|
||||
* @property StripeObject $metadata
|
||||
* @property mixed $sepa_debit
|
||||
* @property string $type
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class PaymentMethod extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "payment_method";
|
||||
|
||||
use ApiOperations\All;
|
||||
use ApiOperations\Create;
|
||||
use ApiOperations\Retrieve;
|
||||
use ApiOperations\Update;
|
||||
|
||||
/**
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return PaymentMethod The attached payment method.
|
||||
*/
|
||||
public function attach($params = null, $opts = null)
|
||||
{
|
||||
$url = $this->instanceUrl() . '/attach';
|
||||
list($response, $opts) = $this->_request('post', $url, $params, $opts);
|
||||
$this->refreshFrom($response, $opts);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array|null $params
|
||||
* @param array|string|null $opts
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return PaymentMethod The detached payment method.
|
||||
*/
|
||||
public function detach($params = null, $opts = null)
|
||||
{
|
||||
$url = $this->instanceUrl() . '/detach';
|
||||
list($response, $opts) = $this->_request('post', $url, $params, $opts);
|
||||
$this->refreshFrom($response, $opts);
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
94
vendor/stripe-php-7.0.2/lib/Payout.php
vendored
Normal file
94
vendor/stripe-php-7.0.2/lib/Payout.php
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class Payout
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property int $amount
|
||||
* @property int $arrival_date
|
||||
* @property bool $automatic
|
||||
* @property string $balance_transaction
|
||||
* @property int $created
|
||||
* @property string $currency
|
||||
* @property string $description
|
||||
* @property string $destination
|
||||
* @property string $failure_balance_transaction
|
||||
* @property string $failure_code
|
||||
* @property string $failure_message
|
||||
* @property bool $livemode
|
||||
* @property StripeObject $metadata
|
||||
* @property string $method
|
||||
* @property string $source_type
|
||||
* @property string $statement_descriptor
|
||||
* @property string $status
|
||||
* @property string $type
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class Payout extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "payout";
|
||||
|
||||
use ApiOperations\All;
|
||||
use ApiOperations\Create;
|
||||
use ApiOperations\Retrieve;
|
||||
use ApiOperations\Update;
|
||||
|
||||
/**
|
||||
* Types of payout failure codes.
|
||||
* @link https://stripe.com/docs/api#payout_failures
|
||||
*/
|
||||
const FAILURE_ACCOUNT_CLOSED = 'account_closed';
|
||||
const FAILURE_ACCOUNT_FROZEN = 'account_frozen';
|
||||
const FAILURE_BANK_ACCOUNT_RESTRICTED = 'bank_account_restricted';
|
||||
const FAILURE_BANK_OWNERSHIP_CHANGED = 'bank_ownership_changed';
|
||||
const FAILURE_COULD_NOT_PROCESS = 'could_not_process';
|
||||
const FAILURE_DEBIT_NOT_AUTHORIZED = 'debit_not_authorized';
|
||||
const FAILURE_DECLINED = 'declined';
|
||||
const FAILURE_INCORRECT_ACCOUNT_HOLDER_NAME = 'incorrect_account_holder_name';
|
||||
const FAILURE_INSUFFICIENT_FUNDS = 'insufficient_funds';
|
||||
const FAILURE_INVALID_ACCOUNT_NUMBER = 'invalid_account_number';
|
||||
const FAILURE_INVALID_CURRENCY = 'invalid_currency';
|
||||
const FAILURE_NO_ACCOUNT = 'no_account';
|
||||
const FAILURE_UNSUPPORTED_CARD = 'unsupported_card';
|
||||
|
||||
/**
|
||||
* Possible string representations of the payout methods.
|
||||
* @link https://stripe.com/docs/api/payouts/object#payout_object-method
|
||||
*/
|
||||
const METHOD_STANDARD = 'standard';
|
||||
const METHOD_INSTANT = 'instant';
|
||||
|
||||
/**
|
||||
* Possible string representations of the status of the payout.
|
||||
* @link https://stripe.com/docs/api/payouts/object#payout_object-status
|
||||
*/
|
||||
const STATUS_CANCELED = 'canceled';
|
||||
const STATUS_IN_TRANSIT = 'in_transit';
|
||||
const STATUS_FAILED = 'failed';
|
||||
const STATUS_PAID = 'paid';
|
||||
const STATUS_PENDING = 'pending';
|
||||
|
||||
/**
|
||||
* Possible string representations of the type of payout.
|
||||
* @link https://stripe.com/docs/api/payouts/object#payout_object-type
|
||||
*/
|
||||
const TYPE_BANK_ACCOUNT = 'bank_account';
|
||||
const TYPE_CARD = 'card';
|
||||
|
||||
/**
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*
|
||||
* @return Payout The canceled payout.
|
||||
*/
|
||||
public function cancel()
|
||||
{
|
||||
$url = $this->instanceUrl() . '/cancel';
|
||||
list($response, $opts) = $this->_request('post', $url);
|
||||
$this->refreshFrom($response, $opts);
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
109
vendor/stripe-php-7.0.2/lib/Person.php
vendored
Normal file
109
vendor/stripe-php-7.0.2/lib/Person.php
vendored
Normal file
@@ -0,0 +1,109 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* Possible string representations of a person's gender.
|
||||
* @link https://stripe.com/docs/api/persons/object#person_object-gender
|
||||
*/
|
||||
const GENDER_MALE = 'male';
|
||||
const GENDER_FEMALE = 'female';
|
||||
|
||||
/**
|
||||
* Possible string representations of a person's verification status.
|
||||
* @link https://stripe.com/docs/api/persons/object#person_object-verification-status
|
||||
*/
|
||||
const VERIFICATION_STATUS_PENDING = 'pending';
|
||||
const VERIFICATION_STATUS_UNVERIFIED = 'unverified';
|
||||
const VERIFICATION_STATUS_VERIFIED = 'verified';
|
||||
|
||||
/**
|
||||
* @return string The API URL for this Stripe account reversal.
|
||||
*/
|
||||
public function instanceUrl()
|
||||
{
|
||||
$id = $this['id'];
|
||||
$account = $this['account'];
|
||||
if (!$id) {
|
||||
throw new Exception\UnexpectedValueException(
|
||||
"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\Exception\BadMethodCallException
|
||||
*/
|
||||
public static function retrieve($_id, $_opts = null)
|
||||
{
|
||||
$msg = "Persons cannot be retrieved without an account ID. Retrieve " .
|
||||
"a person using `Account::retrievePerson('account_id', " .
|
||||
"'person_id')`.";
|
||||
throw new Exception\BadMethodCallException($msg, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $_id
|
||||
* @param array|null $_params
|
||||
* @param array|string|null $_options
|
||||
*
|
||||
* @throws \Stripe\Exception\BadMethodCallException
|
||||
*/
|
||||
public static function update($_id, $_params = null, $_options = null)
|
||||
{
|
||||
$msg = "Persons cannot be updated without an account ID. Update " .
|
||||
"a person using `Account::updatePerson('account_id', " .
|
||||
"'person_id', \$updateParams)`.";
|
||||
throw new Exception\BadMethodCallException($msg, null);
|
||||
}
|
||||
}
|
||||
39
vendor/stripe-php-7.0.2/lib/Plan.php
vendored
Normal file
39
vendor/stripe-php-7.0.2/lib/Plan.php
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class Plan
|
||||
*
|
||||
* @package Stripe
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property bool $active
|
||||
* @property string $aggregate_usage
|
||||
* @property int $amount
|
||||
* @property string $billing_scheme
|
||||
* @property int $created
|
||||
* @property string $currency
|
||||
* @property string $interval
|
||||
* @property int $interval_count
|
||||
* @property bool $livemode
|
||||
* @property StripeObject $metadata
|
||||
* @property string $nickname
|
||||
* @property string $product
|
||||
* @property mixed $tiers
|
||||
* @property string $tiers_mode
|
||||
* @property mixed $transform_usage
|
||||
* @property int $trial_period_days
|
||||
* @property string $usage_type
|
||||
*/
|
||||
class Plan extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "plan";
|
||||
|
||||
use ApiOperations\All;
|
||||
use ApiOperations\Create;
|
||||
use ApiOperations\Delete;
|
||||
use ApiOperations\Retrieve;
|
||||
use ApiOperations\Update;
|
||||
}
|
||||
46
vendor/stripe-php-7.0.2/lib/Product.php
vendored
Normal file
46
vendor/stripe-php-7.0.2/lib/Product.php
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class Product
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property bool $active
|
||||
* @property string[] $attributes
|
||||
* @property string $caption
|
||||
* @property int $created
|
||||
* @property string[] $deactivate_on
|
||||
* @property string $description
|
||||
* @property string[] $images
|
||||
* @property bool $livemode
|
||||
* @property StripeObject $metadata
|
||||
* @property string $name
|
||||
* @property mixed $package_dimensions
|
||||
* @property bool $shippable
|
||||
* @property string $statement_descriptor
|
||||
* @property string $type
|
||||
* @property string $unit_label
|
||||
* @property int $updated
|
||||
* @property string $url
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class Product extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "product";
|
||||
|
||||
use ApiOperations\All;
|
||||
use ApiOperations\Create;
|
||||
use ApiOperations\Delete;
|
||||
use ApiOperations\Retrieve;
|
||||
use ApiOperations\Update;
|
||||
|
||||
/**
|
||||
* Possible string representations of the type of product.
|
||||
* @link https://stripe.com/docs/api/service_products/object#service_product_object-type
|
||||
*/
|
||||
const TYPE_GOOD = 'good';
|
||||
const TYPE_SERVICE = 'service';
|
||||
}
|
||||
36
vendor/stripe-php-7.0.2/lib/Radar/EarlyFraudWarning.php
vendored
Normal file
36
vendor/stripe-php-7.0.2/lib/Radar/EarlyFraudWarning.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\Radar;
|
||||
|
||||
/**
|
||||
* Class EarlyFraudWarning
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property bool $actionable
|
||||
* @property string $charge
|
||||
* @property int $created
|
||||
* @property string $fraud_type
|
||||
* @property bool $livemode
|
||||
*
|
||||
* @package Stripe\Radar
|
||||
*/
|
||||
class EarlyFraudWarning extends \Stripe\ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "radar.early_fraud_warning";
|
||||
|
||||
use \Stripe\ApiOperations\All;
|
||||
use \Stripe\ApiOperations\Retrieve;
|
||||
|
||||
/**
|
||||
* Possible string representations of an early fraud warning's fraud type.
|
||||
* @link https://stripe.com/docs/api/early_fraud_warnings/object#early_fraud_warning_object-fraud_type
|
||||
*/
|
||||
const FRAUD_TYPE_CARD_NEVER_RECEIVED = 'card_never_received';
|
||||
const FRAUD_TYPE_FRAUDULENT_CARD_APPLICATION = 'fraudulent_card_application';
|
||||
const FRAUD_TYPE_MADE_WITH_COUNTERFEIT_CARD = 'made_with_counterfeit_card';
|
||||
const FRAUD_TYPE_MADE_WITH_LOST_CARD = 'made_with_lost_card';
|
||||
const FRAUD_TYPE_MADE_WITH_STOLEN_CARD = 'made_with_stolen_card';
|
||||
const FRAUD_TYPE_MISC = 'misc';
|
||||
const FRAUD_TYPE_UNAUTHORIZED_USE_OF_CARD = 'unauthorized_use_of_card';
|
||||
}
|
||||
32
vendor/stripe-php-7.0.2/lib/Radar/ValueList.php
vendored
Normal file
32
vendor/stripe-php-7.0.2/lib/Radar/ValueList.php
vendored
Normal file
@@ -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;
|
||||
}
|
||||
26
vendor/stripe-php-7.0.2/lib/Radar/ValueListItem.php
vendored
Normal file
26
vendor/stripe-php-7.0.2/lib/Radar/ValueListItem.php
vendored
Normal file
@@ -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;
|
||||
}
|
||||
34
vendor/stripe-php-7.0.2/lib/Recipient.php
vendored
Normal file
34
vendor/stripe-php-7.0.2/lib/Recipient.php
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class Recipient
|
||||
*
|
||||
* @package Stripe
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property mixed $active_account
|
||||
* @property Collection $cards
|
||||
* @property int $created
|
||||
* @property string $default_card
|
||||
* @property string $description
|
||||
* @property string $email
|
||||
* @property bool $livemode
|
||||
* @property StripeObject $metadata
|
||||
* @property string $migrated_to
|
||||
* @property string $name
|
||||
* @property string $rolled_back_from
|
||||
* @property string $type
|
||||
*/
|
||||
class Recipient extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "recipient";
|
||||
|
||||
use ApiOperations\All;
|
||||
use ApiOperations\Create;
|
||||
use ApiOperations\Delete;
|
||||
use ApiOperations\Retrieve;
|
||||
use ApiOperations\Update;
|
||||
}
|
||||
38
vendor/stripe-php-7.0.2/lib/RecipientTransfer.php
vendored
Normal file
38
vendor/stripe-php-7.0.2/lib/RecipientTransfer.php
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe;
|
||||
|
||||
/**
|
||||
* Class RecipientTransfer
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $object
|
||||
* @property int $amount
|
||||
* @property int $amount_reversed
|
||||
* @property string $balance_transaction
|
||||
* @property string $bank_account
|
||||
* @property string $card
|
||||
* @property int $created
|
||||
* @property string $currency
|
||||
* @property int $date
|
||||
* @property string $description
|
||||
* @property string $destination
|
||||
* @property string $failure_code
|
||||
* @property string $failure_message
|
||||
* @property bool $livemode
|
||||
* @property StripeObject $metadata
|
||||
* @property string $method
|
||||
* @property string $recipient
|
||||
* @property mixed $reversals
|
||||
* @property bool $reversed
|
||||
* @property string $source_type
|
||||
* @property string $statement_descriptor
|
||||
* @property string $status
|
||||
* @property string $type
|
||||
*
|
||||
* @package Stripe
|
||||
*/
|
||||
class RecipientTransfer extends ApiResource
|
||||
{
|
||||
const OBJECT_NAME = "recipient_transfer";
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user