Comparing version 0.2.0 to 1.0.0
@@ -19,4 +19,4 @@ declare global { | ||
createToken: CreateTokenFunction | null; | ||
checkCreateTokenError: (response: Record<string, any>) => string | null; | ||
checkCreateTokenError: (status: number, response: Record<string, any>) => string | null; | ||
createSource: CreateSourceFunction | null; | ||
} |
@@ -6,3 +6,5 @@ "use strict"; | ||
var useOmiseScript_1 = require("./useOmiseScript"); | ||
var checkCreateTokenError = function (response) { | ||
var checkCreateTokenError = function (status, response) { | ||
if (status === 200) | ||
return null; | ||
if (response.card && !response.card.security_code_check) { | ||
@@ -14,3 +16,3 @@ return 'Incorrect security code'; | ||
} | ||
return null; | ||
return 'Unknown error'; | ||
}; | ||
@@ -17,0 +19,0 @@ exports.checkCreateTokenError = checkCreateTokenError; |
{ | ||
"name": "use-omise", | ||
"version": "0.2.0", | ||
"version": "1.0.0", | ||
"description": "A React hook for Omise payments", | ||
@@ -5,0 +5,0 @@ "author": "Chris Vibert", |
@@ -60,2 +60,3 @@ # use-omise | ||
2. Once loaded, it will initialise `Omise` by setting the public key that you provide | ||
3. Returns you the `createToken` function which can be used to use create tokens, which can then be used to make charges | ||
3. Returns you the `createToken` function which can be used to use create tokens which can then be used to make charges | ||
- Also returned is the `createSource` function for creating sources |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
15214
13
193
1
62