1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
namespace Stripe;
/**
* Class PaymentMethod
*
* @property string $id
* @property string $object
* @property mixed $billing_details
* @property mixed $card
* @property mixed $card_present
* @property int $created
* @property string $customer
* @property mixed $ideal
* @property bool $livemode
* @property StripeObject $metadata
* @property mixed $sepa_debit
* @property string $type
*
* @package Stripe
*/
class PaymentMethod extends ApiResource
{
const OBJECT_NAME = "payment_method";
use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Retrieve;
use ApiOperations\Update;
/**
* @param array|null $params
* @param array|string|null $opts
*
* @return PaymentMethod The attached payment method.
*/
public function attach($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/attach';
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);
return $this;
}
/**
* @param array|null $params
* @param array|string|null $opts
*
* @return PaymentMethod The detached payment method.
*/
public function detach($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/detach';
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);
return $this;
}
}