When request payment is set to true, the service will call Response.Redirect which should happen clientside. This is not the case when you're calling CreatePayment in a webservice.
Instead you should set it to false.
We have a service which will redirect the user for you. It requires a paymentmethod id and a paymentid which will be generated on the payment when you call TransactionLibrary.CreatePayment. So your webservice should call
Paypal Payment with Web API
Hi,
I am using Web API and AngularJS to create my shop with uCommerce.
Is it possible to do the call to Payment from the Web API controller? When TransactionLibrary.CreatePayment(paymentMethod.Id, requestPayment: true);
is called I would expect the user to be redirected to the paypal page, but nothing happens?! Is a postback needed before this call is done?
How can I achieve a postback if I am using AngularJS?
Maybe someone can help.
Thanks in advance,
Stefan
Hello Stefan.
When request payment is set to true, the service will call Response.Redirect which should happen clientside. This is not the case when you're calling CreatePayment in a webservice.
Instead you should set it to false.
We have a service which will redirect the user for you. It requires a paymentmethod id and a paymentid which will be generated on the payment when you call TransactionLibrary.CreatePayment. So your webservice should call
And then make your webservice return the correct url, which you can redirect with Javascript.
The Url to return should look like:
/{PaymentMethodId}/{PaymentId}/PaymentRequest.axd
PaymentMethodId and PaymentId can be found on the payment you've just created in your service.
Hope this helps
Regards
Morten
is working on a reply...