-
Notifications
You must be signed in to change notification settings - Fork 17
feat: add basic support for PaymentFailure and NextTrade payload types #241
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
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
3a635e2
feat: add support for PaymentFailure and NextTrade payload types
chebizarro 323b3b0
feat: add payment failure and next trade model exports
chebizarro 941ef5d
refactor: remove unused payment_failed import from order state model
chebizarro fe4a5f0
refactor: remove unused payment_failed model import in abstract notifier
chebizarro e811545
feat: add payment failed status and UI handling for failed transactions
chebizarro 885febe
feat: add settled hold invoice status and update payment retry display
chebizarro ed23fca
fix: maintain payment failed status during invoice retry flow and res…
chebizarro c6181e1
Fix Flexible widgets in AlertDialog actions causing crashes
Catrya 3b7dc27
Add spacing between dialog action buttons
Catrya 780480f
fix-overlapping in settings, about and account screens
Catrya d6619a4
Bump version to 1.0.0+4
grunch 92d8b23
fix: allow add invoice action during payment failed state
chebizarro b5f40df
feat: improve payment status messages for better user clarity
Catrya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import 'package:mostro_mobile/data/models/payload.dart'; | ||
|
|
||
| class NextTrade implements Payload { | ||
| final String key; | ||
| final int index; | ||
|
|
||
| NextTrade({required this.key, required this.index}); | ||
|
|
||
| @override | ||
| String get type => 'next_trade'; | ||
|
|
||
| @override | ||
| Map<String, dynamic> toJson() { | ||
| return { | ||
| type: {'key': key, 'index': index}, | ||
| }; | ||
| } | ||
|
|
||
| factory NextTrade.fromJson(Map<String, dynamic> json) { | ||
| return NextTrade( | ||
| key: json['key'] as String, | ||
| index: json['index'] as int, | ||
| ); | ||
| } | ||
|
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import 'package:mostro_mobile/data/models/payload.dart'; | ||
|
|
||
| class PaymentFailed implements Payload { | ||
| final int paymentAttempts; | ||
| final int paymentRetriesInterval; | ||
|
|
||
| PaymentFailed({ | ||
| required this.paymentAttempts, | ||
| required this.paymentRetriesInterval, | ||
| }); | ||
|
|
||
| factory PaymentFailed.fromJson(Map<String, dynamic> json) { | ||
| return PaymentFailed( | ||
| paymentAttempts: json['payment_attempts'] as int, | ||
| paymentRetriesInterval: json['payment_retries_interval'] as int, | ||
| ); | ||
| } | ||
|
|
||
| @override | ||
| String get type => 'payment_failed'; | ||
|
|
||
| @override | ||
| Map<String, dynamic> toJson() { | ||
| return { | ||
| type: { | ||
| 'payment_attempts': paymentAttempts, | ||
| 'payment_retries_interval': paymentRetriesInterval, | ||
| }, | ||
| }; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify model export through data/models.dart.
Based on the coding guidelines, models should be exported through
data/models.dart. Please ensure this newNextTrademodel is added to the exports in that file.🏁 Script executed:
Length of output: 571
Export the NextTrade model in data/models.dart
Please add the new NextTrade model to your central exports so it’s discoverable throughout the app. In
lib/data/models.dart, include:export 'models/payload.dart'; +export 'models/next_trade.dart'; // …other exportsThis aligns with our guideline to re-export all models from
data/models.dart.📝 Committable suggestion
🤖 Prompt for AI Agents