PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 2.4.6
Booking for Appointments and Events Calendar – Amelia v2.4.6
2.4.7 2.4.6 2.4.5 2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / vendor / stripe / stripe-php / lib / Source.php
ameliabooking / vendor / stripe / stripe-php / lib Last commit date
ApiOperations 7 months ago Apps 7 months ago Billing 7 months ago BillingPortal 7 months ago Checkout 7 months ago Climate 7 months ago Entitlements 7 months ago EventData 7 months ago Events 7 months ago Exception 7 months ago FinancialConnections 7 months ago Forwarding 7 months ago HttpClient 7 months ago Identity 7 months ago Issuing 7 months ago Radar 7 months ago Reporting 7 months ago Service 7 months ago Sigma 7 months ago Tax 7 months ago Terminal 7 months ago TestHelpers 7 months ago Treasury 7 months ago Util 7 months ago V2 7 months ago Account.php 7 months ago AccountLink.php 7 months ago AccountSession.php 7 months ago ApiRequestor.php 7 months ago ApiResource.php 7 months ago ApiResponse.php 7 months ago ApplePayDomain.php 7 months ago Application.php 7 months ago ApplicationFee.php 7 months ago ApplicationFeeRefund.php 7 months ago Balance.php 7 months ago BalanceTransaction.php 7 months ago BankAccount.php 7 months ago BaseStripeClient.php 7 months ago BaseStripeClientInterface.php 7 months ago Capability.php 7 months ago Card.php 7 months ago CashBalance.php 7 months ago Charge.php 7 months ago Collection.php 7 months ago ConfirmationToken.php 7 months ago ConnectCollectionTransfer.php 7 months ago CountrySpec.php 7 months ago Coupon.php 7 months ago CreditNote.php 7 months ago CreditNoteLineItem.php 7 months ago Customer.php 7 months ago CustomerBalanceTransaction.php 7 months ago CustomerCashBalanceTransaction.php 7 months ago CustomerSession.php 7 months ago Discount.php 7 months ago Dispute.php 7 months ago EphemeralKey.php 7 months ago ErrorObject.php 7 months ago Event.php 7 months ago ExchangeRate.php 7 months ago File.php 7 months ago FileLink.php 7 months ago FundingInstructions.php 7 months ago Invoice.php 7 months ago InvoiceItem.php 7 months ago InvoiceLineItem.php 7 months ago InvoicePayment.php 7 months ago InvoiceRenderingTemplate.php 7 months ago LineItem.php 7 months ago LoginLink.php 7 months ago Mandate.php 7 months ago OAuth.php 7 months ago OAuthErrorObject.php 7 months ago PaymentIntent.php 7 months ago PaymentLink.php 7 months ago PaymentMethod.php 7 months ago PaymentMethodConfiguration.php 7 months ago PaymentMethodDomain.php 7 months ago Payout.php 7 months ago Person.php 7 months ago Plan.php 7 months ago Price.php 7 months ago Product.php 7 months ago ProductFeature.php 7 months ago PromotionCode.php 7 months ago Quote.php 7 months ago Reason.php 7 months ago RecipientTransfer.php 7 months ago Refund.php 7 months ago RelatedObject.php 7 months ago RequestTelemetry.php 7 months ago ReserveTransaction.php 7 months ago Review.php 7 months ago SearchResult.php 7 months ago SetupAttempt.php 7 months ago SetupIntent.php 7 months ago ShippingRate.php 7 months ago SingletonApiResource.php 7 months ago Source.php 7 months ago SourceMandateNotification.php 7 months ago SourceTransaction.php 7 months ago Stripe.php 7 months ago StripeClient.php 7 months ago StripeClientInterface.php 7 months ago StripeObject.php 7 months ago StripeStreamingClientInterface.php 7 months ago Subscription.php 7 months ago SubscriptionItem.php 7 months ago SubscriptionSchedule.php 7 months ago TaxCode.php 7 months ago TaxDeductedAtSource.php 7 months ago TaxId.php 7 months ago TaxRate.php 7 months ago ThinEvent.php 7 months ago Token.php 7 months ago Topup.php 7 months ago Transfer.php 7 months ago TransferReversal.php 7 months ago Webhook.php 7 months ago WebhookEndpoint.php 7 months ago WebhookSignature.php 7 months ago
Source.php
222 lines
1 <?php
2
3 // File generated from our OpenAPI spec
4 namespace AmeliaVendor\Stripe;
5
6 /**
7 * <code>Source</code> objects allow you to accept a variety of payment methods. They
8 * represent a customer's payment instrument, and can be used with the Stripe API
9 * just like a <code>Card</code> object: once chargeable, they can be charged, or can be
10 * attached to customers.
11 *
12 * Stripe doesn't recommend using the deprecated <a href="https://stripe.com/docs/api/sources">Sources API</a>.
13 * We recommend that you adopt the <a href="https://stripe.com/docs/api/payment_methods">PaymentMethods API</a>.
14 * This newer API provides access to our latest features and payment method types.
15 *
16 * Related guides: <a href="https://stripe.com/docs/sources">Sources API</a> and <a href="https://stripe.com/docs/sources/customers">Sources &amp; Customers</a>.
17 *
18 * @property string $id Unique identifier for the object.
19 * @property string $object String representing the object's type. Objects of the same type share the same value.
20 * @property null|(object{account_number?: null|string, bank_name?: null|string, fingerprint?: null|string, refund_account_holder_name?: null|string, refund_account_holder_type?: null|string, refund_routing_number?: null|string, routing_number?: null|string, swift_code?: null|string}&StripeObject) $ach_credit_transfer
21 * @property null|(object{bank_name?: null|string, country?: null|string, fingerprint?: null|string, last4?: null|string, routing_number?: null|string, type?: null|string}&StripeObject) $ach_debit
22 * @property null|(object{bank_address_city?: null|string, bank_address_line_1?: null|string, bank_address_line_2?: null|string, bank_address_postal_code?: null|string, bank_name?: null|string, category?: null|string, country?: null|string, fingerprint?: null|string, last4?: null|string, routing_number?: null|string}&StripeObject) $acss_debit
23 * @property null|(object{data_string?: null|string, native_url?: null|string, statement_descriptor?: null|string}&StripeObject) $alipay
24 * @property null|string $allow_redisplay This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”.
25 * @property null|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 associated with the source. This is the amount for which the source will be chargeable once ready. Required for <code>single_use</code> sources.
26 * @property null|(object{bsb_number?: null|string, fingerprint?: null|string, last4?: null|string}&StripeObject) $au_becs_debit
27 * @property null|(object{bank_code?: null|string, bank_name?: null|string, bic?: null|string, iban_last4?: null|string, preferred_language?: null|string, statement_descriptor?: null|string}&StripeObject) $bancontact
28 * @property null|(object{address_line1_check?: null|string, address_zip_check?: null|string, brand?: null|string, country?: null|string, cvc_check?: null|string, description?: string, dynamic_last4?: null|string, exp_month?: null|int, exp_year?: null|int, fingerprint?: string, funding?: null|string, iin?: string, issuer?: string, last4?: null|string, name?: null|string, three_d_secure?: string, tokenization_method?: null|string}&StripeObject) $card
29 * @property null|(object{application_cryptogram?: string, application_preferred_name?: string, authorization_code?: null|string, authorization_response_code?: string, brand?: null|string, country?: null|string, cvm_type?: string, data_type?: null|string, dedicated_file_name?: string, description?: string, emv_auth_data?: string, evidence_customer_signature?: null|string, evidence_transaction_certificate?: null|string, exp_month?: null|int, exp_year?: null|int, fingerprint?: string, funding?: null|string, iin?: string, issuer?: string, last4?: null|string, pos_device_id?: null|string, pos_entry_mode?: string, read_method?: null|string, reader?: null|string, terminal_verification_results?: string, transaction_status_information?: string}&StripeObject) $card_present
30 * @property string $client_secret The client secret of the source. Used for client-side retrieval using a publishable key.
31 * @property null|(object{attempts_remaining: int, status: string}&StripeObject) $code_verification
32 * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
33 * @property null|string $currency Three-letter <a href="https://stripe.com/docs/currencies">ISO code for the currency</a> associated with the source. This is the currency for which the source will be chargeable once ready. Required for <code>single_use</code> sources.
34 * @property null|string $customer The ID of the customer to which this source is attached. This will not be present when the source has not been attached to a customer.
35 * @property null|(object{reference?: null|string, statement_descriptor?: null|string}&StripeObject) $eps
36 * @property string $flow The authentication <code>flow</code> of the source. <code>flow</code> is one of <code>redirect</code>, <code>receiver</code>, <code>code_verification</code>, <code>none</code>.
37 * @property null|(object{bank_code?: null|string, bank_name?: null|string, bic?: null|string, statement_descriptor?: null|string}&StripeObject) $giropay
38 * @property null|(object{bank?: null|string, bic?: null|string, iban_last4?: null|string, statement_descriptor?: null|string}&StripeObject) $ideal
39 * @property null|(object{background_image_url?: string, client_token?: null|string, first_name?: string, last_name?: string, locale?: string, logo_url?: string, page_title?: string, pay_later_asset_urls_descriptive?: string, pay_later_asset_urls_standard?: string, pay_later_name?: string, pay_later_redirect_url?: string, pay_now_asset_urls_descriptive?: string, pay_now_asset_urls_standard?: string, pay_now_name?: string, pay_now_redirect_url?: string, pay_over_time_asset_urls_descriptive?: string, pay_over_time_asset_urls_standard?: string, pay_over_time_name?: string, pay_over_time_redirect_url?: string, payment_method_categories?: string, purchase_country?: string, purchase_type?: string, redirect_url?: string, shipping_delay?: int, shipping_first_name?: string, shipping_last_name?: string}&StripeObject) $klarna
40 * @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.
41 * @property null|StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
42 * @property null|(object{entity?: null|string, reference?: null|string, refund_account_holder_address_city?: null|string, refund_account_holder_address_country?: null|string, refund_account_holder_address_line1?: null|string, refund_account_holder_address_line2?: null|string, refund_account_holder_address_postal_code?: null|string, refund_account_holder_address_state?: null|string, refund_account_holder_name?: null|string, refund_iban?: null|string}&StripeObject) $multibanco
43 * @property null|(object{address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), email: null|string, name: null|string, phone: null|string, verified_address: null|(object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), verified_email: null|string, verified_name: null|string, verified_phone: null|string}&StripeObject) $owner Information about the owner of the payment instrument that may be used or required by particular source types.
44 * @property null|(object{reference?: null|string}&StripeObject) $p24
45 * @property null|(object{address: null|string, amount_charged: int, amount_received: int, amount_returned: int, refund_attributes_method: string, refund_attributes_status: string}&StripeObject) $receiver
46 * @property null|(object{failure_reason: null|string, return_url: string, status: string, url: string}&StripeObject) $redirect
47 * @property null|(object{bank_name?: null|string, bic?: null|string, iban?: null|string, refund_account_holder_address_city?: null|string, refund_account_holder_address_country?: null|string, refund_account_holder_address_line1?: null|string, refund_account_holder_address_line2?: null|string, refund_account_holder_address_postal_code?: null|string, refund_account_holder_address_state?: null|string, refund_account_holder_name?: null|string, refund_iban?: null|string}&StripeObject) $sepa_credit_transfer
48 * @property null|(object{bank_code?: null|string, branch_code?: null|string, country?: null|string, fingerprint?: null|string, last4?: null|string, mandate_reference?: null|string, mandate_url?: null|string}&StripeObject) $sepa_debit
49 * @property null|(object{bank_code?: null|string, bank_name?: null|string, bic?: null|string, country?: null|string, iban_last4?: null|string, preferred_language?: null|string, statement_descriptor?: null|string}&StripeObject) $sofort
50 * @property null|(object{amount: int, currency: string, email?: string, items: null|((object{amount: null|int, currency: null|string, description: null|string, parent: null|string, quantity?: int, type: null|string}&StripeObject))[], shipping?: (object{address?: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&StripeObject), carrier?: null|string, name?: string, phone?: null|string, tracking_number?: null|string}&StripeObject)}&StripeObject) $source_order
51 * @property null|string $statement_descriptor Extra information about a source. This will appear on your customer's statement every time you charge the source.
52 * @property string $status The status of the source, one of <code>canceled</code>, <code>chargeable</code>, <code>consumed</code>, <code>failed</code>, or <code>pending</code>. Only <code>chargeable</code> sources can be used to create a charge.
53 * @property null|(object{address_line1_check?: null|string, address_zip_check?: null|string, authenticated?: null|bool, brand?: null|string, card?: null|string, country?: null|string, customer?: null|string, cvc_check?: null|string, description?: string, dynamic_last4?: null|string, exp_month?: null|int, exp_year?: null|int, fingerprint?: string, funding?: null|string, iin?: string, issuer?: string, last4?: null|string, name?: null|string, three_d_secure?: string, tokenization_method?: null|string}&StripeObject) $three_d_secure
54 * @property string $type The <code>type</code> of the source. The <code>type</code> is a payment method, one of <code>ach_credit_transfer</code>, <code>ach_debit</code>, <code>alipay</code>, <code>bancontact</code>, <code>card</code>, <code>card_present</code>, <code>eps</code>, <code>giropay</code>, <code>ideal</code>, <code>multibanco</code>, <code>klarna</code>, <code>p24</code>, <code>sepa_debit</code>, <code>sofort</code>, <code>three_d_secure</code>, or <code>wechat</code>. An additional hash is included on the source with a name matching this value. It contains additional information specific to the <a href="https://stripe.com/docs/sources">payment method</a> used.
55 * @property null|string $usage Either <code>reusable</code> or <code>single_use</code>. Whether this source should be reusable or not. Some source types may or may not be reusable by construction, while others may leave the option at creation. If an incompatible value is passed, an error will be returned.
56 * @property null|(object{prepay_id?: string, qr_code_url?: null|string, statement_descriptor?: string}&StripeObject) $wechat
57 */
58 class Source extends ApiResource
59 {
60 const OBJECT_NAME = 'source';
61 use \AmeliaVendor\Stripe\ApiOperations\Update;
62 const ALLOW_REDISPLAY_ALWAYS = 'always';
63 const ALLOW_REDISPLAY_LIMITED = 'limited';
64 const ALLOW_REDISPLAY_UNSPECIFIED = 'unspecified';
65 const FLOW_CODE_VERIFICATION = 'code_verification';
66 const FLOW_NONE = 'none';
67 const FLOW_RECEIVER = 'receiver';
68 const FLOW_REDIRECT = 'redirect';
69 const STATUS_CANCELED = 'canceled';
70 const STATUS_CHARGEABLE = 'chargeable';
71 const STATUS_CONSUMED = 'consumed';
72 const STATUS_FAILED = 'failed';
73 const STATUS_PENDING = 'pending';
74 const TYPE_ACH_CREDIT_TRANSFER = 'ach_credit_transfer';
75 const TYPE_ACH_DEBIT = 'ach_debit';
76 const TYPE_ACSS_DEBIT = 'acss_debit';
77 const TYPE_ALIPAY = 'alipay';
78 const TYPE_AU_BECS_DEBIT = 'au_becs_debit';
79 const TYPE_BANCONTACT = 'bancontact';
80 const TYPE_CARD = 'card';
81 const TYPE_CARD_PRESENT = 'card_present';
82 const TYPE_EPS = 'eps';
83 const TYPE_GIROPAY = 'giropay';
84 const TYPE_IDEAL = 'ideal';
85 const TYPE_KLARNA = 'klarna';
86 const TYPE_MULTIBANCO = 'multibanco';
87 const TYPE_P24 = 'p24';
88 const TYPE_SEPA_CREDIT_TRANSFER = 'sepa_credit_transfer';
89 const TYPE_SEPA_DEBIT = 'sepa_debit';
90 const TYPE_SOFORT = 'sofort';
91 const TYPE_THREE_D_SECURE = 'three_d_secure';
92 const TYPE_WECHAT = 'wechat';
93 const USAGE_REUSABLE = 'reusable';
94 const USAGE_SINGLE_USE = 'single_use';
95 /**
96 * Creates a new source object.
97 *
98 * @param null|array{amount?: int, currency?: string, customer?: string, expand?: string[], flow?: string, mandate?: array{acceptance?: array{date?: int, ip?: string, offline?: array{contact_email: string}, online?: array{date?: int, ip?: string, user_agent?: string}, status: string, type?: string, user_agent?: string}, amount?: null|int, currency?: string, interval?: string, notification_method?: string}, metadata?: array<string, string>, original_source?: string, owner?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: string, name?: string, phone?: string}, receiver?: array{refund_attributes_method?: string}, redirect?: array{return_url: string}, source_order?: array{items?: array{amount?: int, currency?: string, description?: string, parent?: string, quantity?: int, type?: string}[], shipping?: array{address: array{city?: string, country?: string, line1: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name?: string, phone?: string, tracking_number?: string}}, statement_descriptor?: string, token?: string, type?: string, usage?: string} $params
99 * @param null|array|string $options
100 *
101 * @return Source the created resource
102 *
103 * @throws Exception\ApiErrorException if the request fails
104 */
105 public static function create($params = null, $options = null)
106 {
107 self::_validateParams($params);
108 $url = static::classUrl();
109 list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
110 $obj = \AmeliaVendor\Stripe\Util\Util::convertToStripeObject($response->json, $opts);
111 $obj->setLastResponse($response);
112 return $obj;
113 }
114 /**
115 * Retrieves an existing source object. Supply the unique source ID from a source
116 * creation request and Stripe will return the corresponding up-to-date source
117 * object information.
118 *
119 * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
120 * @param null|array|string $opts
121 *
122 * @return Source
123 *
124 * @throws Exception\ApiErrorException if the request fails
125 */
126 public static function retrieve($id, $opts = null)
127 {
128 $opts = \AmeliaVendor\Stripe\Util\RequestOptions::parse($opts);
129 $instance = new static($id, $opts);
130 $instance->refresh();
131 return $instance;
132 }
133 /**
134 * Updates the specified source by setting the values of the parameters passed. Any
135 * parameters not provided will be left unchanged.
136 *
137 * This request accepts the <code>metadata</code> and <code>owner</code> as
138 * arguments. It is also possible to update type specific information for selected
139 * payment methods. Please refer to our <a href="/docs/sources">payment method
140 * guides</a> for more detail.
141 *
142 * @param string $id the ID of the resource to update
143 * @param null|array{amount?: int, expand?: string[], mandate?: array{acceptance?: array{date?: int, ip?: string, offline?: array{contact_email: string}, online?: array{date?: int, ip?: string, user_agent?: string}, status: string, type?: string, user_agent?: string}, amount?: null|int, currency?: string, interval?: string, notification_method?: string}, metadata?: null|array<string, string>, owner?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: string, name?: string, phone?: string}, source_order?: array{items?: array{amount?: int, currency?: string, description?: string, parent?: string, quantity?: int, type?: string}[], shipping?: array{address: array{city?: string, country?: string, line1: string, line2?: string, postal_code?: string, state?: string}, carrier?: string, name?: string, phone?: string, tracking_number?: string}}} $params
144 * @param null|array|string $opts
145 *
146 * @return Source the updated resource
147 *
148 * @throws Exception\ApiErrorException if the request fails
149 */
150 public static function update($id, $params = null, $opts = null)
151 {
152 self::_validateParams($params);
153 $url = static::resourceUrl($id);
154 list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
155 $obj = \AmeliaVendor\Stripe\Util\Util::convertToStripeObject($response->json, $opts);
156 $obj->setLastResponse($response);
157 return $obj;
158 }
159 use \AmeliaVendor\Stripe\ApiOperations\NestedResource;
160 /**
161 * @param null|array $params
162 * @param null|array|string $opts
163 *
164 * @return Source the detached source
165 *
166 * @throws Exception\UnexpectedValueException if the source is not attached to a customer
167 * @throws Exception\ApiErrorException if the request fails
168 */
169 public function detach($params = null, $opts = null)
170 {
171 self::_validateParams($params);
172 $id = $this['id'];
173 if (!$id) {
174 $class = static::class;
175 $msg = "Could not determine which URL to request: {$class} instance " . "has invalid ID: {$id}";
176 throw new Exception\UnexpectedValueException($msg, null);
177 }
178 if ($this['customer']) {
179 $base = Customer::classUrl();
180 $parentExtn = \urlencode(\AmeliaVendor\Stripe\Util\Util::utf8($this['customer']));
181 $extn = \urlencode(\AmeliaVendor\Stripe\Util\Util::utf8($id));
182 $url = "{$base}/{$parentExtn}/sources/{$extn}";
183 list($response, $opts) = $this->_request('delete', $url, $params, $opts);
184 $this->refreshFrom($response, $opts);
185 return $this;
186 }
187 $message = 'This source object does not appear to be currently attached ' . 'to a customer object.';
188 throw new Exception\UnexpectedValueException($message);
189 }
190 /**
191 * @param string $id
192 * @param null|array $params
193 * @param null|array|string $opts
194 *
195 * @return Collection<SourceTransaction> list of source transactions
196 *
197 * @throws Exception\ApiErrorException if the request fails
198 */
199 public static function allSourceTransactions($id, $params = null, $opts = null)
200 {
201 $url = static::resourceUrl($id) . '/source_transactions';
202 list($response, $opts) = static::_staticRequest('get', $url, $params, $opts);
203 $obj = \AmeliaVendor\Stripe\Util\Util::convertToStripeObject($response->json, $opts);
204 $obj->setLastResponse($response);
205 return $obj;
206 }
207 /**
208 * @param null|array $params
209 * @param null|array|string $opts
210 *
211 * @return Source the verified source
212 *
213 * @throws Exception\ApiErrorException if the request fails
214 */
215 public function verify($params = null, $opts = null)
216 {
217 $url = $this->instanceUrl() . '/verify';
218 list($response, $opts) = $this->_request('post', $url, $params, $opts);
219 $this->refreshFrom($response, $opts);
220 return $this;
221 }
222 }