Skip to content

Commit 97c9510

Browse files
committed
Add stripe update request
1 parent c16133e commit 97c9510

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/Omnipay/Stripe/Gateway.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ public function store(array $parameters = array())
5959
return $this->createRequest('\Omnipay\Stripe\Message\StoreRequest', $parameters);
6060
}
6161

62+
public function update(array $parameters = array())
63+
{
64+
return $this->createRequest('\Omnipay\Stripe\Message\UpdateRequest', $parameters);
65+
}
66+
6267
public function unstore(array $parameters = array())
6368
{
6469
return $this->createRequest('\Omnipay\Stripe\Message\UnstoreRequest', $parameters);

src/Omnipay/Stripe/Message/UpdateRequest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ public function getData()
2121
$data = array();
2222
$data['description'] = $this->getDescription();
2323

24+
if ($this->getCardToken()) {
25+
$data['card'] = $this->getCardToken();
26+
} elseif ($this->getCard()) {
27+
$data['card'] = $this->getCardData();
28+
$data['email'] = $this->getCard()->getEmail();
29+
}
30+
2431
$this->validate('cardReference');
2532

2633
return $data;

0 commit comments

Comments
 (0)