Git Product home page Git Product logo

Comments (5)

mjallday avatar mjallday commented on August 12, 2024

It's not a buyer without a card URI though right?

Does just

balanced.Account(email_address=email_address).save() 

work? I don't believe you need to specify a URI.

from balanced-python.

SecurityForUs avatar SecurityForUs commented on August 12, 2024

@mjallday That works too. While I know a buyer isn't a buyer w/o a card, just I wanted to add a card to the account regardless, but create the account only if it's there.

I know you can simply do an except and check if the category_code = 'duplicate-email-address', but for those who want to have the user be added to their marketplace on registration w/o forcing them to add a card, it helps to know there's a method for it.

from balanced-python.

mjallday avatar mjallday commented on August 12, 2024

Sounds like something like:

 balanced.Marketplace.my_marketplace.create_account(...)

Is what you want?

Or given that you mentioned the duplicate email address is something more like

 balanced.Account.find_or_create(...) 

better?

from balanced-python.

SecurityForUs avatar SecurityForUs commented on August 12, 2024

create_account() would work, but I think find_or_create() would be more streamlined and would eliminate the necessity of checking for the specific exception.

from balanced-python.

remear avatar remear commented on August 12, 2024

Account is long deprecated.

from balanced-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.