magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.5k stars 9.3k forks source link

UPS API Change Request #37534

Open ntmhung opened 1 year ago

ntmhung commented 1 year ago

Description

My client has informed me that starting from June 5, 2023, UPS no longer issues new access keys. UPS is going to change to use Oauth 2.0. image

I think the magento/module-ups module should be updated to meet the requirement. It needed to be done before June 5, 2023. This is the API document https://developer.ups.com/api/reference#operation/GenerateToken.

Expected behavior

The magento/module-ups supports using the OAuth security model from UPS.

Benefits

It will help new users planning to use the UPS shipping method connect to the UPS API after June 5, 2023.

Additional information

No response

Release note

No response

m2-assistant[bot] commented 1 year ago

Hi @ntmhung. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

chernenm commented 1 year ago

@magento give me 2.4-develop

techguysourav commented 1 year ago

HI, Please provide patch to us so we continue to use UPS as shipping method

rhoerr commented 1 year ago

This is a major S0 issue that Adobe will need to address in the immediate future.

The immediate impact is that starting this coming Monday, June 5 2023, merchants will no longer be able to add UPS rates to Magento. UPS will no longer generate any XML API keys, which Magento requires.

The long-term impact is that as of June 2024, every merchant that uses Magento's native UPS rate connector will no longer get rates from UPS. This has a high probability of breaking checkout, as most US merchants do not offer multiple parcel shipment providers.

Until this is resolved in Magento core, Merchants have the option of switching to a third party provider for their UPS rates, but that involves additional costs and setup. That's not an acceptable solution in the broad picture. See eg. https://twitter.com/saas_boss/status/1664354635346243585

chernenm commented 1 year ago

Hello @rhoerr,

Adobe team is working on a solution for new 2.4.6 customers. All the current 2.4.4, 2.4.5 and 2.4.6 customers who are currently using the XML API gateway to get shipping rates from UPS are not affected and can continue utilize this API till its EOL in June 2024. Adobe Commerce 2.4.7 will come with upgraded UPS REST API instead.

rhoerr commented 1 year ago

Great, thank you for the info @chernenm . Will look forward to that in the 2.4.7 release coming up soon.

techguysourav commented 1 year ago

Plz give link of any 3rd party that giving ups with Magento

On Fri, 2 Jun 2023, 23:08 Ryan Hoerr, @.***> wrote:

This is a major S0 issue that Adobe will need to address in the immediate future.

The immediate impact is that starting this coming Monday, June 5 2023, merchants will no longer be able to add UPS rates to Magento. UPS will no longer generate any XML API keys, which Magento requires.

The long-term impact is that as of June 2024, every merchant that uses Magento's native UPS rate connector will no longer get rates from UPS. This has a high probability of breaking checkout, as most US merchants do not offer multiple parcel shipment providers.

Until this is resolved in Magento core, Merchants have the option of switching to a third party provider for their UPS rates, but that involves additional costs and setup. That's not an acceptable solution in the broad picture.

— Reply to this email directly, view it on GitHub https://github.com/magento/magento2/issues/37534#issuecomment-1574089907, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE3VJ3B53BUYX7O5MM5DJALXJIQK7ANCNFSM6AAAAAAYNFKIWY . You are receiving this because you commented.Message ID: @.***>

ihaveathumb commented 1 year ago

Seriously, this is not a joke! Something needs to be done about this, now. There is no point in using Magento if it can't calculate shipping. If this doesn't get fixed soon, I foresee a mass exodus from Magento.

chernenm commented 1 year ago

hello @ihaveathumb, @techguysourav, Please check the official UPS extension at Magento marketplace https://marketplace.magento.com/ups-shipping.html while Adobe is working on a solution for out of the box integration.

rhoerr commented 1 year ago

@chernenm Is the message at the top of that extension listing still applicable?

IMPORTANT NOTE: This extension is currently available for merchants in POLAND, FRANCE, UNITED KINGDOM, GERMANY, ITALY, SPAIN, NETHERLANDS and BELGIUM ONLY. It will be available for merchants in other countries soon. At this time, please only install this extension if you are in the above-mentioned countries.

Also, when will 2.4.7 with the UPS REST API be released? There's not currently any published release date for 2.4.7, which suggests it won't be until sometime in 2024. That's cutting it close for the many merchants that will need to update.

Thanks

chernenm commented 1 year ago

hi @rhoerr,

