Skip to content
This repository was archived by the owner on Oct 4, 2023. It is now read-only.

[PAY-1589] Wire up Stripe Onramp in mobile - #3814

Merged
dharit-tan merged 4 commits into
mainfrom
rt-stripe-mobile
Jul 29, 2023
Merged

dharit-tan merged 4 commits into
mainfrom
rt-stripe-mobile

Conversation

@dharit-tan

Copy link
Copy Markdown
Contributor

Description

Wire up stripe onramp flow in mobile using a webview. Adds a libs fn to create a stripe session via identity. Still using sol bc haven't updated the identity endpoint to support usdc yet.

Dragons

  • cc @dylanjeffers to check package-lock changes, followed your steps from last time so hopefully it's good!
  • Duplicating code in buyCrypto.ts that already exists in web in BuyAudio.ts, but using different libs so don't think this makes sense to share.

How Has This Been Tested?

Local ios stage

Simulator.Screen.Recording.-.iPhone.14.Pro.-.2023-07-28.at.13.19.16.mp4

How will this change be monitored?

For features that are critical or could fail silently please describe the monitoring/alerting being added.

Feature Flags

Are all new features properly feature flagged? Describe added feature flags.

@gitguardian

gitguardian Bot commented Jul 28, 2023 •

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id Secret Commit Filename
2858198 Generic High Entropy Secret 3e7de0f packages/mobile/.env.prod View secret
2858199 Generic High Entropy Secret cbcb0c0 packages/mobile/.env.stage View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

Comment thread packages/mobile/.env.stage
@audius-infra

Copy link
Copy Markdown
Collaborator

It looks like there may be some changes to native mobile code, which requires triggering a full app release. Please follow the instructions here: https://www.notion.so/audiusproject/When-to-bump-app-version-2644a8f772364a4d91f44abcba44ce0b?pvs=4. cc @nicoback2 @sliptype

@schottra schottra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Very cool!


