Skip to content

BREAKING CHANGE: : V5 #210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 17, 2025
Merged

BREAKING CHANGE: : V5 #210

merged 3 commits into from
Apr 17, 2025

Conversation

just1and0
Copy link
Owner

@just1and0 just1and0 commented Apr 16, 2025

Description

This PR introduces breaking changes for v5, overhauling the library structure and API. Key changes include consolidating utility functions into a unified module, migrating and updating type definitions and styles, and replacing the legacy Paystack component with a new Provider-based architecture that utilizes hooks.

  • ✅ Simple checkout() or newTransaction() calls
  • ✅ Global callbacks with onGlobalSuccess or onGlobalCancel
  • ✅ Debug logging with debug prop
  • ✅ Fully typed params for transactions
  • ✅ Works seamlessly with Expo & bare React Native
  • ✅ Full test coverage

Issue URL

#209 #204 #194 #208 #123 #194

Before and After

Add Image/video/gifs of changes

Before After
Visual: Visual:
Functionality: Functionality:

- ✅ Simple `checkout()` or `newTransaction()` calls
- ✅ Global callbacks with `onGlobalSuccess` or `onGlobalCancel`
- ✅ Debug logging with `debug` prop
- ✅ Fully typed params for transactions
- ✅ Works seamlessly with Expo & bare React Native
- ✅ Full test coverage
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

- nitpick fix
@just1and0 just1and0 requested a review from Copilot April 16, 2025 17:50
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces breaking changes for v5, overhauling the library structure and API. Key changes include consolidating utility functions into a unified module, migrating and updating type definitions and styles, and replacing the legacy Paystack component with a new Provider-based architecture that utilizes hooks.

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.

Show a summary per file
File Description
development/utils/index.ts Removed as utility functions have been centralized in development/utils.ts
development/utils/helper.ts Removed; its functionality has been merged into the new utils module
development/utils/constants.ts Removed; constants are refactored/redundant in v5
development/utils.ts New unified utility module with updated functions and improved parameter generation
development/usePaystack.tsx Introduces a new hook to access the Paystack context
development/types/index.ts Removed in favor of a consolidated types file
development/types.ts New types file with updated and consolidated type definitions
development/styles.ts New style definitions supporting the Provider's UI
development/style.ts Removed outdated style file
development/paystack.tsx Removed legacy Paystack component, replaced by the new Provider approach
development/index.tsx New entry point exporting the Provider, context, and hook
development/index.ts Removed legacy module export
development/PaystackProvider.tsx New Provider component that encapsulates the WebView logic and manages modal visibility
tests/utils.test.ts Removed outdated tests
tests/index.test.tsx New test file covering the updated utils and Provider functionality
README.md Updated documentation to reflect v5 changes and new usage patterns

@just1and0 just1and0 requested a review from Copilot April 16, 2025 17:52
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

tests/utils.test.ts:1

  • Legacy tests for utility functions were removed. Ensure that the new tests in tests/index.test.ts cover all necessary scenarios to maintain comprehensive test coverage.
Entire file removed

@mosoakinyemi
Copy link
Collaborator

Nice one!
@just1and0 does this address the blank screen issue?
#123

@just1and0
Copy link
Owner Author

Yes i don't get that error in this fix.

@just1and0 just1and0 merged commit 516ed3c into main Apr 17, 2025
1 check passed
Copy link

🎉 This PR is included in version 5.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants