Zinc API
Full documentation is available here.
Installation
gem 'zinc-api'
Usage
Zinc::Order.create(
retailer: 'amazon',
retailer_credentials: Zinc::RetailerCredentials.new(
'email' => '[email protected]',
'password' => 'jabberwocky'
),
products: [Zinc::Product.new('product_id' => 'B06XGHJ5H3', 'quantity' => 1)],
payment_method: Zinc::PaymentMethod.new(
'name_on_card' => 'Foo Bar',
'number' => '4242424242424242',
'security_code' => '123',
'expiration_month' => 1,
'expiration_year' => 2020
),
billing_address: Zinc::Address.new(
'first_name' => 'Jane',
'last_name' => 'Doe',
'address_line1' => '185 Berry St',
'address_line2' => 'Suite 2400 ',
'zip_code' => '94107',
'city' => 'San Francisco',
'state' => 'CA',
'country' => 'US',
'phone_number' => '1231231234'
),
shipping_address: Zinc::Address.new(
'first_name' => 'Jane',
'last_name' => 'Doe',
'address_line1' => '185 Berry St',
'address_line2' => 'Suite 2400 ',
'zip_code' => '94107',
'city' => 'San Francisco',
'state' => 'CA',
'country' => 'US',
'phone_number' => '1231231234'
),
shipping: Zinc::Shipping.new('order_by' => 'price', 'max_days' => 5, 'max_price' => 1000)
)