Skip to content

fix: add toast feedback to handleCopy in onramp payment client - #375

Merged
henrypeters merged 4 commits into
kellymusk:mainfrom
Silasdotmd:chore/make-soln
Jul 30, 2026
Merged

fix: add toast feedback to handleCopy in onramp payment client #375
henrypeters merged 4 commits into
kellymusk:mainfrom
Silasdotmd:chore/make-soln

Conversation

@Silasdotmd

Copy link
Copy Markdown
Contributor

3 commits pushed to chore/make-soln — one per issue:

e796cff — Issue #1: Clipboard toast feedback

  • Imported toast from sonner in onramp-payment-client.tsx
  • handleCopy now calls toast.success('Copied to clipboard') on success and toast.error(...) on failure

54f2271 — Issue #2: Africa's Talking SMS integration

  • Rewrote sendSMSNotification in lib/onramp/notifications.ts to call the Africa's Talking REST API
    (https://api.africastalking.com/version1/messaging)
  • Covers all 4 events: order_created, payment_received, transfer_complete, transaction_failed, plus the
    new offramp_initiated
  • Gracefully skips SMS when AT_API_KEY/AT_USERNAME aren't set (safe for existing deployments)
  • Enabled the SMS call in notifyOrderUpdate (was commented out)
  • Added AT_API_KEY, AT_USERNAME, AT_SENDER_ID to .env.example

8265b1f — Issue #3: Persistent referral stats

  • Created lib/referral/stats-store.ts — Redis-backed store using the existing Upstash connection; falls
    back to the in-memory analytics store when Redis isn't configured
  • Rewrote app/api/referral/stats/route.ts to use the persistent store
  • Updated ReferralStats type to include pendingCount
  • Updated referral-page-client.tsx to display: Total referrals, Pending referrals, and Total discount
    earned (replacing the old click-count display)

Closes #286

Closes #287

Closes #288

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
@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

@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.

@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@henrypeters
henrypeters merged commit 95622b1 into kellymusk:main Jul 30, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants