AccountLink.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe;
  4. /**
  5. * Account Links are the means by which a Connect platform grants a connected account permission to access
  6. * Stripe-hosted applications, such as Connect Onboarding.
  7. *
  8. * Related guide: <a href="https://stripe.com/docs/connect/custom/hosted-onboarding">Connect Onboarding</a>
  9. *
  10. * @property string $object String representing the object's type. Objects of the same type share the same value.
  11. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
  12. * @property int $expires_at The timestamp at which this account link will expire.
  13. * @property string $url The URL for the account link.
  14. */
  15. class AccountLink extends ApiResource
  16. {
  17. const OBJECT_NAME = 'account_link';
  18. /**
  19. * Creates an AccountLink object that includes a single-use Stripe URL that the
  20. * platform can redirect their user to in order to take them through the Connect
  21. * Onboarding flow.
  22. *
  23. * @param null|array $params
  24. * @param null|array|string $options
  25. *
  26. * @throws \Stripe\Exception\ApiErrorException if the request fails
  27. *
  28. * @return \Stripe\AccountLink the created resource
  29. */
  30. public static function create($params = null, $options = null)
  31. {
  32. self::_validateParams($params);
  33. $url = static::classUrl();
  34. list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
  35. $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
  36. $obj->setLastResponse($response);
  37. return $obj;
  38. }
  39. }