Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Stefan 13 posts 53 karma points
    Jan 06, 2014 @ 07:53
    Stefan
    0

    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

  • Morten Skjoldager 440 posts 1499 karma points
    Jan 06, 2014 @ 10:46
    Morten Skjoldager
    0

    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 

    TransactionLibrary.CreatePayment(paymentMethod.Id, requestPayment: false);

    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

     

Please Sign in or register to post replies

Write your reply to:

Draft