Skip to content

Commit

Permalink
Merge pull request #579 from stripe/remi-fix-checkout-sessions
Browse files Browse the repository at this point in the history
Move CheckoutSession to the Checkout namespace and rename to Session
  • Loading branch information
remi-stripe committed Jan 23, 2019
2 parents 59902d9 + b493d4b commit 7e9d272
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ php:

env:
global:
- STRIPE_MOCK_VERSION=0.40.0
- STRIPE_MOCK_VERSION=0.42.0
matrix:
- AUTOLOAD=1
- AUTOLOAD=0
Expand Down
2 changes: 1 addition & 1 deletion init.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
require(dirname(__FILE__) . '/lib/BitcoinTransaction.php');
require(dirname(__FILE__) . '/lib/Card.php');
require(dirname(__FILE__) . '/lib/Charge.php');
require(dirname(__FILE__) . '/lib/CheckoutSession.php');
require(dirname(__FILE__) . '/lib/Checkout/Session.php');
require(dirname(__FILE__) . '/lib/Collection.php');
require(dirname(__FILE__) . '/lib/CountrySpec.php');
require(dirname(__FILE__) . '/lib/Coupon.php');
Expand Down
20 changes: 20 additions & 0 deletions lib/Checkout/Session.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace Stripe\Checkout;

/**
* Class Session
*
* @property string $id
* @property string $object
* @property bool $livemode
*
* @package Stripe
*/
class Session extends \Stripe\ApiResource
{

const OBJECT_NAME = "checkout.session";

use \Stripe\ApiOperations\Create;
}
20 changes: 0 additions & 20 deletions lib/CheckoutSession.php

This file was deleted.

2 changes: 1 addition & 1 deletion lib/Util/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public static function convertToStripeObject($resp, $opts)
\Stripe\BitcoinTransaction::OBJECT_NAME => 'Stripe\\BitcoinTransaction',
\Stripe\Card::OBJECT_NAME => 'Stripe\\Card',
\Stripe\Charge::OBJECT_NAME => 'Stripe\\Charge',
\Stripe\CheckoutSession::OBJECT_NAME => 'Stripe\\CheckoutSession',
\Stripe\Checkout\Session::OBJECT_NAME => 'Stripe\\Checkout\\Session',
\Stripe\CountrySpec::OBJECT_NAME => 'Stripe\\CountrySpec',
\Stripe\Coupon::OBJECT_NAME => 'Stripe\\Coupon',
\Stripe\Customer::OBJECT_NAME => 'Stripe\\Customer',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?php

namespace Stripe;
namespace Stripe\Checkout;

class CheckoutSessionTest extends TestCase
class SessionTest extends \Stripe\TestCase
{
public function testIsCreatable()
{
$this->expectsRequest(
'post',
'/v1/checkout_sessions'
'/v1/checkout/sessions'
);
$resource = CheckoutSession::create([
$resource = Session::create([
'allowed_source_types' => ['card'],
'cancel_url' => 'https://stripe.com/cancel',
'client_reference_id' => '1234',
Expand All @@ -31,6 +31,6 @@ public function testIsCreatable()
],
'success_url' => 'https://stripe.com/success'
]);
$this->assertInstanceOf('Stripe\\CheckoutSession', $resource);
$this->assertInstanceOf('Stripe\\Checkout\\Session', $resource);
}
}
2 changes: 1 addition & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require_once(__DIR__ . '/StripeMock.php');

define("MOCK_MINIMUM_VERSION", "0.40.0");
define("MOCK_MINIMUM_VERSION", "0.42.0");

if (\Stripe\StripeMock::start()) {
register_shutdown_function('\Stripe\StripeMock::stop');
Expand Down

0 comments on commit 7e9d272

Please sign in to comment.