|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Stripe; |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* Class AlipayAccount |
|
7
|
|
|
* |
|
8
|
|
|
* @package Stripe |
|
9
|
|
|
* |
|
10
|
|
|
* @deprecated Alipay accounts are deprecated. Please use the sources API instead. |
|
11
|
|
|
* @link https://stripe.com/docs/sources/alipay |
|
12
|
|
|
*/ |
|
13
|
|
|
class AlipayAccount extends ApiResource |
|
14
|
|
|
{ |
|
15
|
|
|
|
|
16
|
|
|
const OBJECT_NAME = "alipay_account"; |
|
17
|
|
|
|
|
18
|
|
|
use ApiOperations\Delete; |
|
19
|
|
|
use ApiOperations\Update; |
|
20
|
|
|
|
|
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. |
|
24
|
|
|
*/ |
|
25
|
|
|
public function instanceUrl() |
|
26
|
|
|
{ |
|
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); |
|
34
|
|
|
} |
|
35
|
|
|
$parentExtn = urlencode(Util\Util::utf8($parent)); |
|
36
|
|
|
$extn = urlencode(Util\Util::utf8($this['id'])); |
|
37
|
|
|
return "$base/$parentExtn/$path/$extn"; |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* @param array|string $_id |
|
42
|
|
|
* @param array|string|null $_opts |
|
43
|
|
|
* |
|
44
|
|
|
* @throws \Stripe\Error\InvalidRequest |
|
45
|
|
|
* |
|
46
|
|
|
* @deprecated Alipay accounts are deprecated. Please use the sources API instead. |
|
47
|
|
|
* @link https://stripe.com/docs/sources/alipay |
|
48
|
|
|
*/ |
|
49
|
|
|
public static function retrieve($_id, $_opts = null) |
|
|
|
|
|
|
50
|
|
|
{ |
|
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); |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
/** |
|
57
|
|
|
* @param string $_id |
|
58
|
|
|
* @param array|null $_params |
|
59
|
|
|
* @param array|string|null $_options |
|
60
|
|
|
* |
|
61
|
|
|
* @throws \Stripe\Error\InvalidRequest |
|
62
|
|
|
* |
|
63
|
|
|
* @deprecated Alipay accounts are deprecated. Please use the sources API instead. |
|
64
|
|
|
* @link https://stripe.com/docs/sources/alipay |
|
65
|
|
|
*/ |
|
66
|
|
|
public static function update($_id, $_params = null, $_options = null) |
|
|
|
|
|
|
67
|
|
|
{ |
|
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); |
|
71
|
|
|
} |
|
72
|
|
|
} |
|
73
|
|
|
|
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.