Giter VIP home page Giter VIP logo

Comments (4)

ggrammar avatar ggrammar commented on July 17, 2024 1

@peterskipper Excellent question! pay_with and place use two distinct (but similar-looking) URL endpoints.

You can see the actual endpoints in the urls module here. There's one API for getting a price for the order, and then another one for actually placing it. So, you could repeatedly price your order as you add toppings etc, and then place it once you've confirmed your price looks as intended.

Actually, our current request to the price_url doesn't even use the card object you pass in - I'm not sure why this is. Maybe the price changes if you order by card vs cash? I'll add this to my to-do list for next time I order pizza. The Order._send method posts the entire self.data dictionary, so it seems like the API does require that Payments dict to be populated in Order.pay_with.

from pizzapi.

aluttik avatar aluttik commented on July 17, 2024

Sure that'd be great, thanks

from pizzapi.

ggrammar avatar ggrammar commented on July 17, 2024

@peterskipper Hey, Peter! I pulled in a commit yesterday that fixes this. See here.

Rather than initialize the Order object with a card (I don't think you need it to call pay_with), I just modified the calls that use credit_card to use the card object that the caller passes in.

I'm going to close this issue out - let me know if you have any objections.

from pizzapi.

peterskipper avatar peterskipper commented on July 17, 2024

Thanks for responding! I'm a little bit concerned, though I may not understand the fix. It looks like pay_with uses card=False by default, and that in turn causes a 'Cash' payment to be sent? Won't that cause me to accidentally order a pizza with cash when I'm just testing my code out with pay_with?

from pizzapi.

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.