Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

use-omise

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use-omise - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

LICENSE

2

build/index.d.ts
export { useOmise } from './useOmise';
export { useOmiseScript } from './useOmiseScript';
export type { ScriptTypes, useOmiseArgs, CreateTokenAsTypes, CreateTokenHandler, CreateTokenFunction, useOmiseReturn, } from './types';
export type { ScriptTypes, useOmiseArgs, CreateTokenAsTypes, CreateHandler, CreateTokenFunction, CreateSourceFunction, useOmiseReturn, } from './types';

@@ -12,4 +12,5 @@ declare global {

export declare type CreateTokenAsTypes = 'card';
export declare type CreateTokenHandler = (status: number, response: Record<string, any>) => void;
export declare type CreateTokenFunction = (as: CreateTokenAsTypes, attributes: Record<string, any>, handler: CreateTokenHandler) => void;
export declare type CreateHandler = (status: number, response: Record<string, any>) => void;
export declare type CreateTokenFunction = (as: CreateTokenAsTypes, attributes: Record<string, any>, handler: CreateHandler) => void;
export declare type CreateSourceFunction = (type: string, options: Record<string, unknown>, handler: CreateHandler) => void;
export interface useOmiseReturn {

@@ -20,2 +21,3 @@ loading: boolean;

checkCreateTokenError: (response: Record<string, any>) => string | null;
createSource: CreateSourceFunction | null;
}

@@ -19,3 +19,4 @@ "use strict";

var _b = react_1.useState(null), createTokenFn = _b[0], setCreateTokenFn = _b[1];
var _c = useOmiseScript_1.useOmiseScript(scriptType), loadingScript = _c[0], errorLoadingScript = _c[1];
var _c = react_1.useState(null), createSourceFn = _c[0], setCreateSourceFn = _c[1];
var _d = useOmiseScript_1.useOmiseScript(scriptType), loadingScript = _d[0], errorLoadingScript = _d[1];
react_1.useEffect(function () {

@@ -28,7 +29,11 @@ if (window.Omise) {

if (window.Omise) {
var Omise_1 = window.Omise;
var createToken = function () {
var Omise = window.Omise;
return Omise.createToken.bind(Omise);
return Omise_1.createToken.bind(Omise_1);
};
var createSource = function () {
return Omise_1.createSource.bind(Omise_1);
};
setCreateTokenFn(createToken);
setCreateSourceFn(createSource);
}

@@ -41,4 +46,5 @@ }, [loadingScript]);

checkCreateTokenError: exports.checkCreateTokenError,
createSource: createSourceFn,
};
};
exports.useOmise = useOmise;
{
"name": "use-omise",
"version": "0.1.0",
"version": "0.2.0",
"description": "A React hook for Omise payments",

@@ -13,2 +13,3 @@ "author": "Chris Vibert",

"prepublishOnly": "yarn test && yarn build",
"preversion": "yarn test",
"test": "jest"

@@ -20,2 +21,6 @@ },

},
"keywords": [
"react",
"omise"
],
"devDependencies": {

@@ -22,0 +27,0 @@ "@testing-library/react-hooks": "^3.7.0",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc