Diff: STRATO-apps/wordpress_03/app/wp-content/plugins/tutor-stripe/vendor/stripe/stripe-php/lib/File.php

Keine Baseline-Datei – Diff nur gegen leer.
Zur Liste
1 -
1 + <?php
2 +
3 + // File generated from our OpenAPI spec
4 +
5 + namespace Stripe;
6 +
7 + /**
8 + * This object represents files hosted on Stripe's servers. You can upload
9 + * files with the <a href="https://stripe.com/docs/api#create_file">create file</a> request
10 + * (for example, when uploading dispute evidence). Stripe also
11 + * creates files independently (for example, the results of a <a href="#scheduled_queries">Sigma scheduled
12 + * query</a>).
13 + *
14 + * Related guide: <a href="https://stripe.com/docs/file-upload">File upload guide</a>
15 + *
16 + * @property string $id Unique identifier for the object.
17 + * @property string $object String representing the object's type. Objects of the same type share the same value.
18 + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
19 + * @property null|int $expires_at The file expires and isn't available at this time in epoch seconds.
20 + * @property null|string $filename The suitable name for saving the file to a filesystem.
21 + * @property null|Collection<FileLink> $links A list of <a href="https://stripe.com/docs/api#file_links">file links</a> that point at this file.
22 + * @property string $purpose The <a href="https://stripe.com/docs/file-upload#uploading-a-file">purpose</a> of the uploaded file.
23 + * @property int $size The size of the file object in bytes.
24 + * @property null|string $title A suitable title for the document.
25 + * @property null|string $type The returned file type (for example, <code>csv</code>, <code>pdf</code>, <code>jpg</code>, or <code>png</code>).
26 + * @property null|string $url Use your live secret API key to download the file from this URL.
27 + */
28 + class File extends ApiResource
29 + {
30 + const OBJECT_NAME = 'file';
31 +
32 + const PURPOSE_ACCOUNT_REQUIREMENT = 'account_requirement';
33 + const PURPOSE_ADDITIONAL_VERIFICATION = 'additional_verification';
34 + const PURPOSE_BUSINESS_ICON = 'business_icon';
35 + const PURPOSE_BUSINESS_LOGO = 'business_logo';
36 + const PURPOSE_CUSTOMER_SIGNATURE = 'customer_signature';
37 + const PURPOSE_DISPUTE_EVIDENCE = 'dispute_evidence';
38 + const PURPOSE_DOCUMENT_PROVIDER_IDENTITY_DOCUMENT = 'document_provider_identity_document';
39 + const PURPOSE_FINANCE_REPORT_RUN = 'finance_report_run';
40 + const PURPOSE_FINANCIAL_ACCOUNT_STATEMENT = 'financial_account_statement';
41 + const PURPOSE_IDENTITY_DOCUMENT = 'identity_document';
42 + const PURPOSE_IDENTITY_DOCUMENT_DOWNLOADABLE = 'identity_document_downloadable';
43 + const PURPOSE_ISSUING_REGULATORY_REPORTING = 'issuing_regulatory_reporting';
44 + const PURPOSE_PCI_DOCUMENT = 'pci_document';
45 + const PURPOSE_SELFIE = 'selfie';
46 + const PURPOSE_SIGMA_SCHEDULED_QUERY = 'sigma_scheduled_query';
47 + const PURPOSE_TAX_DOCUMENT_USER_UPLOAD = 'tax_document_user_upload';
48 + const PURPOSE_TERMINAL_ANDROID_APK = 'terminal_android_apk';
49 + const PURPOSE_TERMINAL_READER_SPLASHSCREEN = 'terminal_reader_splashscreen';
50 +
51 + /**
52 + * Returns a list of the files that your account has access to. Stripe sorts and
53 + * returns the files by their creation dates, placing the most recently created
54 + * files at the top.
55 + *
56 + * @param null|array{created?: array|int, ending_before?: string, expand?: string[], limit?: int, purpose?: string, starting_after?: string} $params
57 + * @param null|array|string $opts
58 + *
59 + * @return Collection<File> of ApiResources
60 + *
61 + * @throws Exception\ApiErrorException if the request fails
62 + */
63 + public static function all($params = null, $opts = null)
64 + {
65 + $url = static::classUrl();
66 +
67 + return static::_requestPage($url, Collection::class, $params, $opts);
68 + }
69 +
70 + /**
71 + * Retrieves the details of an existing file object. After you supply a unique file
72 + * ID, Stripe returns the corresponding file object. Learn how to <a
73 + * href="/docs/file-upload#download-file-contents">access file contents</a>.
74 + *
75 + * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
76 + * @param null|array|string $opts
77 + *
78 + * @return File
79 + *
80 + * @throws Exception\ApiErrorException if the request fails
81 + */
82 + public static function retrieve($id, $opts = null)
83 + {
84 + $opts = Util\RequestOptions::parse($opts);
85 + $instance = new static($id, $opts);
86 + $instance->refresh();
87 +
88 + return $instance;
89 + }
90 +
91 + // This resource can have two different object names. In latter API
92 + // versions, only `file` is used, but since stripe-php may be used with
93 + // any API version, we need to support deserializing the older
94 + // `file_upload` object into the same class.
95 + const OBJECT_NAME_ALT = 'file_upload';
96 +
97 + use ApiOperations\Create {
98 + create as protected _create;
99 + }
100 +
101 + /**
102 + * @param null|array $params
103 + * @param null|array|string $opts
104 + *
105 + * @return File the created file
106 + *
107 + * @throws Exception\ApiErrorException if the request fails
108 + */
109 + public static function create($params = null, $opts = null)
110 + {
111 + $opts = Util\RequestOptions::parse($opts);
112 + if (null === $opts->apiBase) {
113 + $opts->apiBase = Stripe::$apiUploadBase;
114 + }
115 + // Manually flatten params, otherwise curl's multipart encoder will
116 + // choke on nested arrays.
117 + $flatParams = \array_column(Util\Util::flattenParams($params), 1, 0);
118 +
119 + return static::_create($flatParams, $opts);
120 + }
121 + }
122 +