ApiOperations
6 months ago
Apps
6 months ago
Billing
6 months ago
BillingPortal
6 months ago
Checkout
6 months ago
Climate
6 months ago
Entitlements
6 months ago
EventData
6 months ago
Events
6 months ago
Exception
6 months ago
FinancialConnections
6 months ago
Forwarding
6 months ago
HttpClient
6 months ago
Identity
6 months ago
Issuing
6 months ago
Radar
6 months ago
Reporting
6 months ago
Service
6 months ago
Sigma
6 months ago
Tax
6 months ago
Terminal
6 months ago
TestHelpers
6 months ago
Treasury
6 months ago
Util
6 months ago
V2
6 months ago
Account.php
6 months ago
AccountLink.php
6 months ago
AccountSession.php
6 months ago
ApiRequestor.php
6 months ago
ApiResource.php
6 months ago
ApiResponse.php
6 months ago
ApplePayDomain.php
6 months ago
Application.php
6 months ago
ApplicationFee.php
6 months ago
ApplicationFeeRefund.php
6 months ago
Balance.php
6 months ago
BalanceTransaction.php
6 months ago
BankAccount.php
6 months ago
BaseStripeClient.php
6 months ago
BaseStripeClientInterface.php
6 months ago
Capability.php
6 months ago
Card.php
6 months ago
CashBalance.php
6 months ago
Charge.php
6 months ago
Collection.php
6 months ago
ConfirmationToken.php
6 months ago
ConnectCollectionTransfer.php
6 months ago
CountrySpec.php
6 months ago
Coupon.php
6 months ago
CreditNote.php
6 months ago
CreditNoteLineItem.php
6 months ago
Customer.php
6 months ago
CustomerBalanceTransaction.php
6 months ago
CustomerCashBalanceTransaction.php
6 months ago
CustomerSession.php
6 months ago
Discount.php
6 months ago
Dispute.php
6 months ago
EphemeralKey.php
6 months ago
ErrorObject.php
6 months ago
Event.php
6 months ago
ExchangeRate.php
6 months ago
File.php
6 months ago
FileLink.php
6 months ago
FundingInstructions.php
6 months ago
Invoice.php
6 months ago
InvoiceItem.php
6 months ago
InvoiceLineItem.php
6 months ago
InvoicePayment.php
6 months ago
InvoiceRenderingTemplate.php
6 months ago
LineItem.php
6 months ago
LoginLink.php
6 months ago
Mandate.php
6 months ago
OAuth.php
6 months ago
OAuthErrorObject.php
6 months ago
PaymentIntent.php
6 months ago
PaymentLink.php
6 months ago
PaymentMethod.php
6 months ago
PaymentMethodConfiguration.php
6 months ago
PaymentMethodDomain.php
6 months ago
Payout.php
6 months ago
Person.php
6 months ago
Plan.php
6 months ago
Price.php
6 months ago
Product.php
6 months ago
ProductFeature.php
6 months ago
PromotionCode.php
6 months ago
Quote.php
6 months ago
Reason.php
6 months ago
RecipientTransfer.php
6 months ago
Refund.php
6 months ago
RelatedObject.php
6 months ago
RequestTelemetry.php
6 months ago
ReserveTransaction.php
6 months ago
Review.php
6 months ago
SearchResult.php
6 months ago
SetupAttempt.php
6 months ago
SetupIntent.php
6 months ago
ShippingRate.php
6 months ago
SingletonApiResource.php
6 months ago
Source.php
6 months ago
SourceMandateNotification.php
6 months ago
SourceTransaction.php
6 months ago
Stripe.php
6 months ago
StripeClient.php
6 months ago
StripeClientInterface.php
6 months ago
StripeObject.php
6 months ago
StripeStreamingClientInterface.php
6 months ago
Subscription.php
6 months ago
SubscriptionItem.php
6 months ago
SubscriptionSchedule.php
6 months ago
TaxCode.php
6 months ago
TaxDeductedAtSource.php
6 months ago
TaxId.php
6 months ago
TaxRate.php
6 months ago
ThinEvent.php
6 months ago
Token.php
6 months ago
Topup.php
6 months ago
Transfer.php
6 months ago
TransferReversal.php
6 months ago
Webhook.php
6 months ago
WebhookEndpoint.php
6 months ago
WebhookSignature.php
6 months ago
Token.php
86 lines
| 1 | <?php |
| 2 | |
| 3 | // File generated from our OpenAPI spec |
| 4 | namespace AmeliaVendor\Stripe; |
| 5 | |
| 6 | /** |
| 7 | * Tokenization is the process Stripe uses to collect sensitive card or bank |
| 8 | * account details, or personally identifiable information (PII), directly from |
| 9 | * your customers in a secure manner. A token representing this information is |
| 10 | * returned to your server to use. Use our |
| 11 | * <a href="https://stripe.com/docs/payments">recommended payments integrations</a> to perform this process |
| 12 | * on the client-side. This guarantees that no sensitive card data touches your server, |
| 13 | * and allows your integration to operate in a PCI-compliant way. |
| 14 | * |
| 15 | * If you can't use client-side tokenization, you can also create tokens using |
| 16 | * the API with either your publishable or secret API key. If |
| 17 | * your integration uses this method, you're responsible for any PCI compliance |
| 18 | * that it might require, and you must keep your secret API key safe. Unlike with |
| 19 | * client-side tokenization, your customer's information isn't sent directly to |
| 20 | * Stripe, so we can't determine how it's handled or stored. |
| 21 | * |
| 22 | * You can't store or use tokens more than once. To store card or bank account |
| 23 | * information for later use, create <a href="https://stripe.com/docs/api#customers">Customer</a> |
| 24 | * objects or <a href="/api#external_accounts">External accounts</a>. |
| 25 | * <a href="https://stripe.com/docs/radar">Radar</a>, our integrated solution for automatic fraud protection, |
| 26 | * performs best with integrations that use client-side tokenization. |
| 27 | * |
| 28 | * @property string $id Unique identifier for the object. |
| 29 | * @property string $object String representing the object's type. Objects of the same type share the same value. |
| 30 | * @property null|BankAccount $bank_account <p>These bank accounts are payment methods on <code>Customer</code> objects.</p><p>On the other hand <a href="/api#external_accounts">External Accounts</a> are transfer destinations on <code>Account</code> objects for connected accounts. They can be bank accounts or debit cards as well, and are documented in the links above.</p><p>Related guide: <a href="/payments/bank-debits-transfers">Bank debits and transfers</a></p> |
| 31 | * @property null|Card $card <p>You can store multiple cards on a customer in order to charge the customer later. You can also store multiple debit cards on a recipient in order to transfer to those cards later.</p><p>Related guide: <a href="https://stripe.com/docs/sources/cards">Card payments with Sources</a></p> |
| 32 | * @property null|string $client_ip IP address of the client that generates the token. |
| 33 | * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. |
| 34 | * @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. |
| 35 | * @property string $type Type of the token: <code>account</code>, <code>bank_account</code>, <code>card</code>, or <code>pii</code>. |
| 36 | * @property bool $used Determines if you have already used this token (you can only use tokens once). |
| 37 | */ |
| 38 | class Token extends ApiResource |
| 39 | { |
| 40 | const OBJECT_NAME = 'token'; |
| 41 | const TYPE_ACCOUNT = 'account'; |
| 42 | const TYPE_BANK_ACCOUNT = 'bank_account'; |
| 43 | const TYPE_CARD = 'card'; |
| 44 | const TYPE_PII = 'pii'; |
| 45 | /** |
| 46 | * Creates a single-use token that represents a bank account’s details. You can use |
| 47 | * this token with any v1 API method in place of a bank account dictionary. You can |
| 48 | * only use this token once. To do so, attach it to a <a href="#accounts">connected |
| 49 | * account</a> where <a |
| 50 | * href="/api/accounts/object#account_object-controller-requirement_collection">controller.requirement_collection</a> |
| 51 | * is <code>application</code>, which includes Custom accounts. |
| 52 | * |
| 53 | * @param null|array{account?: array{business_type?: string, company?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, directors_provided?: bool, directorship_declaration?: array{date?: int, ip?: string, user_agent?: string}, executives_provided?: bool, export_license_id?: string, export_purpose_code?: string, name?: string, name_kana?: string, name_kanji?: string, owners_provided?: bool, ownership_declaration?: array{date?: int, ip?: string, user_agent?: string}, ownership_declaration_shown_and_signed?: bool, ownership_exemption_reason?: null|string, phone?: string, registration_date?: null|array{day: int, month: int, year: int}, registration_number?: string, structure?: null|string, tax_id?: string, tax_id_registrar?: string, vat_id?: string, verification?: array{document?: array{back?: string, front?: string}}}, individual?: array{address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, dob?: null|array{day: int, month: int, year: int}, email?: string, first_name?: string, first_name_kana?: string, first_name_kanji?: string, full_name_aliases?: null|string[], gender?: string, id_number?: string, id_number_secondary?: string, last_name?: string, last_name_kana?: string, last_name_kanji?: string, maiden_name?: string, metadata?: null|array<string, string>, phone?: string, political_exposure?: string, registered_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, relationship?: array{director?: bool, executive?: bool, owner?: bool, percent_ownership?: null|float, title?: string}, ssn_last_4?: string, verification?: array{additional_document?: array{back?: string, front?: string}, document?: array{back?: string, front?: string}}}, tos_shown_and_accepted?: bool}, bank_account?: array{account_holder_name?: string, account_holder_type?: string, account_number: string, account_type?: string, country: string, currency?: string, payment_method?: string, routing_number?: string}, card?: array|string, customer?: string, cvc_update?: array{cvc: string}, expand?: string[], person?: array{additional_tos_acceptances?: array{account?: array{date?: int, ip?: string, user_agent?: null|string}}, address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, address_kana?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, address_kanji?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}, dob?: null|array{day: int, month: int, year: int}, documents?: array{company_authorization?: array{files?: string[]}, passport?: array{files?: string[]}, visa?: array{files?: string[]}}, email?: string, first_name?: string, first_name_kana?: string, first_name_kanji?: string, full_name_aliases?: null|string[], gender?: string, id_number?: string, id_number_secondary?: string, last_name?: string, last_name_kana?: string, last_name_kanji?: string, maiden_name?: string, metadata?: null|array<string, string>, nationality?: string, phone?: string, political_exposure?: string, registered_address?: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, relationship?: array{authorizer?: bool, director?: bool, executive?: bool, legal_guardian?: bool, owner?: bool, percent_ownership?: null|float, representative?: bool, title?: string}, ssn_last_4?: string, us_cfpb_data?: array{ethnicity_details?: array{ethnicity?: string[], ethnicity_other?: string}, race_details?: array{race?: string[], race_other?: string}, self_identified_gender?: string}, verification?: array{additional_document?: array{back?: string, front?: string}, document?: array{back?: string, front?: string}}}, pii?: array{id_number?: string}} $params |
| 54 | * @param null|array|string $options |
| 55 | * |
| 56 | * @return Token the created resource |
| 57 | * |
| 58 | * @throws Exception\ApiErrorException if the request fails |
| 59 | */ |
| 60 | public static function create($params = null, $options = null) |
| 61 | { |
| 62 | self::_validateParams($params); |
| 63 | $url = static::classUrl(); |
| 64 | list($response, $opts) = static::_staticRequest('post', $url, $params, $options); |
| 65 | $obj = \AmeliaVendor\Stripe\Util\Util::convertToStripeObject($response->json, $opts); |
| 66 | $obj->setLastResponse($response); |
| 67 | return $obj; |
| 68 | } |
| 69 | /** |
| 70 | * Retrieves the token with the given ID. |
| 71 | * |
| 72 | * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key |
| 73 | * @param null|array|string $opts |
| 74 | * |
| 75 | * @return Token |
| 76 | * |
| 77 | * @throws Exception\ApiErrorException if the request fails |
| 78 | */ |
| 79 | public static function retrieve($id, $opts = null) |
| 80 | { |
| 81 | $opts = \AmeliaVendor\Stripe\Util\RequestOptions::parse($opts); |
| 82 | $instance = new static($id, $opts); |
| 83 | $instance->refresh(); |
| 84 | return $instance; |
| 85 | } |
| 86 | } |