SetupAttempt.php 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe;
  4. /**
  5. * A SetupAttempt describes one attempted confirmation of a SetupIntent,
  6. * whether that confirmation is successful or unsuccessful. You can use
  7. * SetupAttempts to inspect details of a specific attempt at setting up a
  8. * payment method using a SetupIntent.
  9. *
  10. * @property string $id Unique identifier for the object.
  11. * @property string $object String representing the object's type. Objects of the same type share the same value.
  12. * @property null|string|\Stripe\Application $application The value of <a href="https://stripe.com/docs/api/setup_intents/object#setup_intent_object-application">application</a> on the SetupIntent at the time of this confirmation.
  13. * @property null|bool $attach_to_self <p>If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.</p><p>It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.</p>
  14. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
  15. * @property null|string|\Stripe\Customer $customer The value of <a href="https://stripe.com/docs/api/setup_intents/object#setup_intent_object-customer">customer</a> on the SetupIntent at the time of this confirmation.
  16. * @property null|string[] $flow_directions <p>Indicates the directions of money movement for which this payment method is intended to be used.</p><p>Include <code>inbound</code> if you intend to use the payment method as the origin to pull funds from. Include <code>outbound</code> if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes.</p>
  17. * @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.
  18. * @property null|string|\Stripe\Account $on_behalf_of The value of <a href="https://stripe.com/docs/api/setup_intents/object#setup_intent_object-on_behalf_of">on_behalf_of</a> on the SetupIntent at the time of this confirmation.
  19. * @property string|\Stripe\PaymentMethod $payment_method ID of the payment method used with this SetupAttempt.
  20. * @property \Stripe\StripeObject $payment_method_details
  21. * @property null|\Stripe\StripeObject $setup_error The error encountered during this attempt to confirm the SetupIntent, if any.
  22. * @property string|\Stripe\SetupIntent $setup_intent ID of the SetupIntent that this attempt belongs to.
  23. * @property string $status Status of this SetupAttempt, one of <code>requires_confirmation</code>, <code>requires_action</code>, <code>processing</code>, <code>succeeded</code>, <code>failed</code>, or <code>abandoned</code>.
  24. * @property string $usage The value of <a href="https://stripe.com/docs/api/setup_intents/object#setup_intent_object-usage">usage</a> on the SetupIntent at the time of this confirmation, one of <code>off_session</code> or <code>on_session</code>.
  25. */
  26. class SetupAttempt extends ApiResource
  27. {
  28. const OBJECT_NAME = 'setup_attempt';
  29. /**
  30. * Returns a list of SetupAttempts that associate with a provided SetupIntent.
  31. *
  32. * @param null|array $params
  33. * @param null|array|string $opts
  34. *
  35. * @throws \Stripe\Exception\ApiErrorException if the request fails
  36. *
  37. * @return \Stripe\Collection<\Stripe\SetupAttempt> of ApiResources
  38. */
  39. public static function all($params = null, $opts = null)
  40. {
  41. $url = static::classUrl();
  42. return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
  43. }
  44. }