Paypal payment integration into ASP.NET MVC - ExecutePayment throws an exception

0

PayPal.PaymentsException
HResult=0x80131500
Message=The remote server returned an error: (400) Bad Request.
Source=PayPal

StackTrace:
at PayPal.Api.PayPalResource.ConfigureAndExecute[T](APIContext apiContext, HttpMethod httpMethod, String resource, String payload, String endpoint, Boolean setAuthorizationHeader)
at PayPal.Api.Payment.Execute(APIContext apiContext, String paymentId, PaymentExecution paymentExecution)

Code:

private PayPal.Api.Payment payment;

private Payment ExecutePayment(APIContext apiContext, string payerId, string paymentId)
{
    var paymentExecution = new PaymentExecution() { payer_id = payerId };
    this.payment = new Payment() { id = paymentId };
    return this.payment.Execute(apiContext, paymentExecution);
}
c#
asp.net
asp.net-mvc
paypal
paypal-sandbox
asked on Stack Overflow Jul 12, 2020 by farhat riaz • edited Jul 12, 2020 by marc_s

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0