Server IP : 213.176.29.180 / Your IP : 18.188.245.104 Web Server : Apache System : Linux 213.176.29.180.hostiran.name 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64 User : webtaragh ( 1001) PHP Version : 8.3.14 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0750) : /home/webtaragh/public_html/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
PK ̤$Zu�� � stripe-php/update_certs.phpnu �[��� #!/usr/bin/env php <?php \chdir(__DIR__); \set_time_limit(0); // unlimited max execution time $fp = \fopen(__DIR__ . '/data/ca-certificates.crt', 'w+b'); $options = [ \CURLOPT_FILE => $fp, \CURLOPT_TIMEOUT => 3600, \CURLOPT_URL => 'https://curl.haxx.se/ca/cacert.pem', ]; $ch = \curl_init(); \curl_setopt_array($ch, $options); \curl_exec($ch); \curl_close($ch); \fclose($fp); PK ̤$Zȁ@&( ( stripe-php/CODE_OF_CONDUCT.mdnu �[��� # Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies within all project spaces, and it also applies when an individual is representing the project or its community in public spaces. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at conduct@stripe.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html [homepage]: https://www.contributor-covenant.org For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq PK ̤$ZK�͕_( _( stripe-php/README.mdnu �[��� # Stripe PHP bindings [![Build Status](https://travis-ci.org/stripe/stripe-php.svg?branch=master)](https://travis-ci.org/stripe/stripe-php) [![Latest Stable Version](https://poser.pugx.org/stripe/stripe-php/v/stable.svg)](https://packagist.org/packages/stripe/stripe-php) [![Total Downloads](https://poser.pugx.org/stripe/stripe-php/downloads.svg)](https://packagist.org/packages/stripe/stripe-php) [![License](https://poser.pugx.org/stripe/stripe-php/license.svg)](https://packagist.org/packages/stripe/stripe-php) [![Code Coverage](https://coveralls.io/repos/stripe/stripe-php/badge.svg?branch=master)](https://coveralls.io/r/stripe/stripe-php?branch=master) The Stripe PHP library provides convenient access to the Stripe API from applications written in the PHP language. It includes a pre-defined set of 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 = new \Stripe\StripeClient('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); $customer = $stripe->customers->create([ 'description' => 'example customer', 'email' => 'email@example.com', 'payment_method' => 'pm_card_visa', ]); echo $customer; ``` ## 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. ## 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 $customer = $stripe->customers->create([ 'description' => 'example customer', ]); echo $customer->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 $customers = $stripe->customers->all([],[ 'api_key' => 'sk_test_...', 'stripe_account' => 'acct_...' ]); $stripe->customers->retrieve('cus_123456789', [], [ '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 PK ̤$ZC9�Y stripe-php/VERSIONnu �[��� 7.34.0 PK ̤$Z� /� � $ stripe-php/lib/IssuerFraudRecord.phpnu �[��� <?php namespace Stripe; /** * Class IssuerFraudRecord * * @property string $id * @property string $object * @property string $charge * @property int $created * @property int $post_date * @property string $fraud_type * @property bool $livemode * * @package Stripe */ class IssuerFraudRecord extends ApiResource { const OBJECT_NAME = "issuer_fraud_record"; use ApiOperations\All; use ApiOperations\Retrieve; } PK ̤$Z�s)� � stripe-php/lib/LoginLink.phpnu �[��� <?php namespace Stripe; /** * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $url The URL for the login link. */ class LoginLink extends ApiResource { const OBJECT_NAME = 'login_link'; } PK ̤$ZFIn stripe-php/lib/EphemeralKey.phpnu �[��� <?php namespace Stripe; /** * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property int $expires Time at which the key will expire. Measured in seconds since the Unix epoch. * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode. * @property string $secret The key's secret. You can use this value to make authorized requests to the Stripe API. * @property array $associated_objects */ class EphemeralKey extends ApiResource { const OBJECT_NAME = 'ephemeral_key'; use ApiOperations\Delete; use ApiOperations\Create { create as protected _create; } /** * @param null|array $params * @param null|array|string $opts * * @throws \Stripe\Exception\InvalidArgumentException if stripe_version is missing * @throws \Stripe\Exception\ApiErrorException if the request fails * * @return \Stripe\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); } } PK ̤$ZEc7ޚ � stripe-php/lib/FileUpload.phpnu �[��� <?php namespace Stripe; // For backwards compatibility, the `File` class is aliased to `FileUpload`. class_alias('Stripe\\File', 'Stripe\\FileUpload'); PK ̤$ZB�Ъ � stripe-php/lib/UsageRecord.phpnu �[��� <?php namespace Stripe; /** * Usage records allow you to report customer usage and metrics to Stripe for * metered billing of subscription plans. * * Related guide: <a * href="https://stripe.com/docs/billing/subscriptions/metered-billing">Metered * Billing</a>. * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode. * @property int $quantity The usage quantity for the specified date. * @property string $subscription_item The ID of the subscription item this usage record contains data for. * @property int $timestamp The timestamp when this usage occurred. */ class UsageRecord extends ApiResource { const OBJECT_NAME = 'usage_record'; } PK ̤$Zå_�� � stripe-php/lib/SKU.phpnu �[��� <?php namespace Stripe; /** * Stores representations of <a * href="http://en.wikipedia.org/wiki/Stock_keeping_unit">stock keeping units</a>. * SKUs describe specific product variations, taking into account any combination * of: attributes, currency, and cost. For example, a product may be a T-shirt, * whereas a specific SKU represents the <code>size: large</code>, <code>color: * red</code> version of that shirt. * * Can also be used to manage inventory. * * Related guide: <a href="https://stripe.com/docs/orders">Tax, Shipping, and * Inventory</a>. * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property bool $active Whether the SKU is available for purchase. * @property \Stripe\StripeObject $attributes A dictionary of attributes and values for the attributes defined by the product. If, for example, a product's attributes are <code>["size", "gender"]</code>, a valid SKU has the following dictionary of attributes: <code>{"size": "Medium", "gender": "Unisex"}</code>. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>. * @property null|string $image The URL of an image for this SKU, meant to be displayable to the customer. * @property \Stripe\StripeObject $inventory * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|\Stripe\StripeObject $package_dimensions The dimensions of this SKU for shipping purposes. * @property int $price The cost of the item as a positive integer in the smallest currency unit (that is, 100 cents to charge $1.00, or 100 to charge ¥100, Japanese Yen being a zero-decimal currency). * @property string|\Stripe\Product $product The ID of the product this SKU is associated with. The product must be currently active. * @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. */ class SKU extends ApiResource { const OBJECT_NAME = 'sku'; use ApiOperations\All; use ApiOperations\Create; use ApiOperations\Delete; use ApiOperations\Retrieve; use ApiOperations\Update; } PK ̤$Z�C ] ] # stripe-php/lib/OAuthErrorObject.phpnu �[��� <?php namespace Stripe; /** * Class OAuthErrorObject. * * @property string $error * @property string $error_description */ class OAuthErrorObject extends StripeObject { /** * Refreshes this object using the provided values. * * @param array $values * @param null|array|string|Util\RequestOptions $opts * @param bool $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); } } PK ̤$Z�f71 71 stripe-php/lib/Customer.phpnu �[��� <?php namespace Stripe; /** * <code>Customer</code> objects allow you to perform recurring charges, and to * track multiple charges, that are associated with the same customer. The API * allows you to create, delete, and update your customers. You can retrieve * individual customers as well as a list of all your customers. * * Related guide: <a * href="https://stripe.com/docs/payments/save-during-payment">Save a card during * payment</a>. * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property null|\Stripe\StripeObject $address The customer's address. * @property int $balance Current balance, if any, being stored on the customer. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that will be added to their next invoice. The balance does not refer to any unpaid invoices; it solely takes into account amounts that have yet to be successfully applied to any invoice. This balance is only taken into account as invoices are finalized. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string $currency Three-letter <a href="https://stripe.com/docs/currencies">ISO code for the currency</a> the customer can be charged in for recurring billing purposes. * @property null|string|\Stripe\StripeObject $default_source <p>ID of the default payment source for the customer.</p><p>If you are using payment methods created via the PaymentMethods API, see the <a href="https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method">invoice_settings.default_payment_method</a> field instead.</p> * @property null|bool $delinquent When the customer's latest invoice is billed by charging automatically, delinquent is true if the invoice's latest charge is failed. When the customer's latest invoice is billed by sending an invoice, delinquent is true if the invoice is not paid by its due date. * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. * @property null|\Stripe\Discount $discount Describes the current discount active on the customer, if there is one. * @property null|string $email The customer's email address. * @property null|string $invoice_prefix The prefix for the customer used to generate unique invoice numbers. * @property \Stripe\StripeObject $invoice_settings * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $name The customer's full name or business name. * @property int $next_invoice_sequence The suffix of the customer's next invoice number, e.g., 0001. * @property null|string $phone The customer's phone number. * @property null|string[] $preferred_locales The customer's preferred locales (languages), ordered by preference. * @property null|\Stripe\StripeObject $shipping Mailing and shipping address for the customer. Appears on invoices emailed to this customer. * @property \Stripe\Collection $sources The customer's payment sources, if any. * @property \Stripe\Collection $subscriptions The customer's current subscriptions, if any. * @property null|string $tax_exempt Describes the customer's tax exemption status. One of <code>none</code>, <code>exempt</code>, or <code>reverse</code>. When set to <code>reverse</code>, invoice and receipt PDFs include the text <strong>"Reverse charge"</strong>. * @property \Stripe\Collection $tax_ids The customer's tax IDs. */ 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; const TAX_EXEMPT_EXEMPT = 'exempt'; const TAX_EXEMPT_NONE = 'none'; const TAX_EXEMPT_REVERSE = 'reverse'; public static function getSavedNestedResources() { static $savedNestedResources = null; if (null === $savedNestedResources) { $savedNestedResources = new Util\Set([ 'source', ]); } return $savedNestedResources; } /** * @param null|array $params * @param null|array|string $opts * * @return \Stripe\Customer the updated customer */ public function deleteDiscount($params = null, $opts = null) { $url = $this->instanceUrl() . '/discount'; list($response, $opts) = $this->_request('delete', $url, $params, $opts); $this->refreshFrom(['discount' => null], $opts, true); } const PATH_BALANCE_TRANSACTIONS = '/balance_transactions'; /** * @param string $id the ID of the customer on which to retrieve the customer balance transactions * @param null|array $params * @param null|array|string $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * * @return \Stripe\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); } /** * @param string $id the ID of the customer on which to create the customer balance transaction * @param null|array $params * @param null|array|string $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * * @return \Stripe\CustomerBalanceTransaction */ public static function createBalanceTransaction($id, $params = null, $opts = null) { return self::_createNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $params, $opts); } /** * @param string $id the ID of the customer to which the customer balance transaction belongs * @param string $balanceTransactionId the ID of the customer balance transaction to retrieve * @param null|array $params * @param null|array|string $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * * @return \Stripe\CustomerBalanceTransaction */ public static function retrieveBalanceTransaction($id, $balanceTransactionId, $params = null, $opts = null) { return self::_retrieveNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts); } /** * @param string $id the ID of the customer to which the customer balance transaction belongs * @param string $balanceTransactionId the ID of the customer balance transaction to update * @param null|array $params * @param null|array|string $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * * @return \Stripe\CustomerBalanceTransaction */ public static function updateBalanceTransaction($id, $balanceTransactionId, $params = null, $opts = null) { return self::_updateNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts); } const PATH_SOURCES = '/sources'; /** * @param string $id the ID of the customer on which to retrieve the payment sources * @param null|array $params * @param null|array|string $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * * @return \Stripe\Collection the list of payment sources (AlipayAccount, BankAccount, BitcoinReceiver, Card or Source) */ public static function allSources($id, $params = null, $opts = null) { return self::_allNestedResources($id, static::PATH_SOURCES, $params, $opts); } /** * @param string $id the ID of the customer on which to create the payment source * @param null|array $params * @param null|array|string $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source */ public static function createSource($id, $params = null, $opts = null) { return self::_createNestedResource($id, static::PATH_SOURCES, $params, $opts); } /** * @param string $id the ID of the customer to which the payment source belongs * @param string $sourceId the ID of the payment source to delete * @param null|array $params * @param null|array|string $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source */ public static function deleteSource($id, $sourceId, $params = null, $opts = null) { return self::_deleteNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts); } /** * @param string $id the ID of the customer to which the payment source belongs * @param string $sourceId the ID of the payment source to retrieve * @param null|array $params * @param null|array|string $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source */ public static function retrieveSource($id, $sourceId, $params = null, $opts = null) { return self::_retrieveNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts); } /** * @param string $id the ID of the customer to which the payment source belongs * @param string $sourceId the ID of the payment source to update * @param null|array $params * @param null|array|string $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source */ public static function updateSource($id, $sourceId, $params = null, $opts = null) { return self::_updateNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts); } const PATH_TAX_IDS = '/tax_ids'; /** * @param string $id the ID of the customer on which to retrieve the tax ids * @param null|array $params * @param null|array|string $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * * @return \Stripe\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 $id the ID of the customer on which to create the tax id * @param null|array $params * @param null|array|string $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * * @return \Stripe\TaxId */ public static function createTaxId($id, $params = null, $opts = null) { return self::_createNestedResource($id, static::PATH_TAX_IDS, $params, $opts); } /** * @param string $id the ID of the customer to which the tax id belongs * @param string $taxIdId the ID of the tax id to delete * @param null|array $params * @param null|array|string $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * * @return \Stripe\TaxId */ public static function deleteTaxId($id, $taxIdId, $params = null, $opts = null) { return self::_deleteNestedResource($id, static::PATH_TAX_IDS, $taxIdId, $params, $opts); } /** * @param string $id the ID of the customer to which the tax id belongs * @param string $taxIdId the ID of the tax id to retrieve * @param null|array $params * @param null|array|string $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * * @return \Stripe\TaxId */ public static function retrieveTaxId($id, $taxIdId, $params = null, $opts = null) { return self::_retrieveNestedResource($id, static::PATH_TAX_IDS, $taxIdId, $params, $opts); } } PK ̤$Z'��n�! �! stripe-php/lib/ErrorObject.phpnu �[��� <?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`. */ class ErrorObject extends StripeObject { /** * Possible string representations of an error's code. * * @see 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|array|string|Util\RequestOptions $opts * @param bool $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); } } PK ̤$Z����� � % stripe-php/lib/CreditNoteLineItem.phpnu �[��� <?php namespace Stripe; /** * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $amount The integer amount in <strong>%s</strong> representing the gross amount being credited for this line item, excluding (exclusive) tax and discounts. * @property null|string $description Description of the item being credited. * @property int $discount_amount The integer amount in <strong>%s</strong> representing the discount being credited for this line item. * @property string $invoice_line_item ID of the invoice line item being credited * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode. * @property null|int $quantity The number of units of product being credited. * @property \Stripe\StripeObject[] $tax_amounts The amount of tax calculated per tax rate for this line item * @property \Stripe\TaxRate[] $tax_rates The tax rates which apply to the line item. * @property string $type The type of the credit note line item, one of <code>invoice_line_item</code> or <code>custom_line_item</code>. When the type is <code>invoice_line_item</code> there is an additional <code>invoice_line_item</code> property on the resource the value of which is the id of the credited line item on the invoice. * @property null|int $unit_amount The cost of each unit of product being credited. * @property null|string $unit_amount_decimal Same as <code>unit_amount</code>, but contains a decimal value with at most 12 decimal places. */ class CreditNoteLineItem extends ApiResource { const OBJECT_NAME = 'credit_note_line_item'; } PK ̤$Zc�N� # stripe-php/lib/WebhookSignature.phpnu �[��� <?php namespace Stripe; abstract class WebhookSignature { const EXPECTED_SCHEME = 'v1'; /** * Verifies the signature header sent by Stripe. Throws an * Exception\SignatureVerificationException exception if the verification fails for * any reason. * * @param string $payload the payload sent by Stripe * @param string $header the contents of the signature header sent by * Stripe * @param string $secret secret used to generate the signature * @param int $tolerance maximum difference allowed between the header's * timestamp and the current time * * @throws Exception\SignatureVerificationException if the verification fails * * @return bool */ public static function verifyHeader($payload, $header, $secret, $tolerance = null) { // Extract timestamp and signatures from header $timestamp = self::getTimestamp($header); $signatures = self::getSignatures($header, self::EXPECTED_SCHEME); if (-1 === $timestamp) { throw Exception\SignatureVerificationException::factory( 'Unable to extract timestamp and signatures from header', $payload, $header ); } if (empty($signatures)) { throw Exception\SignatureVerificationException::factory( 'No signatures found with expected scheme', $payload, $header ); } // Check if expected signature is found in list of signatures from // header $signedPayload = "{$timestamp}.{$payload}"; $expectedSignature = self::computeSignature($signedPayload, $secret); $signatureFound = false; foreach ($signatures as $signature) { if (Util\Util::secureCompare($expectedSignature, $signature)) { $signatureFound = true; break; } } if (!$signatureFound) { throw Exception\SignatureVerificationException::factory( 'No signatures found matching the expected signature for payload', $payload, $header ); } // Check if timestamp is within tolerance if (($tolerance > 0) && (\abs(\time() - $timestamp) > $tolerance)) { throw Exception\SignatureVerificationException::factory( 'Timestamp outside the tolerance zone', $payload, $header ); } return true; } /** * Extracts the timestamp in a signature header. * * @param string $header the signature header * * @return int the timestamp contained in the header, or -1 if no valid * timestamp is found */ private static function getTimestamp($header) { $items = \explode(',', $header); foreach ($items as $item) { $itemParts = \explode('=', $item, 2); if ('t' === $itemParts[0]) { if (!\is_numeric($itemParts[1])) { return -1; } return (int) ($itemParts[1]); } } return -1; } /** * Extracts the signatures matching a given scheme in a signature header. * * @param string $header the signature header * @param string $scheme the signature scheme to look for * * @return array the list of signatures matching the provided scheme */ private static function getSignatures($header, $scheme) { $signatures = []; $items = \explode(',', $header); foreach ($items as $item) { $itemParts = \explode('=', $item, 2); if ($itemParts[0] === $scheme) { \array_push($signatures, $itemParts[1]); } } return $signatures; } /** * Computes the signature for a given payload and secret. * * The current scheme used by Stripe ("v1") is HMAC/SHA-256. * * @param string $payload the payload to sign * @param string $secret the secret used to generate the signature * * @return string the signature as a string */ private static function computeSignature($payload, $secret) { return \hash_hmac('sha256', $payload, $secret); } } PK ̤$Z�\ep p stripe-php/lib/OrderReturn.phpnu �[��� <?php namespace Stripe; /** * A return represents the full or partial return of a number of <a * href="https://stripe.com/docs/api#order_items">order items</a>. Returns always * belong to an order, and may optionally contain a refund. * * Related guide: <a * href="https://stripe.com/docs/orders/guide#handling-returns">Handling * Returns</a>. * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $amount A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the returned line item. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>. * @property \Stripe\OrderItem[] $items The items included in this order return. * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode. * @property null|string|\Stripe\Order $order The order that this return includes items from. * @property null|string|\Stripe\Refund $refund The ID of the refund issued for this return. */ class OrderReturn extends ApiResource { const OBJECT_NAME = 'order_return'; use ApiOperations\All; use ApiOperations\Retrieve; } PK ̤$Zt�P P stripe-php/lib/SetupIntent.phpnu �[��� <?php namespace Stripe; /** * A SetupIntent guides you through the process of setting up and saving a * customer's payment credentials for future payments. For example, you could use a * SetupIntent to set up and save your customer's card without immediately * collecting a payment. Later, you can use <a * href="https://stripe.com/docs/api#payment_intents">PaymentIntents</a> to drive * the payment flow. * * Create a SetupIntent as soon as you're ready to collect your customer's payment * credentials. Do not maintain long-lived, unconfirmed SetupIntents as they may no * longer be valid. The SetupIntent then transitions through multiple <a * href="https://stripe.com/docs/payments/intents#intent-statuses">statuses</a> as * it guides you through the setup process. * * Successful SetupIntents result in payment credentials that are optimized for * future payments. For example, cardholders in <a * href="/guides/strong-customer-authentication">certain regions</a> may need to be * run through <a * href="https://stripe.com/docs/strong-customer-authentication">Strong Customer * Authentication</a> at the time of payment method collection in order to * streamline later <a * href="https://stripe.com/docs/payments/setup-intents">off-session payments</a>. * If the SetupIntent is used with a <a * href="https://stripe.com/docs/api#setup_intent_object-customer">Customer</a>, * upon success, it will automatically attach the resulting payment method to that * Customer. We recommend using SetupIntents or <a * href="https://stripe.com/docs/api#payment_intent_object-setup_future_usage">setup_future_usage</a> * on PaymentIntents to save payment methods in order to prevent saving invalid or * unoptimized payment methods. * * By using SetupIntents, you ensure that your customers experience the minimum set * of required friction, even as regulations change over time. * * Related guide: <a href="https://stripe.com/docs/payments/setup-intents">Setup * Intents API</a>. * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property null|string|\Stripe\StripeObject $application ID of the Connect application that created the SetupIntent. * @property null|string $cancellation_reason Reason for cancellation of this SetupIntent, one of <code>abandoned</code>, <code>requested_by_customer</code>, or <code>duplicate</code>. * @property null|string $client_secret <p>The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.</p><p>The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.</p> * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string|\Stripe\Customer $customer <p>ID of the Customer this SetupIntent belongs to, if one exists.</p><p>If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent.</p> * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. * @property null|\Stripe\ErrorObject $last_setup_error The error encountered in the previous SetupIntent confirmation. * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode. * @property null|string|\Stripe\Mandate $mandate ID of the multi use Mandate generated by the SetupIntent. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|\Stripe\StripeObject $next_action If present, this property tells you what actions you need to take in order for your customer to continue payment setup. * @property null|string|\Stripe\Account $on_behalf_of The account (if any) for which the setup is intended. * @property null|string|\Stripe\PaymentMethod $payment_method ID of the payment method used with this SetupIntent. * @property null|\Stripe\StripeObject $payment_method_options Payment-method-specific configuration for this SetupIntent. * @property string[] $payment_method_types The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. * @property null|string|\Stripe\Mandate $single_use_mandate ID of the single_use Mandate generated by the SetupIntent. * @property string $status <a href="https://stripe.com/docs/payments/intents#intent-statuses">Status</a> of this SetupIntent, one of <code>requires_payment_method</code>, <code>requires_confirmation</code>, <code>requires_action</code>, <code>processing</code>, <code>canceled</code>, or <code>succeeded</code>. * @property string $usage <p>Indicates how the payment method is intended to be used in the future.</p><p>Use <code>on_session</code> if you intend to only reuse the payment method when the customer is in your checkout flow. Use <code>off_session</code> if your customer may or may not be in your checkout flow. If not provided, this value defaults to <code>off_session</code>.</p> */ class SetupIntent extends ApiResource { const OBJECT_NAME = 'setup_intent'; use ApiOperations\All; use ApiOperations\Create; use ApiOperations\Retrieve; use ApiOperations\Update; const STATUS_CANCELED = 'canceled'; const STATUS_PROCESSING = 'processing'; const STATUS_REQUIRES_ACTION = 'requires_action'; const STATUS_REQUIRES_CONFIRMATION = 'requires_confirmation'; const STATUS_REQUIRES_PAYMENT_METHOD = 'requires_payment_method'; const STATUS_SUCCEEDED = 'succeeded'; /** * @param null|array $params * @param null|array|string $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * * @return SetupIntent the canceled setup intent */ public function cancel($params = null, $opts = null) { $url = $this->instanceUrl() . '/cancel'; list($response, $opts) = $this->_request('post', $url, $params, $opts); $this->refreshFrom($response, $opts); return $this; } /** * @param null|array $params * @param null|array|string $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * * @return SetupIntent the confirmed setup intent */ public function confirm($params = null, $opts = null) { $url = $this->instanceUrl() . '/confirm'; list($response, $opts) = $this->_request('post', $url, $params, $opts); $this->refreshFrom($response, $opts); return $this; } } PK ̤$Zط�L� � ( stripe-php/lib/Issuing/Authorization.phpnu �[��� <?php namespace Stripe\Issuing; /** * When an <a href="https://stripe.com/docs/issuing">issued card</a> is used to * make a purchase, an Issuing <code>Authorization</code> object is created. <a * href="https://stripe.com/docs/issuing/purchases/authorizations">Authorizations</a> * must be approved for the purchase to be completed successfully. * * Related guide: <a * href="https://stripe.com/docs/issuing/purchases/authorizations">Issued Card * Authorizations</a>. * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $amount The total amount that was authorized or rejected. This amount is in the card's currency and in the <a href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a>. * @property bool $approved Whether the authorization has been approved. * @property string $authorization_method How the card details were provided. * @property \Stripe\BalanceTransaction[] $balance_transactions List of balance transactions associated with this authorization. * @property \Stripe\Issuing\Card $card You can <a href="https://stripe.com/docs/issuing/cards">create physical or virtual cards</a> that are issued to cardholders. * @property null|string|\Stripe\Issuing\Cardholder $cardholder The cardholder to whom this authorization belongs. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>. * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode. * @property int $merchant_amount The total amount that was authorized or rejected. This amount is in the <code>merchant_currency</code> and in the <a href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a>. * @property string $merchant_currency The currency that was presented to the cardholder for the authorization. Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>. * @property \Stripe\StripeObject $merchant_data * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|\Stripe\StripeObject $pending_request The pending authorization request. This field will only be non-null during an <code>issuing_authorization.request</code> webhook. * @property \Stripe\StripeObject[] $request_history History of every time the authorization was approved/denied (whether approved/denied by you directly or by Stripe based on your <code>spending_controls</code>). If the merchant changes the authorization by performing an <a href="https://stripe.com/docs/issuing/purchases/authorizations">incremental authorization or partial capture</a>, you can look at this field to see the previous states of the authorization. * @property string $status The current status of the authorization in its lifecycle. * @property \Stripe\Issuing\Transaction[] $transactions List of <a href="https://stripe.com/docs/api/issuing/transactions">transactions</a> associated with this authorization. * @property \Stripe\StripeObject $verification_data * @property null|string $wallet What, if any, digital wallet was used for this authorization. One of <code>apple_pay</code>, <code>google_pay</code>, or <code>samsung_pay</code>. */ class Authorization extends \Stripe\ApiResource { const OBJECT_NAME = 'issuing.authorization'; use \Stripe\ApiOperations\All; use \Stripe\ApiOperations\Retrieve; use \Stripe\ApiOperations\Update; /** * @param null|array $params * @param null|array|string $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * * @return Authorization the approved authorization */ public function approve($params = null, $opts = null) { $url = $this->instanceUrl() . '/approve'; list($response, $opts) = $this->_request('post', $url, $params, $opts); $this->refreshFrom($response, $opts); return $this; } /** * @param null|array $params * @param null|array|string $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * * @return Authorization the declined authorization */ public function decline($params = null, $opts = null) { $url = $this->instanceUrl() . '/decline'; list($response, $opts) = $this->_request('post', $url, $params, $opts); $this->refreshFrom($response, $opts); return $this; } } PK ̤$Z��� � stripe-php/lib/Issuing/Card.phpnu �[��� <?php namespace Stripe\Issuing; /** * You can <a href="https://stripe.com/docs/issuing/cards">create physical or * virtual cards</a> that are issued to cardholders. * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property string $brand The brand of the card. * @property null|string $cancellation_reason The reason why the card was canceled. * @property \Stripe\Issuing\Cardholder $cardholder <p>An Issuing <code>Cardholder</code> object represents an individual or business entity who is <a href="https://stripe.com/docs/issuing">issued</a> cards.</p><p>Related guide: <a href="https://stripe.com/docs/issuing/cards#create-cardholder">How to create a Cardholder</a></p> * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>. * @property string $cvc The card's CVC. For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with <a href="https://stripe.com/docs/api/expanding_objects">the <code>expand</code> parameter</a>. Additionally, it's only available via the <a href="https://stripe.com/docs/api/issuing/cards/retrieve">"Retrieve a card" endpoint</a>, not via "List all cards" or any other endpoint. * @property int $exp_month The expiration month of the card. * @property int $exp_year The expiration year of the card. * @property string $last4 The last 4 digits of the card number. * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $number The full unredacted card number. For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with <a href="https://stripe.com/docs/api/expanding_objects">the <code>expand</code> parameter</a>. Additionally, it's only available via the <a href="https://stripe.com/docs/api/issuing/cards/retrieve">"Retrieve a card" endpoint</a>, not via "List all cards" or any other endpoint. * @property null|string|\Stripe\Issuing\Card $replaced_by The latest card that replaces this card, if any. * @property null|string|\Stripe\Issuing\Card $replacement_for The card this card replaces, if any. * @property null|string $replacement_reason The reason why the previous card needed to be replaced. * @property null|\Stripe\StripeObject $shipping Where and how the card will be shipped. * @property \Stripe\StripeObject $spending_controls * @property string $status Whether authorizations can be approved on this card. * @property string $type The type of the card. */ 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 null|array $params * @param null|array|string $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * * @return \Stripe\Issuing\CardDetails the card details associated with that issuing card */ public function details($params = null, $opts = null) { $url = $this->instanceUrl() . '/details'; list($response, $opts) = $this->_request('get', $url, $params, $opts); $obj = \Stripe\Util\Util::convertToStripeObject($response, $opts); $obj->setLastResponse($response); return $obj; } } PK ̤$Z��&�Q Q &