How iamraphson/react-paystack works
react-paystack is a React wrapper for initiating Paystack payments. An application supplies transaction configuration and success/close callbacks through a hook, button, or context consumer; each route reaches shared payment-argument preparation and the Paystack Inline integration. The README also documents metadata and additional transaction options. The implementation of the action module and the Inline dependency was not sampled, so their internal behavior is not expanded.
Main entry points: index.ts Public exports · use-paystack.ts Payment hook · paystack-consumer.tsx Context consumer · paystack-provider.tsx Context provider
Components 10
React API
- Public exports
libs/index.ts - Payment hook
libs/use-paystack.ts - Payment button
libs/paystack-button.tsx - Context consumer
libs/paystack-consumer.tsx
Payment Flow
- Context provider
libs/paystack-provider.tsx - Payment context
libs/paystack-context.ts - Payment options
libs/types.ts
Gateway Integration
- Paystack actions
libs/paystack-actions.ts - Paystack Inline
Other components
- React application
Connections 11
- React application → Public exports: imports API
- Public exports → Payment hook: exports
- Public exports → Payment button: exports
- Public exports → Context consumer: exports
- Payment button → Payment hook: calls
- Context consumer → Context provider: renders
- Context provider → Payment hook: calls
- Context provider → Payment context: provides values
- Context consumer → Payment context: reads values
- Payment hook → Paystack actions: calls
- Paystack actions → Paystack Inline: invokes