mirror of
https://github.com/itflow-org/itflow
synced 2026-08-16 04:25:13 +00:00
Rename plugins to libs and update all file references
This commit is contained in:
36
libs/stripe-php/lib/V2/Core/Account.php
Normal file
36
libs/stripe-php/lib/V2/Core/Account.php
Normal file
File diff suppressed because one or more lines are too long
21
libs/stripe-php/lib/V2/Core/AccountLink.php
Normal file
21
libs/stripe-php/lib/V2/Core/AccountLink.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
// File generated from our OpenAPI spec
|
||||
|
||||
namespace Stripe\V2\Core;
|
||||
|
||||
/**
|
||||
* Account Links let a platform create a temporary, single-use URL that an account can use to access a Stripe-hosted flow for collecting or updating required information.
|
||||
*
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value of the object field.
|
||||
* @property string $account The ID of the connected account this Account Link applies to.
|
||||
* @property int $created The timestamp at which this Account Link was created.
|
||||
* @property int $expires_at The timestamp at which this Account Link will expire.
|
||||
* @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 $url The URL at which the account can access the Stripe-hosted flow.
|
||||
* @property (object{type: string, account_onboarding?: (object{collection_options?: (object{fields?: string, future_requirements?: string}&\Stripe\StripeObject), configurations: string[], refresh_url: string, return_url?: string}&\Stripe\StripeObject), account_update?: (object{collection_options?: (object{fields?: string, future_requirements?: string}&\Stripe\StripeObject), configurations: string[], refresh_url: string, return_url?: string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $use_case Hash containing usage options.
|
||||
*/
|
||||
class AccountLink extends \Stripe\ApiResource
|
||||
{
|
||||
const OBJECT_NAME = 'v2.core.account_link';
|
||||
}
|
||||
44
libs/stripe-php/lib/V2/Core/AccountPerson.php
Normal file
44
libs/stripe-php/lib/V2/Core/AccountPerson.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
// File generated from our OpenAPI spec
|
||||
|
||||
namespace Stripe\V2\Core;
|
||||
|
||||
/**
|
||||
* A Person represents an individual associated with an Account's identity (for example, an owner, director, executive, or representative). Use Persons to provide and update identity information for verification and compliance.
|
||||
*
|
||||
* @property string $id Unique identifier for the Person.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value of the object field.
|
||||
* @property string $account The account ID which the individual belongs to.
|
||||
* @property null|(object{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, purpose: string, state?: string, town?: string}&\Stripe\StripeObject)[] $additional_addresses Additional addresses associated with the person.
|
||||
* @property null|(object{full_name?: string, given_name?: string, purpose: string, surname?: string}&\Stripe\StripeObject)[] $additional_names Additional names (e.g. aliases) associated with the person.
|
||||
* @property null|(object{account?: (object{date?: int, ip?: string, user_agent?: string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $additional_terms_of_service Attestations of accepted terms of service agreements.
|
||||
* @property null|(object{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}&\Stripe\StripeObject) $address The person's residential address.
|
||||
* @property int $created Time at which the object was created. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z.
|
||||
* @property null|(object{day: int, month: int, year: int}&\Stripe\StripeObject) $date_of_birth The person's date of birth.
|
||||
* @property null|(object{company_authorization?: (object{files: string[], type: string}&\Stripe\StripeObject), passport?: (object{files: string[], type: string}&\Stripe\StripeObject), primary_verification?: (object{front_back: (object{back?: string, front: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), secondary_verification?: (object{front_back: (object{back?: string, front: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), visa?: (object{files: string[], type: string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $documents Documents that may be submitted to satisfy various informational requests.
|
||||
* @property null|string $email The person's email address.
|
||||
* @property null|string $given_name The person's first name.
|
||||
* @property null|(object{type: string}&\Stripe\StripeObject)[] $id_numbers The identification numbers (e.g., SSN) associated with the person.
|
||||
* @property null|string $legal_gender The person's gender (International regulations require either "male" or "female").
|
||||
* @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|\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[] $nationalities The countries where the person is a national. Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO 3166-1 alpha-2</a>).
|
||||
* @property null|string $phone The person's phone number.
|
||||
* @property null|string $political_exposure The person's political exposure.
|
||||
* @property null|(object{authorizer?: bool, director?: bool, executive?: bool, legal_guardian?: bool, owner?: bool, percent_ownership?: string, representative?: bool, title?: string}&\Stripe\StripeObject) $relationship The relationship that this person has with the Account's business or legal entity.
|
||||
* @property null|(object{kana?: (object{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}&\Stripe\StripeObject), kanji?: (object{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string, town?: string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $script_addresses The script addresses (e.g., non-Latin characters) associated with the person.
|
||||
* @property null|(object{kana?: (object{given_name?: string, surname?: string}&\Stripe\StripeObject), kanji?: (object{given_name?: string, surname?: string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $script_names The script names (e.g. non-Latin characters) associated with the person.
|
||||
* @property null|string $surname The person's last name.
|
||||
* @property int $updated Time at which the object was last updated. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z.
|
||||
*/
|
||||
class AccountPerson extends \Stripe\ApiResource
|
||||
{
|
||||
const OBJECT_NAME = 'v2.core.account_person';
|
||||
|
||||
const LEGAL_GENDER_FEMALE = 'female';
|
||||
const LEGAL_GENDER_MALE = 'male';
|
||||
|
||||
const POLITICAL_EXPOSURE_EXISTING = 'existing';
|
||||
const POLITICAL_EXPOSURE_NONE = 'none';
|
||||
}
|
||||
20
libs/stripe-php/lib/V2/Core/AccountPersonToken.php
Normal file
20
libs/stripe-php/lib/V2/Core/AccountPersonToken.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
// File generated from our OpenAPI spec
|
||||
|
||||
namespace Stripe\V2\Core;
|
||||
|
||||
/**
|
||||
* Person Tokens are single-use tokens which tokenize person information, and are used for creating or updating a Person.
|
||||
*
|
||||
* @property string $id Unique identifier for the token.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value of the object field.
|
||||
* @property int $created Time at which the token was created. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z.
|
||||
* @property int $expires_at Time at which the token will expire.
|
||||
* @property bool $livemode Has the value <code>true</code> if the token exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property bool $used Determines if the token has already been used (tokens can only be used once).
|
||||
*/
|
||||
class AccountPersonToken extends \Stripe\ApiResource
|
||||
{
|
||||
const OBJECT_NAME = 'v2.core.account_person_token';
|
||||
}
|
||||
20
libs/stripe-php/lib/V2/Core/AccountToken.php
Normal file
20
libs/stripe-php/lib/V2/Core/AccountToken.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
// File generated from our OpenAPI spec
|
||||
|
||||
namespace Stripe\V2\Core;
|
||||
|
||||
/**
|
||||
* Account tokens are single-use tokens which tokenize company/individual/business information, and are used for creating or updating an Account.
|
||||
*
|
||||
* @property string $id Unique identifier for the token.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value of the object field.
|
||||
* @property int $created Time at which the token was created. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z.
|
||||
* @property int $expires_at Time at which the token will expire.
|
||||
* @property bool $livemode Has the value <code>true</code> if the token exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property bool $used Determines if the token has already been used (tokens can only be used once).
|
||||
*/
|
||||
class AccountToken extends \Stripe\ApiResource
|
||||
{
|
||||
const OBJECT_NAME = 'v2.core.account_token';
|
||||
}
|
||||
21
libs/stripe-php/lib/V2/Core/Event.php
Normal file
21
libs/stripe-php/lib/V2/Core/Event.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\V2\Core;
|
||||
|
||||
/**
|
||||
* Base class for V2 events.
|
||||
*
|
||||
* This is concrete for use in our generated tests. Events returned from the \Stripe\V2\Core\EventService
|
||||
* will be a subtype of \Stripe\V2\Core\Event.
|
||||
*
|
||||
* @property string $id Unique identifier for the event.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value of the object field.
|
||||
* @property int $created Time at which the object was created.
|
||||
* @property \Stripe\StripeObject $reason Reason for the event.
|
||||
* @property string $type The type of the event.
|
||||
* @property null|string $context The Stripe account of the event
|
||||
*/
|
||||
class Event extends \Stripe\ApiResource
|
||||
{
|
||||
const OBJECT_NAME = 'v2.core.event';
|
||||
}
|
||||
40
libs/stripe-php/lib/V2/Core/EventDestination.php
Normal file
40
libs/stripe-php/lib/V2/Core/EventDestination.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
// File generated from our OpenAPI spec
|
||||
|
||||
namespace Stripe\V2\Core;
|
||||
|
||||
/**
|
||||
* Set up an event destination to receive events from Stripe across multiple destination types, including <a href="https://docs.stripe.com/webhooks">webhook endpoints</a> and <a href="https://docs.stripe.com/event-destinations/eventbridge">Amazon EventBridge</a>. Event destinations support receiving <a href="https://docs.stripe.com/api/v2/events">thin events</a> and <a href="https://docs.stripe.com/api/events">snapshot events</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 of the object field.
|
||||
* @property null|(object{aws_account_id: string, aws_event_source_arn: string, aws_event_source_status: string}&\Stripe\StripeObject) $amazon_eventbridge Amazon EventBridge configuration.
|
||||
* @property int $created Time at which the object was created.
|
||||
* @property string $description An optional description of what the event destination is used for.
|
||||
* @property string[] $enabled_events The list of events to enable for this endpoint.
|
||||
* @property string $event_payload Payload type of events being subscribed to.
|
||||
* @property null|string[] $events_from Where events should be routed from.
|
||||
* @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|\Stripe\StripeObject $metadata Metadata.
|
||||
* @property string $name Event destination name.
|
||||
* @property null|string $snapshot_api_version If using the snapshot event payload, the API version events are rendered as.
|
||||
* @property string $status Status. It can be set to either enabled or disabled.
|
||||
* @property null|(object{disabled?: (object{reason: string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $status_details Additional information about event destination status.
|
||||
* @property string $type Event destination type.
|
||||
* @property int $updated Time at which the object was last updated.
|
||||
* @property null|(object{signing_secret?: string, url?: string}&\Stripe\StripeObject) $webhook_endpoint Webhook endpoint configuration.
|
||||
*/
|
||||
class EventDestination extends \Stripe\ApiResource
|
||||
{
|
||||
const OBJECT_NAME = 'v2.core.event_destination';
|
||||
|
||||
const EVENT_PAYLOAD_SNAPSHOT = 'snapshot';
|
||||
const EVENT_PAYLOAD_THIN = 'thin';
|
||||
|
||||
const STATUS_DISABLED = 'disabled';
|
||||
const STATUS_ENABLED = 'enabled';
|
||||
|
||||
const TYPE_AMAZON_EVENTBRIDGE = 'amazon_eventbridge';
|
||||
const TYPE_WEBHOOK_ENDPOINT = 'webhook_endpoint';
|
||||
}
|
||||
136
libs/stripe-php/lib/V2/Core/EventNotification.php
Normal file
136
libs/stripe-php/lib/V2/Core/EventNotification.php
Normal file
@@ -0,0 +1,136 @@
|
||||
<?php
|
||||
|
||||
namespace Stripe\V2\Core;
|
||||
|
||||
use Stripe\Events\UnknownEventNotification;
|
||||
use Stripe\Reason;
|
||||
use Stripe\RelatedObject;
|
||||
use Stripe\Util\EventNotificationTypes;
|
||||
|
||||
/**
|
||||
* EventNotification represents the json that's delivered from an Event Destination.
|
||||
* It's a basic class with no additional methods or properties. Use it to check basic information about a delivered event.
|
||||
* If you want more details, use `$stripeClient->v2->core->events->retrieve(thin_event.id)` to fetch the full event object.
|
||||
*
|
||||
* @property string $id Unique identifier for the event.
|
||||
* @property string $type The type of the event.
|
||||
* @property string $created Time at which the object was created.
|
||||
* @property null|\Stripe\StripeContext $context Authentication context needed to fetch the event or related object.
|
||||
* @property null|Reason $reason Reason for the event.
|
||||
* @property bool $livemode Livemode indicates if the event is from a production(true) or test(false) account.
|
||||
*/
|
||||
abstract class EventNotification
|
||||
{
|
||||
public $id;
|
||||
public $type;
|
||||
public $created;
|
||||
public $context;
|
||||
public $reason;
|
||||
public $livemode;
|
||||
|
||||
protected $client;
|
||||
// only available on children
|
||||
protected $related_object;
|
||||
|
||||
/**
|
||||
* @param array $json the raw json body
|
||||
* @param \Stripe\StripeClient $client a StripeClient instance that this can use to make requests
|
||||
*/
|
||||
public function __construct($json, $client)
|
||||
{
|
||||
$this->client = $client;
|
||||
|
||||
if (\array_key_exists('id', $json)) {
|
||||
$this->id = $json['id'];
|
||||
}
|
||||
if (\array_key_exists('type', $json)) {
|
||||
$this->type = $json['type'];
|
||||
}
|
||||
if (\array_key_exists('created', $json)) {
|
||||
$this->created = $json['created'];
|
||||
}
|
||||
if (\array_key_exists('context', $json) && null !== $json['context']) {
|
||||
$this->context = \Stripe\StripeContext::parse($json['context']);
|
||||
}
|
||||
if (\array_key_exists('livemode', $json)) {
|
||||
$this->livemode = $json['livemode'];
|
||||
}
|
||||
if (\array_key_exists('related_object', $json)) {
|
||||
$this->related_object = new RelatedObject($json['related_object']);
|
||||
}
|
||||
if (\array_key_exists('reason', $json)) {
|
||||
$this->reason = new Reason($json['reason']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper for constructing an Event Notification. Doesn't perform signature validation, so you
|
||||
* should use \Stripe\BaseStripeClient#parseEventNotification instead for
|
||||
* initial handling. This is useful in unit tests and working with EventNotifications that you've
|
||||
* already validated the authenticity of.
|
||||
*
|
||||
* @param string $jsonStr the raw json payload
|
||||
* @param \Stripe\StripeClient $client a StripeClient instance that this can use to make requests
|
||||
*
|
||||
* @return EventNotification
|
||||
*/
|
||||
public static function fromJson($jsonStr, $client)
|
||||
{
|
||||
$json = json_decode($jsonStr, true);
|
||||
|
||||
$class = UnknownEventNotification::class;
|
||||
$eventNotificationTypes = EventNotificationTypes::v2EventMapping;
|
||||
if (\array_key_exists($json['type'], $eventNotificationTypes)) {
|
||||
$class = $eventNotificationTypes[$json['type']];
|
||||
}
|
||||
|
||||
return new $class($json, $client);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the full Event from the Stripe API.
|
||||
*
|
||||
* @return Event
|
||||
*/
|
||||
public function fetchEvent()
|
||||
{
|
||||
$response = $this->client->rawRequest(
|
||||
'get',
|
||||
"/v2/core/events/{$this->id}",
|
||||
null,
|
||||
[
|
||||
'stripe_context' => $this->context,
|
||||
'headers' => ['Stripe-Request-Trigger' => 'event=' . $this->id],
|
||||
],
|
||||
null,
|
||||
['fetch_event']
|
||||
);
|
||||
|
||||
return $this->client->deserialize($response->body, 'v2');
|
||||
}
|
||||
|
||||
protected function fetchRelatedObject()
|
||||
{
|
||||
if (null === $this->related_object) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$options = [
|
||||
'headers' => ['Stripe-Request-Trigger' => 'event=' . $this->id],
|
||||
];
|
||||
if (null !== $this->context) {
|
||||
$options['stripe_context'] = $this->context;
|
||||
}
|
||||
|
||||
$response = $this->client->rawRequest(
|
||||
'get',
|
||||
$this->related_object->url,
|
||||
null,
|
||||
$options,
|
||||
null,
|
||||
['fetch_related_object']
|
||||
);
|
||||
|
||||
return $this->client->deserialize($response->body, \Stripe\Util\Util::getApiMode($this->related_object->url));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user