BitcoinReceiver.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace Stripe;
  3. /**
  4. * Class BitcoinReceiver
  5. *
  6. * @package Stripe
  7. *
  8. * @deprecated Bitcoin receivers are deprecated. Please use the sources API instead.
  9. * @link https://stripe.com/docs/sources/bitcoin
  10. */
  11. class BitcoinReceiver extends ApiResource
  12. {
  13. const OBJECT_NAME = "bitcoin_receiver";
  14. use ApiOperations\All;
  15. use ApiOperations\Retrieve;
  16. /**
  17. * @return string The class URL for this resource. It needs to be special
  18. * cased because it doesn't fit into the standard resource pattern.
  19. */
  20. public static function classUrl()
  21. {
  22. return "/v1/bitcoin/receivers";
  23. }
  24. /**
  25. * @return string The instance URL for this resource. It needs to be special
  26. * cased because it doesn't fit into the standard resource pattern.
  27. */
  28. public function instanceUrl()
  29. {
  30. if ($this['customer']) {
  31. $base = Customer::classUrl();
  32. $parent = $this['customer'];
  33. $path = 'sources';
  34. $parentExtn = urlencode(Util\Util::utf8($parent));
  35. $extn = urlencode(Util\Util::utf8($this['id']));
  36. return "$base/$parentExtn/$path/$extn";
  37. } else {
  38. $base = BitcoinReceiver::classUrl();
  39. $extn = urlencode(Util\Util::utf8($this['id']));
  40. return "$base/$extn";
  41. }
  42. }
  43. }