-
Notifications
You must be signed in to change notification settings - Fork 848
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Checkout Sessions in beta
- Loading branch information
1 parent
ba85ad7
commit cee0680
Showing
8 changed files
with
54,994 additions
and
2 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
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,20 @@ | ||
<?php | ||
|
||
namespace Stripe; | ||
|
||
/** | ||
* Class CheckoutSession | ||
* | ||
* @property string $id | ||
* @property string $object | ||
* @property bool $livemode | ||
* | ||
* @package Stripe | ||
*/ | ||
class CheckoutSession extends ApiResource | ||
{ | ||
|
||
const OBJECT_NAME = "checkout_session"; | ||
|
||
use ApiOperations\Create; | ||
} |
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,36 @@ | ||
<?php | ||
|
||
namespace Stripe; | ||
|
||
class CheckoutSessionTest extends TestCase | ||
{ | ||
public function testIsCreatable() | ||
{ | ||
$this->expectsRequest( | ||
'post', | ||
'/v1/checkout_sessions' | ||
); | ||
$resource = CheckoutSession::create([ | ||
'allowed_source_types' => ['card'], | ||
'cancel_url' => 'https://stripe.com/cancel', | ||
'client_reference_id' => '1234', | ||
'line_items' => [ | ||
[ | ||
'amount' => 123, | ||
'currency' => 'usd', | ||
'description' => 'item 1', | ||
'images' => [ | ||
'https://stripe.com/img1', | ||
], | ||
'name' => 'name', | ||
'quantity' => 2, | ||
], | ||
], | ||
'payment_intent_data' => [ | ||
'receipt_email' => '[email protected]', | ||
], | ||
'success_url' => 'https://stripe.com/success' | ||
]); | ||
$this->assertInstanceOf('Stripe\\CheckoutSession', $resource); | ||
} | ||
} |
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
Oops, something went wrong.