Question

I have used Paypal Helper library in my razor web application.

_AppStart.cshtml

@{
    PayPal.Profile.Initialize(
    "XXXXXXXXXXXXXX.gmail.com",
    "XXXXXXXXXX",
    "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "sandbox");

    // General Adaptive Payments’ properties
    PayPal.Profile.Language = "en_US";
    PayPal.Profile.CancelUrl = "http://mywebsite.com";
    PayPal.Profile.ReturnUrl = "http://mywebsite.com/PaypalReturn.cshtml";
    PayPal.Profile.IpnUrl = "http://mywebsite.com/PaypalReturn.cshtml";
    PayPal.Profile.CurrencyCode = "USD";
}

Subscribe.cshtml

@{
    var payPalButton = PayPal.ButtonManager.SubscribeButton.Create(
         business: "myname@merchant.com",
         itemName: "Subscribe to premium account",
         a3: "10.00",
         p3: "1",
         t3: "M");


    HtmlString payPalButtonHtml = new HtmlString(payPalButton.WebSiteCode);
 }
 
@payPalButtonHtml

But it throws an error:

Invalid Argument - The email or merchant ID specified is invalid. (Error Code: 11928)

Can any one let me know what is wrong with that.?

Thanks

Was it helpful?

Solution

I have resolved it. The error itself says everything but I didn't get it.

I have to specify the correct Merchant Email ID in the business argument in the Button Create method as below:

var payPalButton = PayPal.ButtonManager.SubscribeButton.Create(
         business: "xxx-facilitator@xxxxxxxx.com",
         itemName: "Subscribe to premium account",
         a3: "10.00",
         p3: "1",
         t3: "M");

Hope it is clear.

Thanks.!!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top