dolibarr/htdocs/includes/stripe/lib/BitcoinReceiver.php

47 lines
1.3 KiB
PHP
Raw Normal View History

2017-04-18 05:44:08 +02:00
<?php
namespace Stripe;
/**
* Class BitcoinReceiver
*
* @package Stripe
2018-03-06 13:52:56 +01:00
*
* @deprecated Bitcoin receivers are deprecated. Please use the sources API instead.
* @link https://stripe.com/docs/sources/bitcoin
2017-04-18 05:44:08 +02:00
*/
2018-03-06 13:52:56 +01:00
class BitcoinReceiver extends ApiResource
2017-04-18 05:44:08 +02:00
{
2018-03-06 13:52:56 +01:00
use ApiOperations\All;
use ApiOperations\Retrieve;
2017-04-18 05:44:08 +02:00
/**
* @return string The class URL for this resource. It needs to be special
* cased because it doesn't fit into the standard resource pattern.
*/
public static function classUrl()
{
return "/v1/bitcoin/receivers";
}
/**
* @return string The instance URL for this resource. It needs to be special
* cased because it doesn't fit into the standard resource pattern.
*/
public function instanceUrl()
{
2018-03-06 13:52:56 +01:00
if ($this['customer']) {
$base = Customer::classUrl();
$parent = $this['customer'];
$path = 'sources';
$parentExtn = urlencode(Util\Util::utf8($parent));
$extn = urlencode(Util\Util::utf8($this['id']));
return "$base/$parentExtn/$path/$extn";
2017-04-18 05:44:08 +02:00
} else {
$base = BitcoinReceiver::classUrl();
2018-03-06 13:52:56 +01:00
$extn = urlencode(Util\Util::utf8($this['id']));
2017-04-18 05:44:08 +02:00
return "$base/$extn";
}
}
}