gpt4 book ai didi

ruby-on-rails - 联邦 express 和 UPS 实现

转载 作者:太空宇宙 更新时间:2023-11-03 17:41:34 25 4
gpt4 key购买 nike

我一直在寻找 Fedex 和 UPS 的 Ruby 实现。

我已经阅读了他们的文档,并认为它真的过于复杂(我自己有点像 ruby “新手”),所以正在寻找更简单的东西。我只想使用跟踪功能。

有没有人曾经使用过类似的东西,并且可以为我指出如何实现它的正确方向?

最佳答案

尝试 Shopify's active_shipping插入。它支持 UPS、USPS 和 FedEx。开发人员计划添加跟踪支持(根据自述文件),但已经为 FedEx 跟踪提供了支持:

fdx = FedEx.new(:login => '999999999', :password => '7777777')
tracking_info = fdx.find_tracking_info('tracking number here', :carrier_code => 'fedex_ground') # Ground package

tracking_info.shipment_events.each do |event|
puts "#{event.name} at #{event.location.city}, #{event.location.state} on #{event.time}. #{event.message}"
end
# => Package information transmitted to FedEx at NASHVILLE LOCAL, TN on Thu Oct 23 00:00:00 UTC 2008.
# Picked up by FedEx at NASHVILLE LOCAL, TN on Thu Oct 23 17:30:00 UTC 2008.
# Scanned at FedEx sort facility at NASHVILLE, TN on Thu Oct 23 18:50:00 UTC 2008.
# Departed FedEx sort facility at NASHVILLE, TN on Thu Oct 23 22:33:00 UTC 2008.
# Arrived at FedEx sort facility at KNOXVILLE, TN on Fri Oct 24 02:45:00 UTC 2008.
# Scanned at FedEx sort facility at KNOXVILLE, TN on Fri Oct 24 05:56:00 UTC 2008.
# Delivered at Knoxville, TN on Fri Oct 24 16:45:00 UTC 2008. Signed for by: T.BAKER

关于ruby-on-rails - 联邦 express 和 UPS 实现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2317963/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com