const handleBuyPress = useCallback(async () => {
try {
const res = await createStripeSession({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So, isn't there already a function in web that does this? I was hoping we could move things like that to common.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agree. There is an equivalent fn in web, but libs there is attached to window whereas in mobile it's not. We could pass in libs I guess but that feels a bit weird/not sure if that's a pattern we want to follow. Any thoughts @rickyrombo ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

need to think on this one more. I think what we have here is good for now, but we definitely need to establish a "meta" for libs/sdk

}
}, [])

const html = `

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't suppose there's a way we could put this into an actual html file and import it? So we get a better editing experience.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

spoke with @rickyrombo I think we'd have to host the file somewhere. Totally agree but just think it's not worth the hassle.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

omg!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

seeing ppl in the comments complaining that this doesn't work on android. just tried testing on android but build failed :(. would like to merge this for now and create a ticket to follow-on + test on android.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yeah low pri, I don't think we're going to be iterating on this much.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

FWIW, I wasn't imaging bundling the file and loading it from an external location at runtime. I had thought we could just use our build tooling to embed the HTML into the module at build time. It was more a developer experience suggestion than anything as having a separate HTML file makes it easier to maintain. But this is fine for now!

Comment thread packages/mobile/src/services/buyCrypto.ts
@dharit-tan
dharit-tan requested a review from rickyrombo July 28, 2023 21:45
@audius-infra

Copy link
Copy Markdown
Collaborator

It looks like there may be some changes to native mobile code, which requires triggering a full app release. Please follow the instructions here: https://www.notion.so/audiusproject/When-to-bump-app-version-2644a8f772364a4d91f44abcba44ce0b?pvs=4. cc @nicoback2 @sliptype

@audius-infra

Copy link
Copy Markdown
Collaborator

Preview this change https://demo.audius.co/rt-stripe-mobile

@rickyrombo rickyrombo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good stuff!

@dharit-tan
dharit-tan merged commit d2630a8 into main Jul 29, 2023
@dharit-tan
dharit-tan deleted the rt-stripe-mobile branch July 29, 2023 16:51
schottra added a commit that referenced this pull request Aug 1, 2023
* origin/main:
  Update userbank function usage to pass config object (#3823)
  Update dapp-store build artifacts
  [C-2857] Revert remove get blocknumber (#3802)" (#3826)
  [C-2742] Multi-track form pagination (#3818)
  Bump mobile versions for client v1.5.35 full app release (#3827)
  Revert "Add purchased + reposted tracks to library PAY-1633  (#3820)" (#3825)
  Add purchased + reposted tracks to library PAY-1633  (#3820)
  Update SDK version + ActivityFull type (#3819)
  Use audius-query in USDC Purchase Drawer (#3822)
  Update bootstrap nodes (#3821)
  [PAY-1589] Wire up Stripe Onramp in mobile (#3814)
  v1.5.35
  Add favorite test and fix aria-label (#3817)
  [C-2908 C-2744] fix desktop follow button (#3816)
audius-infra pushed a commit that referenced this pull request Aug 5, 2023
[f9e1380] Add DirectMessages Banner and Update All Banners (#3851) Marcus Pasell
[e523d39] [PAY-1692] Rewrite 'Share to DMs' using less stateful logic (#3852) Marcus Pasell
[af62892] [C-2675][C-2692] Add multi track navigation sidebar and form controls (#3847) Andrew Mendelsohn
[ee38400] Fix send audio flow (#3850) Reed
[bd1752b] Update SDK to latest 3.0.3-beta.109 (#3849) nicoback2
[6988a03] Add npm run clean script (#3846) Reed
[68bd638] DMs: Web: Don't nav back when clicking outside the modal (#3844) Marcus Pasell
[1f7d7d0] Add prepare step to dapp-store ci flow (#3841) Raymond Jacobson
[6c87efd] [Harmony] Add SelectablePill to Harmony PAY-1654 (#3803) nicoback2
[69fbfb3] [PAY-1688] Mobile: Share track, collection to DMs (#3840) Marcus Pasell
[f2f9717] Disable upload redesign (#3842) Andrew Mendelsohn
[9671c06] Update dapp-store build artifacts audius-infra
[77b4030] Update dapp-store build artifacts audius-infra
[baedc13] Fix dapp store deployment (#3829) Raymond Jacobson
[bcb5137] [C-2907] Add contextual-menu, refactor release-date-field (#3836) Dylan Jeffers
[df90566] [PAY-1687] Web: Share tracks, playlists, and albums via Direct Message (#3828) Marcus Pasell
[ec16cc3] Upgrade sdk to beta.105 to fix rewards claiming (#3839) Dylan Jeffers
[270cc2f] [C-2923] Fix toasts in modal screens (#3838) Dylan Jeffers
[18616df] Add cypress upload test for subgenre (#3833) Raymond Jacobson
[8a76f7c] [PAY-1685] Wire up stripe UI for USDC purchase in mobile (#3837) Reed
[6337949] Fix broken track upload for electronic subgenres on mobile (#3835) nicoback2
[f643695] Fix tag input (#3832) Andrew Mendelsohn
[5da8e8f] Update userbank function usage to pass config object (#3823) Randy Schott
[8a5419d] Update dapp-store build artifacts audius-infra
[6284c14] [C-2857] Revert remove get blocknumber (#3802)" (#3826) Dylan Jeffers
[6a54b3a] [C-2742] Multi-track form pagination (#3818) Andrew Mendelsohn
[65471a1] Bump mobile versions for client v1.5.35 full app release (#3827) nicoback2
[6c88515] Revert "Add purchased + reposted tracks to library PAY-1633  (#3820)" (#3825) nicoback2
[8dc4c8a] Add purchased + reposted tracks to library PAY-1633  (#3820) nicoback2
[5ddf078] Update SDK version + ActivityFull type (#3819) nicoback2
[c643b8a] Use audius-query in USDC Purchase Drawer (#3822) Reed
[a119db1] Update bootstrap nodes (#3821) Theo Ilie
[d2630a8] [PAY-1589] Wire up Stripe Onramp in mobile (#3814) Reed
@AudiusProject AudiusProject deleted a comment from linear Bot Sep 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants