patch-technology / patch-python Goto Github PK
View Code? Open in Web Editor NEWPatch's Python client library - https://www.patch.io
Home Page: https://www.usepatch.com
Patch's Python client library - https://www.patch.io
Home Page: https://www.usepatch.com
Hi there.
I received the following error when using the example python code from docs. I am using the test API keys as the 'ApiClient' and have been able to create orders sucessfully by mass_g
. However, when using the create order by price, I am receiving argument errors.
total_price_cents_usd = 500 # Pass in the total price in cents of US dollars (i.e. 5 dollars)
patch.orders.create_order(total_price_cents_usd=total_price_cents_usd)
Results in
ApiTypeError: Got an unexpected keyword argument 'total_price_cents_usd' to method create_order
On looking at the orders_api.py I see there is no total_price_cents_usd
, just price_cents_usd
. Changing the param label to this results in the following error.
total_price_cents_usd = 500 # Pass in the total price in cents of US dollars (i.e. 5 dollars)
patch.orders.create_order(price_cents_usd=total_price_cents_usd)
Results in...
ApiException: (422)
Reason: Unprocessable Entity
HTTP response headers: HTTPHeaderDict({'Server': 'nginx/1.17.8', 'Date': 'Tue, 30 Mar 2021 09:57:35 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'X-Frame-Options': 'SAMEORIGIN', 'X-XSS-Protection': '1; mode=block', 'X-Content-Type-Options': 'nosniff', 'X-Download-Options': 'noopen', 'X-Permitted-Cross-Domain-Policies': 'none', 'Referrer-Policy': 'strict-origin-when-cross-origin', 'Vary': 'Accept, Origin', 'Cache-Control': 'no-cache', 'X-Request-Id': '961cb0a64cba5d3835a9b28336dd3455', 'X-Runtime': '0.026914', 'Strict-Transport-Security': 'max-age=15724800; includeSubDomains', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Credentials': 'true', 'Access-Control-Allow-Methods': 'GET, PUT, POST, DELETE, PATCH, OPTIONS', 'Access-Control-Allow-Headers': 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization'})
HTTP response body: {"data":null,"error":{"code":422,"message":" must only contain one of: mass_g, total_price_cents_usd"},"meta":null,"success":false}
Thanks in advance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.