The API update is planed to be included into 2.4.7-beta2 version which scheduled for October 2023. In addition we are working on a hotfix for new 2.4.6 customers and ensuring that UPS extension documentation is up to date at Magento marketplace.

ihaveathumb commented 1 year ago

hello @ihaveathumb, @techguysourav, Please check the official UPS extension at Magento marketplace https://marketplace.magento.com/ups-shipping.html while Adobe is working on a solution for out of the box integration.

That doesn't work for me, because I'm not in the very few countries that it supports.

maxq commented 1 year ago

This is an issue as UPS will no longer generate keys and the extension on marketplace isn't for the USA! So if you don't have keys then no UPS on your Magento site. Not good at all.

maxq commented 1 year ago

Can you still generate keys on UPS as I have not been able to?

chernenm commented 1 year ago

Hello, @maxq,

Adobe is currently working on the solution for this issue, we will be releasing a hotfix for 2.4.4, 2.4.5 and 2.4.6 customers.

ihaveathumb commented 1 year ago

When, though? This is taking way too long for an issue that you knew far ahead of time was going to happen!!!

On Thu, Aug 3, 2023, 5:29 PM chernenm @.***> wrote:

Hello, @maxq https://github.com/maxq,

Adobe is currently working on the solution for this issue, we will be releasing a hotfix for 2.4.4, 2.4.5 and 2.4.6 customers.

— Reply to this email directly, view it on GitHub https://github.com/magento/magento2/issues/37534#issuecomment-1664670248, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQJYIRNP2OENNRYNMIDBOTXTQJ35ANCNFSM6AAAAAAYNFKIWY . You are receiving this because you were mentioned.Message ID: @.***>

joemstar commented 1 year ago

Is there any update on this?

chernenm commented 1 year ago

Hello @joemstar,

The fix will be published tomorrow, September 14 around noon CST at https://experienceleague.adobe.com/docs/commerce-knowledge-base/kb/overview.html?lang=en

chernenm commented 1 year ago

The fix is available here https://experienceleague.adobe.com/docs/commerce-knowledge-base/kb/troubleshooting/known-issues-patches-attached/ups-shipping-method-integration-migration-from-soap-to-restful-api.html

rhoerr commented 1 year ago

Thank you @chernenm! That's good to see.

laconica-vasilij commented 1 year ago

@chernenm for 2.4.3-p1 patch is applying?

chernenm commented 1 year ago

hello @laconica-vasilij, the patch is only applicable for supported versions of Adobe Commerce and Magento Open Source which are 2.4.4+

maxq commented 1 year ago

Applied the patch, anyone know how to get credentials from UPS?

laconica-vasilij commented 1 year ago

Applied the patch, anyone know how to get credentials from UPS?

Look at the instructions https://developer.ups.com/get-started. You need to create an application to receive API keys

maxq commented 1 year ago

Their API signup is so bad you go through all the steps then get this. There is a non-technical issue with your request, in order to resolve it you will need to complete and submit the requested information. [Click Here to Resolve] so you click on it and get HTTP 400 bad request.

See this stuff so much nowadays wonder who's coding this stuff.

Also love this little gem.

ups-logic
timur-gafarov-acadaca commented 1 year ago

Did this work for anyone? I applied patch to 2.4.5 but getting an error

image

I pin pointed the issue and it looks like its related to the fact that response is not sending any shipping codes like the following.

image

Instead response from UPS is coming back as this

image

Which does not match up with anything that we have in Magento

glo05363 commented 1 year ago

@timur-gafarov-acadaca I have tried to reproduced this on 2.4.5 on both local and cloud instance to be sure, but the issue is not there . I see the UPS methods with shipping rates.


Screenshot 2023-09-28 at 12 24 03 PM

The codes that you are seeing are the UPS Rating API response that we get back after the rating request, here is a chunked sample from response:
 "RatedShipment": [ { "Disclaimer": { "Code": "05", "Description": "Rate excludes VAT. Rate includes a fuel surcharge, but excludes taxes, duties and other charges that may apply to the shipment." }, "Service": { **"Code": "01",** "Description": "" }, "RatedShipmentAlert": [ { "Code": "119001", "Description": "Additional Handling has automatically been set on Package 1." }, { "Code": "110971", "Description": "Your invoice may vary from the displayed reference rates" } ], "BillingWeight": { "UnitOfMeasurement": { "Code": "LBS", "Description": "Pounds" }, "Weight": "100.0" }, "TransportationCharges": { "CurrencyCode": "USD", "MonetaryValue": "321.11" }, "ServiceOptionsCharges": { "CurrencyCode": "USD", "MonetaryValue": "32.50" }, "TotalCharges": { "CurrencyCode": "USD", "MonetaryValue": "353.61" }, "NegotiatedRateCharges": { "TotalCharge": { "CurrencyCode": "USD", "MonetaryValue": "181.75" } }, "GuaranteedDelivery": { "BusinessDaysInTransit": "1", "DeliveryByTime": "10:30 A.M." }, "RatedPackage": { "TransportationCharges": { "CurrencyCode": "USD", "MonetaryValue": "321.11" }, "ServiceOptionsCharges": { "CurrencyCode": "USD", "MonetaryValue": "32.50" }, "TotalCharges": { "CurrencyCode": "USD", "MonetaryValue": "353.61" }, "Weight": "100.0", "BillingWeight": { "UnitOfMeasurement": { "Code": "LBS", "Description": "Pounds" }, "Weight": "100.0" } } }]

The Allowed methods are the methods that are mapped with the response codes under the UPS module using a helper configuration.
Please explain your concern if any regarding the codes and give us the steps on how the issue is coming for you.

timur-gafarov-acadaca commented 1 year ago

@glo05363 I was doing testing in admin, so possibly only admin is broken. Can you pls also try placing order via Admin?

glo05363 commented 1 year ago

@timur-gafarov-acadaca I have checked using admin interface and i can see the Rates data, Please check your configuration settings .

Screenshot 2023-09-28 at 6 51 46 PM
timur-gafarov-acadaca commented 1 year ago

@glo05363 I double checked the code and pretty sure there is a bug somewhere. Via XDEBUG I found the place where UPS codes are being compared with local Magento codes.

image

vendor/magento/module-ups/Model/Carrier.php:1346

Here its looking for 01 code in the list of Magento codes that don't map to this format. In this screenshot you can see values of allowed methods array which stores codes differently in alphanumeric format.

Configuration settings look fine as I am able to get a similar response from UPS like you pasted before. The problem is that its not getting processed correctly and possibly skipping process that you mentioned related to Helper mapper. Please make sure that your patch is applied and that settings are in fact using the new REST authentication method.

image

glo05363 commented 1 year ago

@timur-gafarov-acadaca Yes i am using the new REST method and patch is applied, The helper mapping is working fine. I suggest you give me your admin config settings details and the steps you are following once . Also check shipping.log file once .

timur-gafarov-acadaca commented 1 year ago

@glo05363 we found the issue. Its related to allowed method.

To reproduce the issue:

  1. Uncheck the checkbox "Use system value" for "Allowed Methods"
  2. Select a subset of available options
  3. Try getting rates either in admin or any other place for UPS

Its working fine for us when we use system value but we have to allow only 4 method types in this scenario.

image

Also we ship only to specific countries. Most of them are available but some are not. So you can also select specific country like below in case error is not thrown.

image

dazz397 commented 1 year ago

I just finished implementing this today and got everything working correctly. Here are some things I found and how I set it up.


Code 93 is for Surepost 1lb and over so you have to make sure the weight is at least 1. If it is less than 1, you need to quote service code 92 or just round up the weight to 1. The unit also has to be LBS, if it's under 1 you have to change the service code to 92, convert the lbs to ounces, and set it OZS instead of LBS.

