pizzapi icon indicating copy to clipboard operation
pizzapi copied to clipboard

Canadian addresses always raise a -1 status exception?

Open kbots-tech opened this issue 4 years ago • 1 comments

Hi there I've started messing around with this library a bit to make a discord bot for me and a group of friends to order pizzas through discord. I've gotten U.S. adresses working fine with the default settings and such but when I've been going in and trying with Canadian ones I've been getting an error raised in order.pay_with() Is this a known error/how could I fix it? I double checked and I am using the proper urls throughout and it adds to the order and shows the menu fine. Also has anyone discovered a way to add order instructions to it? I'd like to give the option to add that (or have a default one to be safe) but didn't seem to see that anywhere even in what's being sent that I could add/edit.

Thanks!

kbots-tech avatar Jan 01 '21 21:01 kbots-tech

When initializing an address, you must explicitly tell it you are from Canada:

from pizzapi.urls import COUNTRY_CANADA
addr = Address("123 Cougar St.", "Banff", "AB", "T1W2L3", COUNTRY_CANADA)

TTWNO avatar Nov 25 '21 20:11 TTWNO