Start a new topic

Hosted Page Redirect URL Issue

 Hi,


I am using hosted page for website subscription, basically this a hosted checkout page. On the other hand in the chargebee account, I have created some plans and have configured the redirect url in the plans. But the concern is that after creating chargebee subscription from the website via hosted page, the user does not redirect to website (redirect page) as I did set the redirect URL in the chargebee plan and enabled hosted page in the chargebee plan.


For more information::

I am working on local-host and using the test chargeebee account.


Kindly suggest ant way to configure the redirect URL and tell us how we can get subscription response from hosted page. 


Thanks,

Rajbir Singh


Hi Vinaayak,


Thanks for the explanation.


I am using chargebee library in php and have implement subscription API call. It works fine for some plans as I am able to create basic plan subscription but whenever I create subscription with other plan then it does not work and produce the  'Fatal error: Uncaught ChargeBee_PaymentException: Cannot create the subscription as there is no valid card on file'.


Full error message::
 Fatal error: Uncaught ChargeBee_PaymentException: Cannot create the subscription as there is no valid card on file in /var/www/html/API/chargebee/lib/ChargeBee/Curl.php:95 Stack trace: #0 /var/www/html/API/chargebee/lib/ChargeBee/Curl.php(81): ChargeBee_Curl::handleAPIRespError(400, Array, '{"message":"Can...') #1 /var/www/html/API/chargebee/lib/ChargeBee/Curl.php(14): ChargeBee_Curl::processResponse('{"message":"Can...', 400) #2 /var/www/html/API/chargebee/lib/ChargeBee/Request.php(34): ChargeBee_Curl::doRequest('post', '/subscriptions', Object(ChargeBee_Environment), Array, Array) #3 /var/www/html/API/chargebee/lib/ChargeBee/Models/Subscription.php(16): ChargeBee_Request::send('post', '/subscriptions', Array, Object(ChargeBee_Environment), Array) #4 /var/www/html/API/subscription.php(36): ChargeBee_Subscription::create(Array) #5 {main} thrown in /var/www/html/API/chargebee/lib/ChargeBee/Curl.php on line 95

I am not sure why I get errors in certain cases. Specially, in paid plan. I am using chargebee test account.


Looking forward to your response.


Thanks,

Rajbir

Hello Rajbir, 


Thanks for reaching out to us! We can see that you are using the API to create a new subscription. The redirect URL API must also be passed as a parameter in the API call so that the customer is taken to the necessary page. 


Let us know if you have any other questions. 

Login or Signup to post a comment