Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deal with customer.card.created special webhook
- Loading branch information
Olivier Dolbeau
committed
Oct 23, 2019
1 parent
24d46d1
commit ba18244
Showing
7 changed files
with
118 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This software may be modified and distributed under the terms | ||
* of the MIT license. See the LICENSE file for details. | ||
*/ | ||
|
||
namespace Shapin\Stripe\Model\Event; | ||
|
||
use Shapin\Stripe\Model\Card\Card; | ||
|
||
interface ContainsCard extends Event | ||
{ | ||
public function getCard(): Card; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This software may be modified and distributed under the terms | ||
* of the MIT license. See the LICENSE file for details. | ||
*/ | ||
|
||
namespace Shapin\Stripe\Model\Event; | ||
|
||
use Shapin\Stripe\Model\Card\Card; | ||
|
||
trait ContainsCardTrait | ||
{ | ||
use EventTrait; | ||
|
||
public function getCard(): Card | ||
{ | ||
return $this->card; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This software may be modified and distributed under the terms | ||
* of the MIT license. See the LICENSE file for details. | ||
*/ | ||
|
||
namespace Shapin\Stripe\Model\Event; | ||
|
||
final class CustomerCardCreatedEvent implements ContainsCard | ||
{ | ||
use ContainsCardTrait; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"id": "evt_1FWhZZIpafQncvOMFWe2QlHA", | ||
"object": "event", | ||
"api_version": "2019-09-09", | ||
"created": 1571828413, | ||
"data": { | ||
"object": { | ||
"id": "card_1FWhZZIpafQncvOMOIqSU62P", | ||
"object": "card", | ||
"address_city": null, | ||
"address_country": null, | ||
"address_line1": null, | ||
"address_line1_check": null, | ||
"address_line2": null, | ||
"address_state": null, | ||
"address_zip": null, | ||
"address_zip_check": null, | ||
"brand": "Visa", | ||
"country": "US", | ||
"customer": "cus_G2n9nb3ufiT1iy", | ||
"cvc_check": null, | ||
"dynamic_last4": null, | ||
"exp_month": 10, | ||
"exp_year": 2020, | ||
"fingerprint": "yhdusyvLVRkh3oYc", | ||
"funding": "credit", | ||
"last4": "4242", | ||
"metadata": { | ||
}, | ||
"name": null, | ||
"tokenization_method": null | ||
} | ||
}, | ||
"livemode": false, | ||
"pending_webhooks": 1, | ||
"request": { | ||
"id": "req_8P1yFTkKtYdH92", | ||
"idempotency_key": null | ||
}, | ||
"type": "customer.source.created" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters