Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provide an Order model #100

Open
ColinW520 opened this issue Aug 10, 2020 · 0 comments · May be fixed by #101
Open

provide an Order model #100

ColinW520 opened this issue Aug 10, 2020 · 0 comments · May be fixed by #101

Comments

@ColinW520
Copy link

As we begin to build out our integration with Shippo, we would like to be able to create orders the same way we create shipments/transactions.

Looking at https://goshippo.com/docs/reference/rb#orders-create, there is no example showing how to achieve this using this gem.

Desired syntax example (emulating example from Shipments):

order = Shippo::Order.create({
  to_address: {
    city: "San Francisco",
    company: "Shippo",
    country: "US",
    email: "shippotle@goshippo.com",
    name: "Mr Hippo",
    phone: "15553419393",
    state: "CA",
    street1: "215 Clayton St.",
    zip: "94117"
  },
  line_items: [
    {
      quantity: 1,
      sku: "HM-123",
      title: "Hippo Magazines",
      total_price: "0.00",
      currency: "USD",
      weight: "0.40",
      weight_unit: "lb"
    }
  ],
  placed_at: "2016-09-23T01:28:12Z",
  order_number: "#1068",
  order_status: "PAID"
})

The changes needed look pretty straightforward given the implementation you have here. I would be happy to submit a PR for this if that would be welcomed.

@ColinW520 ColinW520 linked a pull request Aug 10, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant