In trying to create a recurring application charge, I received a validation error stating that the return_url provided was too long. URLs over 255 characters aren't particularly uncommon. At any rate, it's frustrating for such a vital function to fail for this reason, especially since this restriction is undocumented. Could you please lift this restriction or (at the minimum) document it somewhere in the recurring application charge section of the API docs? I'll strongly push for lifting the restriction altogether.
This is not a solution but an analysis about the error.
I got the same issue for a while. Totally agree that it's weird to get this error on such vital feature (application charge). I did a little analysis: as the error says that there is more than 255 characters in the URL (we should try to have less than), the GET variables that extend the URL are : hmac, locale, session, shop url and a timestamp, the only variable we can reduce is the shop URL.
The shop URL has the format <SHOP_NAME>.myshopify.com. So, it is about to reduce the Shop Name.
This is how I was able to work on an application charging (application I have not yet submitted). The shop name was dev-hbl (7 characters).
I hops this could help to move forward a bit.
Looks like I'm back with a solution.
The scenario which led me to the error was to call the Shopify resource recurring_application_charges.json with the parameter return_url containing GET variables which I get from $ _SERVER ["QUERY_STRING"]. These GET variables make the return_url url exceeding the size of 255.
It turns out that "return_url" shouldn't contain a GET variable on my curl query and should be in the format https://<SHOP_NAME>.myshopify.com/admin/apps/<APP_NAME>. The size of this URL cannot therefore exceed 255 (unless application name or the store name is very very very very long...).
The variable $ _SERVER ["QUERY_STRING"] should be used to retrieve only some data (like charge_id or code) if necessary, without having to return everything contained in GET.
Hope this helps those who get stuck on this error.