fix: add toast feedback to handleCopy in onramp payment client - #375
Merged
Conversation
Show toast.success on successful clipboard write and toast.error when the write fails, using the existing sonner dependency. Closes kellymusk#1
Replace the stub/commented-out sendSMSNotification with a real implementation that calls the Africa's Talking REST API. Events now sent via SMS: - order_created — payment instructions - payment_received — confirmed, processing started - transfer_complete — funds credited to wallet - transaction_failed — failure with support contact - offramp_initiated — settlement started SMS is skipped gracefully when AT_API_KEY/AT_USERNAME are not set, so existing deployments are unaffected until credentials are added. Also: - Add offramp_initiated message template - Enable sendSMSNotification in notifyOrderUpdate (was commented out) - Document AT_API_KEY, AT_USERNAME, AT_SENDER_ID in .env.example Closes kellymusk#2
Problem: /api/referral/stats was backed by an in-memory Map that reset
on every serverless cold start, losing all referral data.
Fix:
- Add lib/referral/stats-store.ts: Redis-backed store using the
existing Upstash connection (UPSTASH_REDIS_REST_URL / TOKEN).
Falls back to the in-memory analytics store when Redis is not
configured so local dev still works without credentials.
Stored fields per code: ownerAddress, clickCount, conversionCount,
pendingCount, totalRebatesEarned.
- Rewrite app/api/referral/stats/route.ts to call getStats() from
the new store. Errors return zero-filled JSON so the UI never crashes.
- Add pendingCount to ReferralStats type in hooks/use-referral.ts.
- Update components/referral/referral-page-client.tsx to display the
three stats the issue asks for:
• Total referrals (conversionCount)
• Pending referrals (pendingCount)
• Total discount earned (totalRebatesEarned)
Closes kellymusk#3
|
@Silasdotmd is attempting to deploy a commit to the kelly musk's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Silasdotmd Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
3 commits pushed to chore/make-soln — one per issue:
e796cff — Issue #1: Clipboard toast feedback
54f2271 — Issue #2: Africa's Talking SMS integration
(https://api.africastalking.com/version1/messaging)
new offramp_initiated
8265b1f — Issue #3: Persistent referral stats
back to the in-memory analytics store when Redis isn't configured
earned (replacing the old click-count display)
Closes #286
Closes #287
Closes #288