Skip to content

Add /estimates/ecommerce API support #71

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

Merged
merged 1 commit into from
Aug 10, 2022
Merged

Add /estimates/ecommerce API support #71

merged 1 commit into from
Aug 10, 2022

Conversation

holtbp
Copy link
Contributor

@holtbp holtbp commented Aug 10, 2022

What

  • Adds Patch::Estimate.create_ecommerce_estimate method

Why

New endpoint for our ecommerce customers!

SDK Release Checklist

  • Have you added an integration test for the changes?
  • Have you built the gem locally and made queries against it successfully?
  • Did you update the changelog?
  • Did you bump the package version in the code generator?
  • If endpoints were removed, did you manually remove the corresponding files? (this should be rare)
  • For breaking changes, did you plan for the release of the new SDK versions and deploy the API to production?

@holtbp holtbp requested review from pcothenet and a team August 10, 2022 20:43
@holtbp holtbp merged commit 9c224a5 into main Aug 10, 2022
@holtbp holtbp deleted the bh-ecommerce-api branch August 10, 2022 22:07
@holtbp
Copy link
Contributor Author

holtbp commented Aug 10, 2022

brett@Bretts-MacBook-Pro patch-ruby % irb
irb(main):001:0> require 'patch_ruby'
=> true
irb(main):002:1* Patch.configure do |config|
irb(main):003:1*   # Configure the Patch gem with your API key here
irb(main):004:1*   config.access_token = ENV['SANDBOX_API_KEY']
irb(main):005:0> end
=> [REDACTED]
irb(main):006:0> distance_m = 1_000_000 # Pass in the shipping distance in meters
=> 1000000
irb(main):007:0> package_mass_g = 10_000 # Pass in the weight of the package shipp
ed in grams
=> 10000
irb(main):008:0> transportation_method = "air" # Pass in the transportation method
 (air, rail, road, sea)
=> "air"
irb(main):009:1* Patch::Estimate.create_ecommerce_estimate(
irb(main):010:1*   distance_m: distance_m,
irb(main):011:1*   package_mass_g: package_mass_g,
irb(main):012:1*   transportation_method: transportation_method
irb(main):013:0> )
=>
#<Patch::EstimateResponse:0x0000000104931048
 @data=
  #<Patch::Estimate:0x0000000104930738
   @id="est_test_ed30b1e9e7a3bf8481d62f2b7cd06b31",
   @mass_g=8085,
   @order=nil,
   @production=false,
   @type="ecommerce">,
 @error=nil,
 @success=true>

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 this pull request may close these issues.

2 participants