-
Notifications
You must be signed in to change notification settings - Fork 855
Migrate other Stripe infrastructure to TS #1563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d4f0791
3776e5b
133d4a2
818bfc2
e3a86ff
651024f
bd50246
98a9b5c
cc86ba5
9ce094a
a2526b2
2704e87
06a6d4e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,27 @@ | ||
| 'use strict'; | ||
| import crypto = require('crypto'); | ||
|
|
||
| const crypto = require('crypto'); | ||
|
|
||
| const CryptoProvider = require('./CryptoProvider'); | ||
| import CryptoProvider = require('./CryptoProvider'); | ||
|
|
||
| /** | ||
| * `CryptoProvider which uses the Node `crypto` package for its computations. | ||
| */ | ||
| class NodeCryptoProvider extends CryptoProvider { | ||
| /** @override */ | ||
| computeHMACSignature(payload, secret) { | ||
| computeHMACSignature(payload: string, secret: string): string { | ||
| return crypto | ||
| .createHmac('sha256', secret) | ||
| .update(payload, 'utf8') | ||
| .digest('hex'); | ||
| } | ||
|
|
||
| /** @override */ | ||
| async computeHMACSignatureAsync(payload, secret) { | ||
| async computeHMACSignatureAsync( | ||
| payload: string, | ||
| secret: string | ||
| ): Promise<string> { | ||
| const signature = await this.computeHMACSignature(payload, secret); | ||
| return signature; | ||
| } | ||
| } | ||
|
|
||
| module.exports = NodeCryptoProvider; | ||
| export = NodeCryptoProvider; |
Uh oh!
There was an error while loading. Please reload this page.