Skip to content
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

feat(platform): Implement top-up flow for PAYG System #9050

Draft
wants to merge 11 commits into
base: dev
Choose a base branch
from

Conversation

kcze
Copy link
Contributor

@kcze kcze commented Dec 18, 2024

WIP

Changes πŸ—οΈ

Checklist πŸ“‹

For code changes:

  • I have clearly listed my changes in the PR description
  • I have made a test plan
  • I have tested my changes according to the test plan:
    • ...
Example test plan
  • Create from scratch and execute an agent with at least 3 blocks
  • Import an agent from file upload, and confirm it executes correctly
  • Upload agent to marketplace
  • Import an agent from marketplace and confirm it executes correctly
  • Edit an agent from monitor, and confirm it executes correctly

For configuration changes:

  • .env.example is updated or already compatible with my changes
  • docker-compose.yml is updated or already compatible with my changes
  • I have included a list of my configuration changes in the PR description (under Changes)
Examples of configuration changes
  • Changing ports
  • Adding new services that need to communicate with each other
  • Secrets or environment variable changes
  • New or infrastructure changes such as databases

@github-actions github-actions bot added platform/frontend AutoGPT Platform - Front end platform/backend AutoGPT Platform - Back end size/l labels Dec 18, 2024
Copy link

netlify bot commented Dec 18, 2024

βœ… Deploy Preview for auto-gpt-docs-dev canceled.

Name Link
πŸ”¨ Latest commit 76b5259
πŸ” Latest deploy log https://app.netlify.com/sites/auto-gpt-docs-dev/deploys/677024e1aa0cb900080e92db

Copy link

netlify bot commented Dec 18, 2024

βœ… Deploy Preview for auto-gpt-docs canceled.

Name Link
πŸ”¨ Latest commit 76b5259
πŸ” Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/677024e1f6e23600086676d9

Comment on lines +241 to +244
await User.prisma().update(
where={"id": user_id}, data={"stripeCustomerId": customer.id}
)
user.stripeCustomerId = customer.id
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
await User.prisma().update(
where={"id": user_id}, data={"stripeCustomerId": customer.id}
)
user.stripeCustomerId = customer.id
user = await User.prisma().update(
where={"id": user_id}, data={"stripeCustomerId": customer.id}
)

Copy link
Contributor

Choose a reason for hiding this comment

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

Or even better: avoid calling Prisma here and add set_stripe_customer_id in model class on user.py

}
],
mode="payment",
success_url="",# TODO kcze
Copy link
Contributor

Choose a reason for hiding this comment

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

So these will be webhook URLs ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are redirect urls after checkout


if (!stripe) {
console.error("Stripe failed to load");
return;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we throw an error instead ?

@kcze kcze changed the title feat(backend): Implement top-up flow for PAYG System feat(platform): Implement top-up flow for PAYG System Dec 27, 2024
@github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label Dec 28, 2024
Copy link
Contributor

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conflicts Automatically applied to PRs with merge conflicts platform/backend AutoGPT Platform - Back end platform/frontend AutoGPT Platform - Front end size/l
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants