Comments (4)
@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.
Sure that'd be great, thanks
from pizzapi.
@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.
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)
- Issue with order.py HOT 1
- No local stores are currently open HOT 2
- store.get_menu() raised an exception HOT 2
- Canadian addresses always raise a -1 status exception? HOT 1
- I ran the exact script and got an AttributeError. What should I do?
- store.get_menu raised an exception HOT 1
- order.add_item throwing a self.menu.varients keyerror
- Does this still work, in countries other than US and Canada like France for example?
- ConnectionError: HTTPSConnectionPool(host='order.dominos.com', port=443): Max retries exceeded with url: /power/store-locator? HOT 1
- Inconsistent use of tabs and spaces HOT 1
- Credit Card HOT 1
- Cash
- Not ordering
- Order class broken HOT 1
- Address by coordinates?
- Error when calling track_by_phone() HOT 1
- No local stores are currently open HOT 3
- Placing orders
- Doesn't seem to work anymore? HOT 3
- Order custom pizzas
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pizzapi.