Skip to content

Commit

Permalink
Merge pull request #98 from iamraphson/feature/paystack-connect
Browse files Browse the repository at this point in the history
Implement connect into React Paystack
  • Loading branch information
iamraphson authored Apr 25, 2024
2 parents 0201be2 + 47955d6 commit 196b0a6
Show file tree
Hide file tree
Showing 11 changed files with 560 additions and 317 deletions.
4 changes: 3 additions & 1 deletion dist/index.es.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.es.js.map

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions dist/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ interface PaystackMetadata {
interface PaystackMetadata {
[key: string]: any;
}
interface PaystackConnectSplit {
account_id: string;
share: number;
}
export type callback = (response?: any) => void;
export interface PaystackProps {
publicKey: string;
Expand All @@ -34,6 +38,8 @@ export interface PaystackProps {
'data-custom-button'?: string;
split_code?: string;
split?: Record<string, any>;
connect_split?: PaystackConnectSplit[];
connect_account?: string;
}
export type InitializePayment = (options: {
onSuccess?: callback;
Expand Down
24 changes: 12 additions & 12 deletions example/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@ const PaystackHookExample = () => {
};

const PaystackHookSplitParameterExample = () => {
const initializePayment = usePaystackPayment(config);
return (
<div>
<button
onClick={() => {
initializePayment({config: {currency: 'NGN'}, onSuccess, onClose});
}}
>
Paystack Hooks with split parameter Implementation
</button>
</div>
);
const initializePayment = usePaystackPayment(config);
return (
<div>
<button
onClick={() => {
initializePayment({config: {currency: 'NGN'}, onSuccess, onClose});
}}
>
Paystack Hooks with split parameter Implementation
</button>
</div>
);
};

function App() {
Expand Down
Loading

0 comments on commit 196b0a6

Please sign in to comment.