How to create Checkout URL if plan/addon ID contains “+” sign?

Modified on: Mon, 5 Sep, 2022 at 12:44 PM

This article covers 

Why my addon ID is throwing an error in the Checkout URL when it exists on my site?


Summary


Suppose for PC 1.0, if the One-time checkout URL is (below)
https://acmetesting.chargebee.com/hosted_pages/checkout/onetime?addons[id][0]=mobile-app-(android-+-ios)---inr-15000


Just replace the + sign with 
%2B in the above URL

You just need to make the above changes in any Checkout URL for it to work, if the error is coming because of the + sign.


Solution


Suppose for PC 1.0, the One-time checkout URL that you have created is (below)
https://acmetesting.chargebee.com/hosted_pages/checkout/onetime?addons[id][0]=mobile-app-(android-
+-ios)---inr-15000

Then it wouldn’t work. It would throw an error like this (below image)



Even though the addon ID entered was correct (below image)




Since the URL is not considering the “+” sign, it is throwing an error.
Referred to this doc - 
https://www.w3schools.com/tags/ref_urlencode.ASP

which tells to use this (below image)



Hence use this as a URL -

https://acmetesting.chargebee.com/hosted_pages/checkout/onetime?addons[id][0]=mobile-app-(android-%2B-ios)---inr-15000


Related articles and Documentation

One-time payment checkout




Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.
×