composer package updates
[openemr.git] / vendor / stripe / stripe-php / lib / AlipayAccount.php
blob70a281bd768af5b55f7b05ec1c88acec20482e18
1 <?php
3 namespace Stripe;
5 /**
6 * Class AlipayAccount
8 * @package Stripe
10 * @deprecated Alipay accounts are deprecated. Please use the sources API instead.
11 * @link https://stripe.com/docs/sources/alipay
13 class AlipayAccount extends ApiResource
16 const OBJECT_NAME = "alipay_account";
18 use ApiOperations\Delete;
19 use ApiOperations\Update;
21 /**
22 * @return string The instance URL for this resource. It needs to be special
23 * cased because it doesn't fit into the standard resource pattern.
25 public function instanceUrl()
27 if ($this['customer']) {
28 $base = Customer::classUrl();
29 $parent = $this['customer'];
30 $path = 'sources';
31 } else {
32 $msg = "Alipay accounts cannot be accessed without a customer ID.";
33 throw new Error\InvalidRequest($msg, null);
35 $parentExtn = urlencode(Util\Util::utf8($parent));
36 $extn = urlencode(Util\Util::utf8($this['id']));
37 return "$base/$parentExtn/$path/$extn";
40 /**
41 * @param array|string $_id
42 * @param array|string|null $_opts
44 * @throws \Stripe\Error\InvalidRequest
46 * @deprecated Alipay accounts are deprecated. Please use the sources API instead.
47 * @link https://stripe.com/docs/sources/alipay
49 public static function retrieve($_id, $_opts = null)
51 $msg = "Alipay accounts cannot be accessed without a customer ID. " .
52 "Retrieve an Alipay account using \$customer->sources->retrieve('alipay_account_id') instead.";
53 throw new Error\InvalidRequest($msg, null);
56 /**
57 * @param string $_id
58 * @param array|null $_params
59 * @param array|string|null $_options
61 * @throws \Stripe\Error\InvalidRequest
63 * @deprecated Alipay accounts are deprecated. Please use the sources API instead.
64 * @link https://stripe.com/docs/sources/alipay
66 public static function update($_id, $_params = null, $_options = null)
68 $msg = "Alipay accounts cannot be accessed without a customer ID. " .
69 "Call save() on \$customer->sources->retrieve('alipay_account_id') instead.";
70 throw new Error\InvalidRequest($msg, null);