-
Notifications
You must be signed in to change notification settings - Fork 764
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move CheckoutSession to the Checkout namespace and rename to Session
- Loading branch information
1 parent
61b931b
commit 8f659e7
Showing
5 changed files
with
73 additions
and
67 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
'use strict'; | ||
|
||
var StripeResource = require('../../StripeResource'); | ||
|
||
module.exports = StripeResource.extend({ | ||
path: 'checkout/sessions', | ||
includeBasic: ['create'], | ||
}) |
This file was deleted.
Oops, something went wrong.
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,62 @@ | ||
'use strict'; | ||
|
||
var stripe = require('../../../testUtils').getSpyableStripe(); | ||
|
||
var expect = require('chai').expect; | ||
|
||
describe('Checkout', function () { | ||
describe('Sessions Resource', function () { | ||
describe('create', function() { | ||
it('Sends the correct request', function() { | ||
stripe.checkoutSessions.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: 'test@stripe.com', | ||
}, | ||
success_url: 'https://stripe.com/success', | ||
}); | ||
|
||
expect(stripe.LAST_REQUEST).to.deep.equal({ | ||
method: 'POST', | ||
url: '/v1/checkout_sessions', | ||
headers: {}, | ||
data: { | ||
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: 'test@stripe.com', | ||
}, | ||
success_url: 'https://stripe.com/success', | ||
}, | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.