3

I am needing some assistance with paypal Parallel payments C# I have tried the Classic API and the REST API that paypal has. I am running into cycles and don't know what else to do, I have tried to get chained payments working and I have google'd and there is a huge lack of support so Im now trying Parallel. Let you know i get an 500 internal Server error..

 ReceiverList receiverList = new ReceiverList();
    receiverList.receiver = new List<Receiver>();
    Receiver secondaryReceiver = new Receiver((decimal?)2.00);
    secondaryReceiver.email = "xxxxxxxxx@gmail.com";
    secondaryReceiver.primary = false;
    secondaryReceiver.paymentType = "GOODS";
    receiverList.receiver.Add(secondaryReceiver);
    Receiver primaryReceiver = new Receiver((decimal?)10.00);
    primaryReceiver.email = "xxxxxxxxxxxxxxxxxx-facilitator@gmail.com ";
    primaryReceiver.primary = true;
    primaryReceiver.paymentType = "GOODS";
    primaryReceiver.invoiceId = "123456789";
    receiverList.receiver.Add(primaryReceiver);
    RequestEnvelope requestEnvelope = new RequestEnvelope("en_US");
    string actionType = "Pay";
    string returnUrl = "https://devtools-paypal.com/guide/ap_chained_payment/dotnet?success=true";
    string cancelUrl = "https://devtools-paypal.com/guide/ap_chained_payment/dotnet?cancel=true";
    string currencyCode = "USD";
    PayRequest payRequest = new PayRequest(requestEnvelope, actionType, cancelUrl, currencyCode, receiverList, returnUrl);

    payRequest.ipnNotificationUrl = "http://replaceIpnUrl.com";

    payRequest.feesPayer = "PRIMARYRECEIVER";
    payRequest.trackingId = "123456789";
    Dictionary<string, string> paypalConfig = new Dictionary<string, string>();
    paypalConfig.Add("account1.apiUsername", "xxxxxxxxxxxxxxx-facilitator_api1.gmail.com");
    paypalConfig.Add("account1.apiPassword", "xxxxxxxxxxxxxxxxxxx");
    paypalConfig.Add("account1.apiSignature", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
    paypalConfig.Add("account1.applicationId", "APP-80W284485P519543T");
    paypalConfig.Add("IPNEndpoint", "https://www.paypal.com/cgi-bin/webscr");
    paypalConfig.Add("url", "https://www.paypal.com/webscr&cmd=_express-checkout&token=");
    paypalConfig.Add("endpoint", "https://api-3t.paypal.com/2.0/");
    paypalConfig.Add("mode", "sandbox");
    PayPal.AdaptivePayments.AdaptivePaymentsService service = new PayPal.AdaptivePayments.AdaptivePaymentsService(paypalConfig);
    PayResponse response = service.Pay(payRequest);

    string redirectUrl = null;

    if (!response.responseEnvelope.ack.ToString().Trim().ToUpper().Equals(AckCode.FAILURE.ToString()) && !response.responseEnvelope.ack.ToString().Trim().ToUpper().Equals(AckCode.FAILUREWITHWARNING.ToString()))
    {
        redirectUrl = "https://www.sandbox.paypal.com/webscr?cmd=_ap-payment&paykey=" + response.payKey;
    }

Now as for the web.config I dont know exactly how to do it or really what to do. i Have found a few things but need of help.

Thanks

  • Can you share the details of the 500 server response you're receiving? – Jason Z Jan 30 '15 at 14:54
  • @JasonZ, this is the error message : $exception {"The remote server returned an error: (500) Internal Server Error."} System.Exception {PayPal.Exception.HttpException} Obtained from this line of code : PayResponse response = service.Pay(payRequest); If you are the Jason from github, I did the issue like you asked. thanks for helping! – user3069367 Jan 31 '15 at 23:19
  • well its fixed, here is the code for everyone! : https://github.com/paypal/adaptivepayments-sdk-dotnet/issues/18#issuecomment-72370790 - bottom of page – user3069367 Feb 02 '15 at 04:49

0 Answers0