1

我有一些通过 Shopify 下的订单,但通过外部支付系统付款。我正在尝试使用 Python API 将它们标记为已付款,但在保存交易时收到 406 响应。商店中的私有应用程序已为 Orders API 设置了读写集

shop_url = "https://%s:%s@mystore.myshopify.com/admin/api/%s" % (API_KEY, PASSWORD, API_VERSION) 
shopify.ShopifyResource.set_site(shop_url)

shop = shopify.Shop.current();

order = shopify.Order.find_first(name="#20204512"); 
trans = shopify.Transaction.find_first(order_id=order.id); 
new_transaction = shopify.Transaction(); 
#new_transaction.currency = "CAD";
new_transaction.kind = "capture" 
#new_transaction.status = "paid" 
#new_transaction.gateway = "manual" 
new_transaction.amount = "10.00"; 
new_transaction.parent_id = trans.id;
new_transaction.save();
4

0 回答 0