File tree Expand file tree Collapse file tree 3 files changed +50
-6
lines changed Expand file tree Collapse file tree 3 files changed +50
-6
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,31 @@ $customer = $gateway->findCustomer(1)->send();
6969```
7070You can find full list of options [ here] ( https://developers.braintreepayments.com/reference/request/customer/find/php )
7171
72+ ### Create payment method
73+
74+ ``` php
75+ $method = $gateway->createPaymentMethod([
76+ 'customerId' => $user->getId(),
77+ 'paymentMethodNonce' => 'paymentnonce',
78+ 'options' => [
79+ 'verifyCard' => true
80+ ]
81+ ]);
82+ ```
83+ You can find full list of options [ here] ( https://developers.braintreepayments.com/reference/request/payment-method/create/php ) .
84+
85+ ### Update payment method
86+
87+ ``` php
88+ $method = $gateway->updatePaymentMethod([
89+ 'paymentMethodToken' => 'token123',
90+ 'options' => [
91+ 'paymentMethodNonce' => 'paymentnonce'
92+ ]
93+ ]);
94+ ```
95+ You can find full list of options [ here] ( https://developers.braintreepayments.com/reference/request/payment-method/update/php ) .
96+
7297###Create subscription
7398
7499``` php
Original file line number Diff line number Diff line change @@ -13,13 +13,9 @@ class UpdatePaymentMethodRequest extends AbstractRequest
1313{
1414 public function getData ()
1515 {
16- $ parameters = array ();
17- $ parameters += $ this ->getOptionData ();
18-
16+ $ data = array ();
1917 $ data ['token ' ] = $ this ->getToken ();
20- if (!empty ($ parameters )) {
21- $ data ['parameters ' ] = $ parameters ;
22- }
18+ $ data ['parameters ' ] = $ this ->parameters ->get ('paymentMethodOptions ' );
2319
2420 return $ data ;
2521 }
@@ -36,4 +32,24 @@ public function sendData($data)
3632
3733 return $ this ->createResponse ($ response );
3834 }
35+
36+ /**
37+ * @param string $value
38+ *
39+ * @return \Omnipay\Common\Message\AbstractRequest
40+ */
41+ public function setPaymentMethodToken ($ value )
42+ {
43+ return $ this ->setParameter ('token ' , $ value );
44+ }
45+
46+ /**
47+ * @param array $options
48+ *
49+ * @return \Omnipay\Common\Message\AbstractRequest
50+ */
51+ public function setOptions (array $ options = array ())
52+ {
53+ return $ this ->setParameter ('paymentMethodOptions ' , $ options );
54+ }
3955}
You can’t perform that action at this time.
0 commit comments