2017-05-31 15 views
0

私はShopify APIから非常に奇妙な結果を得ています。私は誰かが私を助けることを望んでいます。Shopify Order API - 合格割引

私は割引を使って注文を作成しようとしています。 ITSは実際に割引情報を、順序を保存するあなたがウェブフックデータからその作成を見ることができるように...しかし、量が常に

order_params = { 
    :browser_ip => webhook[:browser_ip], 
    :buyer_accepts_marketing => webhook[:buyer_accepts_marketing], 
    :currency => webhook[:currency], 
    :email => webhook[:email], 
    :financial_status => webhook[:financial_status], 
    :landing_site => webhook[:landing_site], 
    :note => webhook[:note], 
    :referring_site => webhook[:referring_site], 
    :line_items => line_items, 
    :tag => tags, 
    :transactions => transactions, 
    :discount_codes => webhook[:discount_codes], 
    :total_discounts => webhook[:total_discounts], 
    :shipping_address => webhook[:shipping_address], 
    :shipping_lines => webhook[:shipping_lines], 
    :customer_id => @options[:customer_id], 
    :billing_address => webhook[:billing_address] 
    } 
    @shopify_order = ShopifyAPI::Order.create(order_params) 

間違っています。これは、(切り捨て)...戻って私を与えている

"reference"=>nil, 
"user_id"=>nil, 
"subtotal_price"=>"55.00", 
"total_discounts"=>"55.00", 
"location_id"=>nil, 
"source_identifier"=>nil, 
"source_url"=>nil, 
"processed_at"=>"2017-05-31T15:53:03-04:00", 
"device_id"=>nil, 
"phone"=>nil, 
"browser_ip"=>nil, 
"landing_site_ref"=>nil, 
"order_number"=>1140, 
"discount_codes"=> 
[#<ShopifyAPI::Order::DiscountCode:0x007ffbec42ccb0 
    @attributes={"code"=>"50% OFF", "amount"=>"55.00", "type"=>""}, 
    @persisted=true, 
    @prefix_options={}>] 

これまでのところ、とても良い、すべてのデータが正しい..です私は保存し、これは...、割引額が間違っている起こる...それは£55でなければなりません。

shopify error

答えて

0

私はこれにあまりにも深く掘っていないが、私は、コードは一意である必要があります確信しています。

つまり、すでにお店の他の場所に定義されている50% OFFamount: 60.50という同じコードの割引コードが既に存在します。

新しいユニークなディスカウントコードを使用して試してみてください。

amount: 50type: percentageの新しい割引コードを作成することをお勧めします。その後、50%割引のご注文で再利用できます。

See the Price Rules reference for more information >

関連する問題