"PackageWeight" => [ "UnitOfMeasurement" => [ "Code" => "LBS" ],


- The documentation for the UPS API left a lot of details out so some of it was trial and error. Hopefully, this helps others looking to do the same thing.
laconica-vasilij commented 1 year ago

I just finished implementing this today and got everything working correctly. Here are some things I found and how I set it up.

  • First, you have to go to https://developer.ups.com/ and create an app. Log in to the developer site and click the person icon on the top right and select "Apps". Click "Add Apps" and fill out all the info. Next, make sure to at least add Authorization(O Auth) and Rating. Give your app a name and callback URL I left blank. The Client ID is the User ID and the Client Secret is Password in the Magento UPS configuration.

How long have you created an application on the developer portal? Because I have a problem like @maxq (comment)

dazz397 commented 1 year ago

I just finished implementing this today and got everything working correctly. Here are some things I found and how I set it up.

  • First, you have to go to https://developer.ups.com/ and create an app. Log in to the developer site and click the person icon on the top right and select "Apps". Click "Add Apps" and fill out all the info. Next, make sure to at least add Authorization(O Auth) and Rating. Give your app a name and callback URL I left blank. The Client ID is the User ID and the Client Secret is Password in the Magento UPS configuration.

How long have you created an application on the developer portal? Because I have a problem like @maxq (comment)

I tried setting up a new app and I do not see this error or even it asking for a position title. You might want to try contacting UPS API support at uoltects@ups.com. I called for support and they are only reachable by email but can answer more detailed questions on implementation.

timur-gafarov-acadaca commented 1 year ago

@glo05363 Can above be incorporated into the patch? I don't know if you are the person who was working on it originally but the fact that you can't choose specific shipping methods in configs is a big part of missing functionality as most merchants do choose limited number of those and without being able to do that, this patch is not helpfull.

glo05363 commented 1 year ago

@timur-gafarov-acadaca I have looked into this issue today and it is reproducible to me after following the steps given by you. I see the solution provided by @dazz397 but the issue is not populating the numbered or lettered codes, it is about populating the correct allowed methods on the basis of "XML" or "REST". I am working on it and will provide you with the solution in the patch. let me update here again first thing tomorrow about the patch.

glo05363 commented 1 year ago

@timur-gafarov-acadaca we have created the patch files for 2.4.5, 2.4.4 and 2.4.6 respectively with the changes on the allowed method issue. To give a brief on the issue : when we were changing the UPS Type to : UPS, XML or REST the allowed methods options were populating for cgi UPS [default] and for XML [the number codes] but not for the REST type as we were using the default cgi methods in the case of REST as well while it required the same method options of SOAP. By changing the following in case of REST from:

Event.stopObserving($('carriers_ups_origin_shipment'), 'change', this.changeOriginShipment.bind(this));
this.changeOriginShipment(null, 'default');

to

Event.observe($('carriers_ups_origin_shipment'), 'change', this.changeOriginShipment.bind(this));
this.changeOriginShipment(null, null);

it will work fine and the origin of shipment dropdown will also work as expected showing the methods as required. patch files will be available soon.

timur-gafarov-acadaca commented 1 year ago

Thank you @glo05363, appreciate a quick turn around!

Film54 commented 12 months ago

Having the same issue with the current patch. Have UPS account for REST. Error "This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.", so not working correctly.

glo05363 commented 12 months ago

Having the same issue with the current patch. Have UPS account for REST. Error "This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.", so not working correctly.

@Film54 The new patches are not yet released. Once released we will inform here as well.

chernenm commented 12 months ago

New version of the patches have just been released today https://experienceleague.adobe.com/docs/commerce-knowledge-base/kb/troubleshooting/known-issues-patches-attached/ups-shipping-method-integration-migration-from-soap-to-restful-api.html They are fully compatible with the previous patches and can be applied on top.

abolabo commented 12 months ago

You can try to use PHP SDK by AbanteCart team. See repo https://github.com/abantecart/ups-php for details. There example how to obtain access token in the readme.md

Film54 commented 12 months ago

Thank you @glo05363! That fixed my issue.

vipin12117 commented 8 months ago

Everyone using ups shipping now can use below enhanced shipping plugin auto address validation

https://commercemarketplace.adobe.com/ecomplugins-upsrest.html

shpirt commented 7 months ago

Their API signup is so bad you go through all the steps then get this. There is a non-technical issue with your request, in order to resolve it you will need to complete and submit the requested information. [Click Here to Resolve] so you click on it and get HTTP 400 bad request.

See this stuff so much nowadays wonder who's coding this stuff.

Also love this little gem. ups-logic

I'm getting the same error. How long did it take you to resolve this issue? I submitted the form half a month ago, but still stuck here.

vipin12117 commented 7 months ago

We can do it for you. If you share your UPS account details then we will do in just 50 USD. Contact me at https://www.ecomplugins.com/index.php?route=information/contact

themew commented 7 months ago

We can't sign up as well, so we've not been able to offer UPS as a shipping option for.... when did this start... 8 months ago?

vipin12117 commented 7 months ago

Add me on skype at vipin1211987 for any discussion.

shpirt commented 7 months ago

We can't sign up as well, so we've not been able to offer UPS as a shipping option for.... when did this start... 8 months ago?

In one discussion, four people were blocked by UPS and found it hard to pass through even after providing the required information. Great UPS!