react-paystack
Advanced tools
Comparing version 4.0.2 to 4.0.3
export { default as usePaystackPayment } from './use-paystack'; | ||
export { default as PaystackButton } from './paystack-button'; | ||
export { default as PaystackConsumer } from './paystack-consumer'; |
@@ -51,2 +51,3 @@ import React, { useState, useEffect, createContext, forwardRef, useContext } from 'react'; | ||
/* eslint-disable */ | ||
var callPaystackPop = function (paystackArgs) { | ||
@@ -53,0 +54,0 @@ // @ts-ignore |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
var React = require('react'); | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var React__default = /*#__PURE__*/_interopDefaultLegacy(React); | ||
var cachedScripts = []; | ||
@@ -59,2 +53,3 @@ function usePaystackScript() { | ||
/* eslint-disable */ | ||
var callPaystackPop = function (paystackArgs) { | ||
@@ -149,3 +144,3 @@ // @ts-ignore | ||
var initializePayment = usePaystackPayment(others); | ||
return (React__default["default"].createElement("button", { className: className, onClick: function () { return initializePayment(onSuccess, onClose); } }, text || children)); | ||
return (React.createElement("button", { className: className, onClick: function () { return initializePayment(onSuccess, onClose); } }, text || children)); | ||
}; | ||
@@ -162,3 +157,3 @@ | ||
var initializePayment = usePaystackPayment(others); | ||
return (React__default["default"].createElement(PaystackContext.Provider, { value: { initializePayment: initializePayment, onSuccess: onSuccess, onClose: onClose } }, children)); | ||
return (React.createElement(PaystackContext.Provider, { value: { initializePayment: initializePayment, onSuccess: onSuccess, onClose: onClose } }, children)); | ||
}; | ||
@@ -177,4 +172,4 @@ | ||
var onClose = paraClose ? paraClose : function () { return null; }; | ||
return (React__default["default"].createElement(PaystackProvider, __assign({}, others, { onSuccess: onSuccess, onClose: onClose }), | ||
React__default["default"].createElement(PaystackConsumerChild, { ref: ref }, children))); | ||
return (React.createElement(PaystackProvider, __assign({}, others, { onSuccess: onSuccess, onClose: onClose }), | ||
React.createElement(PaystackConsumerChild, { ref: ref }, children))); | ||
}); | ||
@@ -181,0 +176,0 @@ |
@@ -1,1 +0,1 @@ | ||
export declare const callPaystackPop: (paystackArgs: Record<string, any>) => void; | ||
export declare let callPaystackPop: (paystackArgs: Record<string, any>) => void; |
@@ -0,0 +0,0 @@ import { ReactNode } from 'react'; |
@@ -0,0 +0,0 @@ import React from 'react'; |
/// <reference types="react" /> | ||
import { callback } from './types'; | ||
declare type IPaystackContext = { | ||
type IPaystackContext = { | ||
initializePayment: (arg0: callback, arg1: callback) => void; | ||
@@ -5,0 +5,0 @@ onSuccess: () => void; |
@@ -0,0 +0,0 @@ import { callback, PaystackProps } from './types'; |
export default function usePaystackScript(): boolean[]; |
@@ -0,0 +0,0 @@ export declare const config: { |
export {}; |
export {}; |
export {}; |
export {}; |
@@ -1,5 +0,5 @@ | ||
declare type Currency = 'NGN' | 'GHS' | 'USD' | 'ZAR'; | ||
declare type PaymentChannels = 'bank' | 'card' | 'qr' | 'ussd' | 'mobile_money'; | ||
declare type Bearer = 'account' | 'subaccount'; | ||
declare type phone = number | string; | ||
type Currency = 'NGN' | 'GHS' | 'USD' | 'ZAR' | 'KES' | 'XOF'; | ||
type PaymentChannels = 'bank' | 'card' | 'qr' | 'ussd' | 'mobile_money' | 'eft' | 'bank_transfer' | 'payattitude'; | ||
type Bearer = 'account' | 'subaccount'; | ||
type phone = number | string; | ||
interface PaystackCustomFields { | ||
@@ -16,3 +16,3 @@ display_name: string; | ||
} | ||
export declare type callback = () => void; | ||
export type callback = (response?: any) => void; | ||
export interface PaystackProps { | ||
@@ -19,0 +19,0 @@ publicKey: string; |
import { PaystackProps } from './types'; | ||
export default function usePaystackPayment(options: PaystackProps): (callback?: () => void, onClose?: () => void) => void; |
@@ -6,8 +6,8 @@ { | ||
"dependencies": { | ||
"@testing-library/jest-dom": "5.14.1", | ||
"@testing-library/react": "12.1.0", | ||
"@testing-library/user-event": "13.2.1", | ||
"react": "17.0.2", | ||
"react-dom": "17.0.2", | ||
"react-scripts": "4.0.3" | ||
"@testing-library/jest-dom": "^5.16.5", | ||
"@testing-library/react": "^14.0.0", | ||
"@testing-library/user-event": "^14.4.3", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-scripts": "^5.0.1" | ||
}, | ||
@@ -14,0 +14,0 @@ "scripts": { |
@@ -10,6 +10,6 @@ import React from 'react'; | ||
amount: 20000, | ||
publicKey: 'pk_live_9555ee2309d44add3c9dc417fe56d6c9f72f0082', | ||
publicKey: 'pk_test_a137d402b5975716e89952a898aad2832c961d69', | ||
firstname: 'cool', | ||
lastname: 'story', | ||
split: { //if you want to use transaction split | ||
/*split: { //if you want to use transaction split | ||
"type": "percentage", | ||
@@ -27,3 +27,3 @@ "bearer_type": "all", | ||
] | ||
} | ||
}*/ | ||
}; | ||
@@ -33,3 +33,3 @@ | ||
// Implementation for whatever you want to do with reference and after success call. | ||
console.log(reference); | ||
console.log('reference',reference); | ||
}; | ||
@@ -36,0 +36,0 @@ |
export { default as usePaystackPayment } from './use-paystack'; | ||
export { default as PaystackButton } from './paystack-button'; | ||
export { default as PaystackConsumer } from './paystack-consumer'; |
@@ -51,2 +51,3 @@ import React, { useState, useEffect, createContext, forwardRef, useContext } from 'react'; | ||
/* eslint-disable */ | ||
var callPaystackPop = function (paystackArgs) { | ||
@@ -53,0 +54,0 @@ // @ts-ignore |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
var React = require('react'); | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var React__default = /*#__PURE__*/_interopDefaultLegacy(React); | ||
var cachedScripts = []; | ||
@@ -59,2 +53,3 @@ function usePaystackScript() { | ||
/* eslint-disable */ | ||
var callPaystackPop = function (paystackArgs) { | ||
@@ -149,3 +144,3 @@ // @ts-ignore | ||
var initializePayment = usePaystackPayment(others); | ||
return (React__default["default"].createElement("button", { className: className, onClick: function () { return initializePayment(onSuccess, onClose); } }, text || children)); | ||
return (React.createElement("button", { className: className, onClick: function () { return initializePayment(onSuccess, onClose); } }, text || children)); | ||
}; | ||
@@ -162,3 +157,3 @@ | ||
var initializePayment = usePaystackPayment(others); | ||
return (React__default["default"].createElement(PaystackContext.Provider, { value: { initializePayment: initializePayment, onSuccess: onSuccess, onClose: onClose } }, children)); | ||
return (React.createElement(PaystackContext.Provider, { value: { initializePayment: initializePayment, onSuccess: onSuccess, onClose: onClose } }, children)); | ||
}; | ||
@@ -177,4 +172,4 @@ | ||
var onClose = paraClose ? paraClose : function () { return null; }; | ||
return (React__default["default"].createElement(PaystackProvider, __assign({}, others, { onSuccess: onSuccess, onClose: onClose }), | ||
React__default["default"].createElement(PaystackConsumerChild, { ref: ref }, children))); | ||
return (React.createElement(PaystackProvider, __assign({}, others, { onSuccess: onSuccess, onClose: onClose }), | ||
React.createElement(PaystackConsumerChild, { ref: ref }, children))); | ||
}); | ||
@@ -181,0 +176,0 @@ |
@@ -1,1 +0,1 @@ | ||
export declare const callPaystackPop: (paystackArgs: Record<string, any>) => void; | ||
export declare let callPaystackPop: (paystackArgs: Record<string, any>) => void; |
@@ -0,0 +0,0 @@ import { ReactNode } from 'react'; |
@@ -0,0 +0,0 @@ import React from 'react'; |
/// <reference types="react" /> | ||
import { callback } from './types'; | ||
declare type IPaystackContext = { | ||
type IPaystackContext = { | ||
initializePayment: (arg0: callback, arg1: callback) => void; | ||
@@ -5,0 +5,0 @@ onSuccess: () => void; |
@@ -0,0 +0,0 @@ import { callback, PaystackProps } from './types'; |
export default function usePaystackScript(): boolean[]; |
@@ -0,0 +0,0 @@ export declare const config: { |
export {}; |
@@ -1,5 +0,5 @@ | ||
declare type Currency = 'NGN' | 'GHS' | 'USD' | 'ZAR'; | ||
declare type PaymentChannels = 'bank' | 'card' | 'qr' | 'ussd' | 'mobile_money'; | ||
declare type Bearer = 'account' | 'subaccount'; | ||
declare type phone = number | string; | ||
type Currency = 'NGN' | 'GHS' | 'USD' | 'ZAR' | 'KES' | 'XOF'; | ||
type PaymentChannels = 'bank' | 'card' | 'qr' | 'ussd' | 'mobile_money' | 'eft' | 'bank_transfer' | 'payattitude'; | ||
type Bearer = 'account' | 'subaccount'; | ||
type phone = number | string; | ||
interface PaystackCustomFields { | ||
@@ -16,3 +16,3 @@ display_name: string; | ||
} | ||
export declare type callback = () => void; | ||
export type callback = (response?: any) => void; | ||
export interface PaystackProps { | ||
@@ -19,0 +19,0 @@ publicKey: string; |
import { PaystackProps } from './types'; | ||
export default function usePaystackPayment(options: PaystackProps): (callback?: () => void, onClose?: () => void) => void; |
@@ -31,3 +31,3 @@ type Currency = 'NGN' | 'GHS' | 'USD' | 'ZAR' | 'KES' | 'XOF'; | ||
export type callback = (error?: any, response?: any) => void; | ||
export type callback = (response?: any) => void; | ||
@@ -34,0 +34,0 @@ export interface PaystackProps { |
{ | ||
"name": "react-paystack", | ||
"version": "4.0.2", | ||
"version": "4.0.3", | ||
"description": "This is an reactJS library for implementing paystack payment gateway", | ||
@@ -10,4 +10,4 @@ "main": "dist/index.js", | ||
"scripts": { | ||
"build": "rm -rf dist && rollup -c ", | ||
"build:watch": "rm -rf dist && rollup -c --watch", | ||
"build": "rm -rf dist && rollup -c --bundleConfigAsCjs", | ||
"build:watch": "rm -rf dist && rollup -c --watch --bundleConfigAsCjs", | ||
"format": "prettier --write '**/**/*.{js,}'", | ||
@@ -43,30 +43,30 @@ "lint": "eslint --ext .js,.ts,.tsx,.jsx --ignore-path .eslintignore .", | ||
"devDependencies": { | ||
"@babel/core": "^7.18.10", | ||
"@babel/preset-env": "^7.18.10", | ||
"@babel/preset-typescript": "^7.18.6", | ||
"@rollup/plugin-commonjs": "^22.0.2", | ||
"@rollup/plugin-node-resolve": "^13.3.0", | ||
"@rollup/plugin-typescript": "^8.3.4", | ||
"@testing-library/react": "^13.3.0", | ||
"@babel/core": "^7.21.4", | ||
"@babel/preset-env": "^7.21.4", | ||
"@babel/preset-typescript": "^7.21.4", | ||
"@rollup/plugin-commonjs": "^24.0.1", | ||
"@rollup/plugin-node-resolve": "^15.0.1", | ||
"@rollup/plugin-typescript": "^11.0.0", | ||
"@testing-library/react": "^14.0.0", | ||
"@testing-library/react-hooks": "^8.0.1", | ||
"@types/jest": "^28.1.6", | ||
"@types/react": "^18.0.15", | ||
"@types/react-dom": "^18.0.6", | ||
"@typescript-eslint/eslint-plugin": "^5.32.0", | ||
"@typescript-eslint/parser": "^5.32.0", | ||
"@types/jest": "^29.5.0", | ||
"@types/react": "^18.0.32", | ||
"@types/react-dom": "^18.0.11", | ||
"@typescript-eslint/eslint-plugin": "^5.57.0", | ||
"@typescript-eslint/parser": "^5.57.0", | ||
"babel-eslint": "^10.1.0", | ||
"babel-jest": "^28.1.3", | ||
"eslint": "^8.21.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"babel-jest": "^29.5.0", | ||
"eslint": "^8.37.0", | ||
"eslint-config-prettier": "^8.8.0", | ||
"eslint-config-standard": "^17.0.0", | ||
"eslint-plugin-jest": "^26.7.0", | ||
"eslint-plugin-jest": "^27.2.1", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"eslint-plugin-react": "^7.30.1", | ||
"jest": "^28.1.3", | ||
"jest-environment-jsdom": "^28.1.3", | ||
"prettier": "^2.7.1", | ||
"eslint-plugin-react": "^7.32.2", | ||
"jest": "^29.5.0", | ||
"jest-environment-jsdom": "^29.5.0", | ||
"prettier": "^2.8.7", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-test-renderer": "^18.2.0", | ||
"rollup": "^2.77.2", | ||
"rollup": "^3.20.2", | ||
"rollup-plugin-babel": "^4.4.0", | ||
@@ -76,6 +76,6 @@ "rollup-plugin-commonjs": "^10.1.0", | ||
"rollup-plugin-peer-deps-external": "^2.2.4", | ||
"rollup-plugin-typescript2": "^0.32.1", | ||
"ts-jest": "^28.0.7", | ||
"typescript": "^4.7.4" | ||
"rollup-plugin-typescript2": "^0.34.1", | ||
"ts-jest": "^29.1.0", | ||
"typescript": "^5.0.3" | ||
} | ||
} |
@@ -29,3 +29,2 @@ { | ||
"isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ | ||
"suppressImplicitAnyIndexErrors": true, | ||
/* Strict Type-Checking Options */ | ||
@@ -32,0 +31,0 @@ "strict": true, /* Enable all strict type-checking options. */ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
2096212
27592