-
Notifications
You must be signed in to change notification settings - Fork 765
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2039 from stripe/latest-codegen-beta
Update generated code for beta
- Loading branch information
Showing
56 changed files
with
1,052 additions
and
195 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 |
---|---|---|
@@ -1 +1 @@ | ||
v879 | ||
v896 |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// File generated from our OpenAPI spec | ||
|
||
export const ApiVersion = '2023-10-16'; | ||
export const PreviewVersion = '2024-02-15.preview-v2'; | ||
export const PreviewVersion = '2024-03-20.preview-v2'; |
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,11 @@ | ||
// File generated from our OpenAPI spec | ||
|
||
import {StripeResource} from '../../StripeResource.js'; | ||
const stripeMethod = StripeResource.method; | ||
export const ActiveEntitlements = StripeResource.extend({ | ||
list: stripeMethod({ | ||
method: 'GET', | ||
fullPath: '/v1/entitlements/active_entitlements', | ||
methodType: 'list', | ||
}), | ||
}); |
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,16 @@ | ||
// File generated from our OpenAPI spec | ||
|
||
import {StripeResource} from '../../StripeResource.js'; | ||
const stripeMethod = StripeResource.method; | ||
export const Requests = StripeResource.extend({ | ||
create: stripeMethod({method: 'POST', fullPath: '/v1/forwarding/requests'}), | ||
retrieve: stripeMethod({ | ||
method: 'GET', | ||
fullPath: '/v1/forwarding/requests/{id}', | ||
}), | ||
list: stripeMethod({ | ||
method: 'GET', | ||
fullPath: '/v1/forwarding/requests', | ||
methodType: 'list', | ||
}), | ||
}); |
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
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import {Stripe} from 'stripe'; | ||
import assert from 'assert'; | ||
|
||
// API key is null to trigger an authentication error | ||
const stripe = new Stripe(null, { | ||
host: process.env.STRIPE_MOCK_HOST || 'localhost', | ||
port: process.env.STRIPE_MOCK_PORT || 12111, | ||
protocol: 'http', | ||
}); | ||
|
||
try { | ||
throw new stripe.errors.StripeUnknownError({ | ||
charge: 'foo', | ||
unknown_prop: 'bar', | ||
}); | ||
} catch (e) { | ||
assert (e instanceof stripe.errors.StripeUnknownError); | ||
assert (e.type === 'StripeUnknownError'); | ||
} | ||
|
||
async function exampleFunction(args) { | ||
try { | ||
await stripe.paymentIntents.create(args); | ||
} catch (e) { | ||
assert (e instanceof stripe.errors.StripeAuthenticationError); | ||
assert (e.type === 'StripeAuthenticationError'); | ||
} | ||
} | ||
|
||
exampleFunction({ | ||
// The required parameter currency is missing | ||
amount: 2000, | ||
confirm: true, | ||
payment_method: 'pm_card_visa', | ||
}); |
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 @@ | ||
{ | ||
"name": "mjs", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"dependencies": { | ||
"stripe": "file:../../" | ||
}, | ||
"scripts": { | ||
"clean": "rm -rf node_modules && rm -rf dist", | ||
"build": "esbuild index.js --bundle --platform=node --minify --target=es2020 --outdir=dist", | ||
"start": "node dist/index.js" | ||
}, | ||
"devDependencies": { | ||
"esbuild": "^0.20.2" | ||
} | ||
} |
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.