-
Notifications
You must be signed in to change notification settings - Fork 44
Crossmint Embedded Checkout #437
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
Crossmint Embedded Checkout #437
Conversation
@@ -31,6 +31,8 @@ export let config = { | |||
"subgraphEndpoint": "https://subgraph.satsuma-prod.com/f37507ea64fb/xai/sentry/api", | |||
"publicRPC": "https://arb1.arbitrum.io/rpc", | |||
"alchemyApiKey": "oD4X3JXvJclnt36mDkqnp9CO2sZkNhYT", | |||
"crossmintProjectId": "", //TODO Add Production Values |
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.
I created a chore to add these production values once determined.
@@ -11,6 +11,7 @@ node_modules | |||
dist | |||
dist-ssr | |||
*.local | |||
.env |
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.
Do we have a env file for web-connect ?
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.
Yes, I've now added a sample.env for reference.
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.
It does not make sense to have VITE_APP_ENV
in an .env file. We need to set it on build time, web-connect is statically build, so there is no runtime making use of the .env file. Then, if its in a file we would have to write that file in the build pipeline but we would rather just incejt the environment variable at build step.
Please let me know if that makes sense, then remove the sample.env please.
It would make sense to write a readme that explains why and when this env variable is important to be added and what its used for.
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.
Thank you for the feedback.
How should this below work in a local development environment for the app to know if it is in production or staging?
const environment = process.env.VITE_APP_ENV === 'development' ? 'staging' : 'production';
I was going off our previous Slack convo where you gave me this variable name to use for this purpose.
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.
Per our Slack conversation. .env file added for local development.
ReadMe updated to inform devs.
|
||
const projectId = config.crossmintProjectId; | ||
const collectionId = config.crossmintCollectionId; | ||
const environment = process.env.VITE_APP_ENV === 'production' ? 'production' : 'staging'; |
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.
Please make it so its production by default and staging only when the env is set to development.
We don't want to have an error in setting the env lead to the production site being on crossmint staging this could have terrible consequences.
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.
Done!
case "payment:process.succeeded": | ||
setOrderIdentifier(event.payload.orderIdentifier); | ||
break; | ||
default: |
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.
I don't think we need the default here.
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.
Removed, thank you for the guidance!
case "transaction:fulfillment.failed": | ||
setStatus("failure"); | ||
break; | ||
default: |
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.
lets not have empty defaults.
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.
Removed, thank you for the guidance!
<a | ||
target="_blank" | ||
className="block bg-[#81feab] rounded-lg mt-3 p-3 text-black" | ||
href={`https://staging.crossmint.com/user/collection/polygon-amoy:${result?.contractAddress}:${result?.tokenIds[0]}`} |
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.
Is this link the right one ?
polygon-amoy:
seems to be some other testnet ?
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.
This has been corrected, thank you! Also, just FYI, when I tested before the change, that link did still open up the crossmint website and the key was visible in the wallet.
pnpm-lock.yaml
Outdated
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.
You will want to get the one from fb-tiny-keys, then reinstall your new package and then push the new lock file. Do not merge the lock files.
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.
Done!
@@ -11,6 +11,7 @@ node_modules | |||
dist | |||
dist-ssr | |||
*.local | |||
.env |
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.
It does not make sense to have VITE_APP_ENV
in an .env file. We need to set it on build time, web-connect is statically build, so there is no runtime making use of the .env file. Then, if its in a file we would have to write that file in the build pipeline but we would rather just incejt the environment variable at build step.
Please let me know if that makes sense, then remove the sample.env please.
It would make sense to write a readme that explains why and when this env variable is important to be added and what its used for.
<a | ||
target="_blank" | ||
className="block bg-[#81feab] rounded-lg mt-3 p-3 text-black" | ||
href={`https://staging.crossmint.com/user/collection/arbitrum-sepolia:${result?.contractAddress}:${result?.tokenIds[0]}`} |
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.
This can't be arbitrum-sepolia
in production right ?
If its does not make any difference, then lets make it arbitrum for all environments or make that part conditional depending on the APP_ENV
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.
This has been updated to use the env var to determine the network to use.
|
||
## ENV | ||
|
||
To run locally with development configs, a .env file is required. See sample.env for an example. |
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.
Please add a line about what environment and why its needed. Or add it to the sample.env
…on-styling Updated styling for mint with credit card button
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.
I need this to be merged so I will approve, @XDapps still has to make sure the react fix for putting the crossmint status into a useEffect works properly.
🎉 This PR is included in version 1.2.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Ticket
Updated keysale checkout page to allow users to pay with a credit card using crossmint.
Added variables to the config file for crossmint projectId & collectionId. These need to be updated with production values.
Testing, deployed to Sepolia develop and tested by confirming successful transactions using the test credit card credentials.
Update: Needs PR#443 merged in to this before this is merged.