Mandate.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe;
  4. /**
  5. * A Mandate is a record of the permission that your customer gives you to debit their payment method.
  6. *
  7. * @property string $id Unique identifier for the object.
  8. * @property string $object String representing the object's type. Objects of the same type share the same value.
  9. * @property \Stripe\StripeObject $customer_acceptance
  10. * @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.
  11. * @property null|\Stripe\StripeObject $multi_use
  12. * @property null|string $on_behalf_of The account (if any) that the mandate is intended for.
  13. * @property string|\Stripe\PaymentMethod $payment_method ID of the payment method associated with this mandate.
  14. * @property \Stripe\StripeObject $payment_method_details
  15. * @property null|\Stripe\StripeObject $single_use
  16. * @property string $status The mandate status indicates whether or not you can use it to initiate a payment.
  17. * @property string $type The type of the mandate.
  18. */
  19. class Mandate extends ApiResource
  20. {
  21. const OBJECT_NAME = 'mandate';
  22. const STATUS_ACTIVE = 'active';
  23. const STATUS_INACTIVE = 'inactive';
  24. const STATUS_PENDING = 'pending';
  25. const TYPE_MULTI_USE = 'multi_use';
  26. const TYPE_SINGLE_USE = 'single_use';
  27. /**
  28. * Retrieves a Mandate object.
  29. *
  30. * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
  31. * @param null|array|string $opts
  32. *
  33. * @throws \Stripe\Exception\ApiErrorException if the request fails
  34. *
  35. * @return \Stripe\Mandate
  36. */
  37. public static function retrieve($id, $opts = null)
  38. {
  39. $opts = \Stripe\Util\RequestOptions::parse($opts);
  40. $instance = new static($id, $opts);
  41. $instance->refresh();
  42. return $instance;
  43. }
  44. }