title: more than one field cannot be used to specify a receiver
body: <p>I'm trying to get delayed chained payments working through PayPal's Adaptive Payments API in C#.
  The error I'm getting doesn't make any sense and I can't find anything on the .NET to resolve the issue.</p>
  
  <p>The error message is:
      <strong>Invalid request: More than one field cannot be used to specify a receiver</strong></p>
  
  <p>Here's the request I'm sending:</p>
  
  <pre><code>    requestEnvelope.errorLanguage=en_US
      &amp;actionType=PAY_PRIMARY
      &amp;cancelUrl=http%3a%2f%2flocalhost%2fccc%2fProgramsandServices%2fCommunityFundingInitiative%2fOopsSome        thingWentWrong!.aspx ¤cyCode=USD
      &amp;feesPayer=EACHRECEIVER
      &amp;ipnNotificationUrl=http%3a%2f%2flocalhost%2fccc%2fdesktopmodules%2fUCU_ProjectManagement%2fPayPalIPN.aspx
      &amp;receiverList.receiver(0).amount=10.00
      &amp;receiverList.receiver(0).email=A_VALID_SANDBOX_EMAIL_ACCOUNT_ADDRESS_FOR_BUSINESS_OWNER
      &amp;receiverList.receiver(0).phone.countryCode=001
      &amp;receiverList.receiver(0).phone.phoneNumber=VALID_PHONE_NUMBER
      &amp;receiverList.receiver(0).primary=true
      &amp;receiverList.receiver(0).invoiceId=51%7c1%7c6%2f16%2f2013+4%3a35%3a56+PM
      &amp;receiverList.receiver(0).paymentType=GOODS
  
      &amp;receiverList.receiver(1).amount=9.5000
      &amp;receiverList.receiver(1).email=A_VALID_SANDBOX_EMAIL_ACCOUNT_ADDRESS
      &amp;receiverList.receiver(1).phone.countryCode=001
      &amp;receiverList.receiver(1).phone.phoneNumber=VALID_PHONE_NUMBER
      &amp;receiverList.receiver(1).primary=false
      &amp;receiverList.receiver(1).invoiceId=51%7c1%7c6%2f16%2f2013+4%3a35%3a56+PM
      &amp;receiverList.receiver(1).paymentType=GOODS
      &amp;reverseAllParallelPaymentsOnError=false
      &amp;senderEmail=A_VALID_SANDBOX_PERSONAL_EMAIL_ACCOUNT
      &amp;returnUrl=http%3a%2f%2flocalhost%2fccc%2fProgramsandServices%2fCommunityFundingInitiative%2fThankYouforYourDonation.aspx
      &amp;trackingId=51%7c0%7c6%2f16%2f2013+4%3a35%3a56+PM&amp;
  </code></pre>
  
  <p>I specified two receivers, one is Primary other is not.<br>
  What am I missing?
  I've tried both PAY and PAY_PRIMARY as the action types.  Same results for either one.
  If I only use ONE reciever, it works.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>    WebClient webClient = new WebClient();
  
          // Receivers
          ReceiverList receiverList = new ReceiverList();
  
          // Primary Receiver
          Receiver receiver = new Receiver();
          receiver.accountId = null;
          receiver.amount = Convert.ToDecimal(txtPledgeAmount.Text.Trim());
          receiver.invoiceId = Convert.ToString(SelectedProjectId) + "|" + Convert.ToString(PortalSettings.AdministratorId) + "|" + Convert.ToString(DateTime.Now.ToUniversalTime());
          //receiver.paymentSubType = null;
          receiver.paymentType = "GOODS";
          receiver.primary = true;
  
          if (!String.IsNullOrEmpty(PRIMARY_RECEIVER_PHONE_NUMBER))
          {
              receiver.phone = new PhoneNumberType();new PhoneNumberType("001",PRIMARY_RECEIVER_PHONE_NUMBER);
          }
          if (!String.IsNullOrEmpty(PRIMARY_RECEIVER_EMAIL_ADDRESS))
          {
              receiver.email = PRIMARY_RECEIVER_EMAIL_ADDRESS;
          }
  
          receiverList.receiver.Add(receiver);
  
          // Secondary Receiver
          string receiverEmail = "";
          string receiverPhone = VALID_PHONE_NUMBER;
          String receiverUserName = MembershipServices.Business.SharedFunctions.GetUserNameEmail(PortalId, SelectedProject.ProjectOwnerID, MembershipServices.SharedEnums.DisplayNameFormat_Type.FullName, ref receiverEmail);
          Receiver receiver2 = new Receiver(Decimal.Parse(this.txtPledgeAmount.Text.Trim()) * SECONDARY_RECEIVER_PERCENTAGE);
          if (!String.IsNullOrEmpty(receiverPhone))
          {
              receiver2.phone = receiver.phone = new PhoneNumberType("001", receiverPhone);
          }
          if (!String.IsNullOrEmpty(receiverEmail))
          {
              receiver2.email = receiverEmail;
          }
          receiver2.primary = Boolean.Parse("false");
          receiver2.invoiceId = Convert.ToString(SelectedProjectId) + "|" + Convert.ToString(SelectedProject.ProjectOwnerID) + "|" + Convert.ToString(DateTime.Now.ToUniversalTime()); ;
          receiver2.paymentType = "GOODS";
  
          receiverList.receiver.Add(receiver2);
  
          String PortalAlias = PortalSettings.PortalAlias.HTTPAlias;
          if (!PortalAlias.EndsWith("/"))
          {
              PortalAlias = PortalAlias + "/";
          }
  
          if (Request.IsSecureConnection)
          {
              PortalAlias = @"https://" + PortalAlias;
          }
          else
          {
              PortalAlias =  @"http://" + PortalAlias;
          }
  
          string actionType = "PAY_PRIMARY";
  
          PayRequest req = new PayRequest(new RequestEnvelope("en_US"), actionType,
                              PortalAlias + CANCEL_URL, SharedEnums.CurrencyCode_Type.USD.ToString(),
                              receiverList, PortalAlias + RETURN_URL);
  
          req.ipnNotificationUrl = PortalAlias + IPN_NOTIFICATION_URL;
  
          //(Optional) A note associated with the payment (text, not HTML). 
          // Maximum length: 1000 characters, including newline characters 
          if (!String.IsNullOrEmpty(txtPledgeMessage.Text.Trim()))
          {
              req.memo = txtPledgeMessage.Text.Trim();
          }
          else
          {
              req.memo = null;
          }
  
  
          // set optional parameters
          //(Optional) Whether to reverse parallel payments if an error occurs with a payment. 
          //Allowable values are:
          //true – Each parallel payment is reversed if an error occurs
          //false – Only incomplete payments are reversed (default)
          req.reverseAllParallelPaymentsOnError = false;
  
          req.feesPayer = "EACHRECEIVER";
  
          // Sender's email address 
          =req.senderEmail = SENDER_EMAIL_ADDRESS;
  
          //(Optional) A unique ID that you specify to track the payment.
          //Note: You are responsible for ensuring that the ID is unique.
          //Maximum length: 127 characters 
          string trackingId = Convert.ToString(SelectedProjectId + "|" + Convert.ToString(SelectedUserId) + "|" + Convert.ToString(DateTime.Now.ToUniversalTime()));
          req.trackingId = trackingId;
  
  
          // All set. Fire the request            
          AdaptivePaymentsService service = new AdaptivePaymentsService();
          PayResponse resp = null;
          try
          {
              resp = service.Pay(req);
          }
          catch (System.Exception e)
          {
              Response.Write(e.Message);
              return;
          }
  </code></pre>
  
  <p>If you've worked through this or can spot the error, please let me know!
  Thanks.</p>