0

Problem with nested params in creating an order

I'm having difficulty creating orders with nested records.  I think I'm following the correct format, but I get different results back the API.  I would like to be able to specify all of the details inline (except for client_id, which is the only record that must be created in advance, according to the API docs).  Here's the code for some different scenarios.  

Offline payment:

tevo.orders.create_customer_order({:seller_id => 782, :client_id => 2351, :payments => [{ :type => "offline" }], :items => [{ :price => "767.0", :quantity => 2, :ticket_group_id => 9354504}] })

=> Works fine.. 

Nested Shipping Info:

tevo.orders.create_customer_order({:seller_id => 782, :client_id => 2351, :shipping_address => [{ :country_code => "US", :street_address => "125 Street", :locality => "Springfield", :postal_code => "58008-6072", :region => "MG"}], :payments => [{ :type => "offline" }], :items => [{ :price => "769.0", :quantity => 2, :ticket_group_id => 9354504}] })

=> Looks like the Order has been created but doesn't appear in exchange.sandbox.ticketevolution.  Also, shipping_address information isn't picked up in the record that is returned. 

Nested Credit Card Details:

tevo.orders.create_customer_order({:seller_id => 782, :client_id => 2351, :payments => [{ "type" => "credit_card", "credit_card" => [{ "expiration_year" => "2013", "verification_code" => "589", "name" => "Will Smith", "expiration_month" => "6", "number" => "4111111111111111" }] }], :shipping_address => [{ :country_code => "US", :street_address => "125 Street", :locality => "Springfield", :postal_code => "58008-6072", :region => "MG"}], :items => [{ :price => "770.0", :quantity => 2, :ticket_group_id => 9354504}] })

 => APIError - no details in te_api.log.  

Am I doing something wrong or is the ruby api wrapper not parsing nested order params properly?  Thanks, as always, for your assistance.

1 comment

Please sign in to leave a comment.