Can I send SSRS custom subscription e-mails? - email

I need to send some e-mails containing a SSRS report to a list of persons, representing the amount of work items they have left until a certain date.
What I would like to do is to send each person in the list, the customized report that reflects his progress, so my question is: can I send different reports to the persons in the list (like sending it's e-mail address as a parameter to the report), or can I only send the same report to all people in the list?
Thanks!

If you do not have enterprise (to utilize data driven subscription as #StephLocke mentioned), you can programmatically generate SSRS subscriptions using the SSRS web service.
Your code would look something like this (SubscriptionRequest is a custom class I use, its properties should be intuitive):
static void generateSubscription()
{
if (SubscriptionRequests.Count < 1) return;
NetworkCredential credentials = new NetworkCredential("user", "pass");
reports.ReportingService2005 rs = new reports.ReportingService2005();
rs.Credentials = credentials;
DateTime topDatetime = DateTime.Now;
topDatetime = topDatetime.AddMinutes(2);
foreach (SubscriptionRequest x in SubscriptionRequests)
{
reports.ExtensionSettings extensionSettings = new reports.ExtensionSettings();
List<reports.ParameterValue> extParameters = new List<reports.ParameterValue>();
List<reports.ParameterValue> parameters = new List<reports.ParameterValue>();
string description = "Email: ";
string eventType = "TimedSubscription";
extensionSettings.Extension = "Report Server Email";
string scheduleXml = "<ScheduleDefinition><StartDateTime>";
scheduleXml += topDatetime.ToShortDateString() + " " + topDatetime.ToShortTimeString();
scheduleXml += "</StartDateTime></ScheduleDefinition>";
parameters.Add(new reports.ParameterValue() { Name = "abc", Value = x.id });
extParameters.Add(new reports.ParameterValue() { Name = "RenderFormat", Value = x.renderFormat });
extParameters.Add(new reports.ParameterValue() { Name = "TO", Value = x.email });
extParameters.Add(new reports.ParameterValue() { Name = "ReplyTo", Value = x.replyTo });
extParameters.Add(new reports.ParameterValue() { Name = "IncludeReport", Value = "True" });
extParameters.Add(new reports.ParameterValue() { Name = "Subject", Value = "subject - " + " (" + x.id.ToString() + ")" });
extParameters.Add(new reports.ParameterValue() { Name = "Comment", Value = x.body });
extensionSettings.ParameterValues = extParameters.ToArray();
description += topDatetime.ToShortDateString() + " " + topDatetime.ToShortTimeString();
description += " (" + x.a + " - " + x.b + " - " + x.c + ")";
string _reportName = "/report";
rs.CreateSubscription(_reportName, extensionSettings, description, eventType, scheduleXml, parameters.ToArray());
topDatetime = topDatetime.AddSeconds(30);
}
}
More examples can be found here.

Yes you can use a data driven subscription to do this. Unfortunately this isn't available to every edition (2008+, enterprise only I believe) so you may not be able to use this functionality.
There are more details available: http://technet.microsoft.com/en-us/library/ms159150.aspx

Related

Why is Google Group exporting members not giving me an accurate number?

I used this script to export the email addresses from my group, and that gets me 8815 results. But on my group's page, the total number of members is 13,000+ (according to the counter in the top right corner, in member view). Why is there a difference?
function listGroupMembers() {
var GROUP_EMAIL = "mygroupsname#googlegroups.com";
var group = GroupsApp.getGroupByEmail(GROUP_EMAIL);
var users = group.getUsers();
var s = "Group " + GROUP_EMAIL + " has " + users.length +
" members: ";
for (var i = 0; i < users.length; i++) {
var user = users[i];
s = s + user.getEmail() + ", ";
}
var doc = DocumentApp.create('group emails');
doc.getBody().appendParagraph(s);
}

Create Alias using barclaycard payment epdq - unknown order/1/s/

Below is the code used for creating the Alias which does not work and throw an error
"unknown order/1/s/". The same code works for payment if I remove the code for Alias.
Not sure what am I missing?
I could log into the epdq barclaycard account and see the error which is "unknown order/1/s/". I can also create Alias manually through the epdq account, but just cant get to the orderstandard.asp page without error (when alias hidden fields and code used).
I would be glad if someone could help me.
<body>
<form id="OrderForm" action="https://payments.epdq.co.uk/ncol/prod/orderstandard.asp" method="post" runat="server">
<div>
<asp:HiddenField ID="AMOUNT" runat="server" />
<asp:HiddenField ID="CN" runat="server" />
...
<asp:HiddenField ID="ALIAS" runat="server" />
<asp:HiddenField ID="ALIASUSAGE" runat="server" />
<asp:HiddenField ID="ALIASOPERATION" runat="server" />
<asp:HiddenField ID="SHASign" runat="server" />
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text; //for Encoding
using System.Security.Cryptography; //for SHA1
public partial class _DefaultAliasTest : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//-- Set Values (these would be pulled from DB or a previous page). -- //
bool isAlias = true;
//- Customer/Order Details - //
string strUserTitle = "Mr"; // Customer details
string strUserFirstname = "Edward";
string strUserSurname = "Shopper";
string strBillHouseNumber = "123"; // Address Details
string strAd1 = "Penny Lane";
string strAd2 = "Central Areas";
string strBillTown = "Middlehampton"; // Bill Town
string strBillCountry = "England"; // Bill Country
string strPcde = "NN4 7SG"; // Postcode
string strContactTel = "01604 567 890"; // Contact Telephone number
string strShopperEmail = "test#test.com"; // shopper Email
string strShopperLocale = "en_GB"; // shopper locale
string strCurrencyCode = "GBP"; // CurrecncyCode
string strAddressline1n2 = strBillHouseNumber + " " + strAd1 + ", " + strAd2; // Concatenated Address eg 123 Penny Lane Central Areas
string strCustomerName = strUserTitle + " " + strUserFirstname + " " + strUserSurname; // Concatenated Customer Name eg Mr Edward Shopper
string strPaymentAmount = "100"; // This is 1 pound (100p)
string strOrderDataRaw = "HDTV - AVTV3000"; // Order description
string strOrderID = "ORD1234556Y"; // Order Id - **needs to be unique**
//- integration user details - //
string strPW = "xxxxxx!?"; // Update with the details you entered into back office
string strPSPID = "epdqxxxxxxx"; // update with the details of the PSPID you were supplied with
//- payment design options - '//
string strTXTCOLOR = "#005588"; // Page Text Colour
string strTBLTXTCOLOR = "#005588"; // Table Text Colour
string strFONTTYPE = "Helvetica, Arial"; // fonttype
string strBUTTONTXTCOLOR = "#005588"; // Button Text Colour
string strBGCOLOR = "#d1ecf3"; // Page Background Colour
string strTBLBGCOLOR = "#ffffff"; // Table BG Colour
string strBUTTONBGCOLOR = "#cccccc"; // Button Colour
string strTITLE = "Testing - Secure Payment Page"; // Title
string strLOGO = "https://www.site.com/logo.png"; // logo location
string strPMLISTTYPE = "1"; // Payment Method List type
string strALIAS = System.Guid.NewGuid().ToString();
string strALIASUSAGE = "usage"; // ALIAS USAGE
string strALIASOPERATION = "BYMERCHANT"; // ALIAS Operation
//= create string to hash (digest) using values of options/details above. MUST be in field alphabetical order!
string plainDigest =
"AMOUNT=" + strPaymentAmount + strPW +
"BGCOLOR=" + strBGCOLOR + strPW +
"BUTTONBGCOLOR=" + strBUTTONBGCOLOR + strPW +
"BUTTONTXTCOLOR=" + strBUTTONTXTCOLOR + strPW +
"CN=" + strCustomerName + strPW +
"COM=" + strOrderDataRaw + strPW +
"CURRENCY=" + strCurrencyCode + strPW +
"EMAIL=" + strShopperEmail + strPW +
"FONTTYPE=" + strFONTTYPE + strPW +
"LANGUAGE=" + strShopperLocale + strPW +
"LOGO=" + strLOGO + strPW +
"ORDERID=" + strOrderID + strPW +
"OWNERADDRESS=" + strAddressline1n2 + strPW +
"OWNERCTY=" + strBillCountry + strPW +
"OWNERTELNO=" + strContactTel + strPW +
"OWNERTOWN=" + strBillTown + strPW +
"OWNERZIP=" + strPcde + strPW +
"PMLISTTYPE=" + strPMLISTTYPE + strPW +
"PSPID=" + strPSPID + strPW +
"TBLBGCOLOR=" + strTBLBGCOLOR + strPW +
"TBLTXTCOLOR=" + strTBLTXTCOLOR + strPW +
"TITLE=" + strTITLE + strPW +
"TXTCOLOR=" + strTXTCOLOR + strPW +
"";
if (isAlias)
{
plainDigest =
plainDigest +
"ALIAS=" + strALIAS + strPW +
"ALIASUSAGE=" + strALIASUSAGE + strPW +
"ALIASOPERATION=" + strALIASOPERATION + strPW +
"";
}
//Payment
//-- insert payment details into hidden fields -- //
AMOUNT.Value = strPaymentAmount; // PaymentAmmount : (100 pence)
CN.Value = strCustomerName; // Customer Name
COM.Value = strOrderDataRaw; // OrderDataRaw (order description)
CURRENCY.Value = strCurrencyCode; // CurrecncyCode
EMAIL.Value = strShopperEmail; // shopper Email
FONTTYPE.Value = strFONTTYPE; // fonttype
LANGUAGE.Value = strShopperLocale; // shopper locale
LOGO.Value = strLOGO; // logo location
ORDERID.Value = strOrderID; // *this ORDER ID*
OWNERADDRESS.Value = strAddressline1n2; // AddressLine2
OWNERCTY.Value = strBillCountry; // Bill Country
OWNERTELNO.Value = strContactTel; // Contact Telephone number
OWNERTOWN.Value = strBillTown; // Bill Town
OWNERZIP.Value = strPcde; // Postcode
PMLISTTYPE.Value = strPMLISTTYPE; // Payment Method List type
PSPID.Value = strPSPID; // *Your PSPID*
BGCOLOR.Value = strBGCOLOR; // Page Background Colour
BUTTONBGCOLOR.Value = strBUTTONBGCOLOR; // Button Colour
BUTTONTXTCOLOR.Value = strBUTTONTXTCOLOR; // Button Text Colour
TBLBGCOLOR.Value = strTBLBGCOLOR; // Table BG Colour
TBLTXTCOLOR.Value = strTBLTXTCOLOR; // Table Text Colour
TITLE.Value = strTITLE; // Title
TXTCOLOR.Value = strTXTCOLOR; // Page Text Colour
if (isAlias)
{
ALIAS.Value = strALIAS;
ALIASUSAGE.Value = strALIASUSAGE;
ALIASOPERATION.Value = strALIASOPERATION;
}
SHASign.Value = SHA1HashData(plainDigest); // Hashed String of plain digest put into sha sign using SHA1HashData function
}
}
I found the answer to my question via customer service to Barclaycard epdq. I hope this helps others. For me the answer is the point selected in bold below.
Please see below details on how to rectify the error ‘unknown order/1/s/’:
This error indicates that ePDQ has been unable to decrypt the SHASIGN HTML Form value sent with the customer when you redirect them from your website to the ePDQ Hosted Payment Page.
The typical reasons for this error are:
• The SHA-IN Passphrase value configured in the ePDQ back office does not match the value you used to encrypt the transaction data used to create the SHASIGN parameter (please also ensure you are sending transactions to the correct ePDQ environment – TEST or PRODUCTION)
• You have not arranged the parameters in alphabetical order when calculating the SHASIGN in your server-side code
• You have not correctly declared some of the parameters – all parameters and values are case sensitive (all parameter names must be upper case)
• You have set a HASH ALGORITHM value that is different to the SHA method used in your server side script (for example, you have configured SHA-256 in the ePDQ Back Office Technical Information settings, but are using a SHA-1 method in your encryption process).
• You have passed additional parameter/value pairs in the HTML Form that have not been included in the SHA-IN calculation
For more information please refer to the Basic & Advanced e-Commerce integration guides located in the ePDQ Back Office under Support –> Integration & User Manuals.

Google Apps Script: How to pull values from column A based on values in column E and send all values in one email?

I'm trying to create a script for a student attendance spreadsheet that will look in Column E for the string "X". For each instance of "X", the string from column A (the student name) will be added to the body of an email. I'm pretty new to JavaScript, although I have been studying the basics. I've done a lot of research and found some scripts I was able to modify to send an individual email for each instance of X in E. However, I have not been able to figure out how to combine that information into a single email.
Here's what I have so far:
function Email_ReminderNS() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("July_August"),
EMAIL_SENT = "EMAIL_SENT",
statusArray = sheet.getDataRange().getValues();
var class = statusArray[0][8],
status = "X",
email = "XXXX"
for (i=7;i < statusArray.length;i++){
var emailSent = statusArray[i][84];
if (status == statusArray[i][4] & emailSent != EMAIL_SENT) {
var student = statusArray[i][0];
var body = "This is a No-Show Report for " +student+ " from " + class;
var subject = "No-Show Report for " + student+ " from " + class;
MailApp.sendEmail(email,subject,body,{NoReply : true});
sheet.getRange(i+1, 85).setValue(EMAIL_SENT);
SpreadsheetApp.flush();
}
}
}
I realize I'll probably need to move the sendEmail function to be outside the IF statement. I tried to create an array with the names and join those into a string and add it to the body of the email, but I've had no luck. It just ended up sending the last name instead of all of them.
If anyone has any suggestions for me I would be deeply grateful.
First set up variables to keep track of which student did not show up:
var students = [];
var student_rows = [];
Then, add student to these arrays when X is found:
if (status == statusArray[i][4] & emailSent != EMAIL_SENT) {
var student = statusArray[i][0];
students.push(student);
student_rows.push(i+1);
}
Then send the email with all student names combined (outside of the for loop like you said)
var body = "This is a No-Show Report for " + students.join(', ') + " from " + class;
var subject = "No-Show Report for " + students.join(', ') + " from " + class;
MailApp.sendEmail(email,subject,body,{NoReply : true});
Finally update the spreadsheet indicating which names were in that email:
for (var i=0; i<student_rows.length; i++) {
sheet.getRange(student_rows[i], 85).setValue(EMAIL_SENT);
SpreadsheetApp.flush();
}
Here's the complete script:
function Email_ReminderNS() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("July_August"),
EMAIL_SENT = "EMAIL_SENT",
statusArray = sheet.getDataRange().getValues();
var class = statusArray[0][8],
status = "X",
email = "francis#bposolutions.com";
var students = [];
var student_rows = [];
for (i=7;i < statusArray.length;i++){
var emailSent = statusArray[i][84];
if (status == statusArray[i][4] & emailSent != EMAIL_SENT) {
var student = statusArray[i][0];
students.push(student);
student_rows.push(i+1);
}
}
var body = "This is a No-Show Report for " + students.join(', ') + " from " + class;
var subject = "No-Show Report for " + students.join(', ') + " from " + class;
MailApp.sendEmail(email,subject,body,{NoReply : true});
for (var i=0; i<student_rows.length; i++) {
sheet.getRange(student_rows[i], 85).setValue(EMAIL_SENT);
SpreadsheetApp.flush();
}
}
There are probably many ways to implement a new version of your code, the other answer probably works but I think it can be improved (a bit).
First of all, you can get rid of the flush method that does nothing else than slowing down the function (it was originally used in the Google example to check the sent status row by row, it is useless when we send only one mail with all the data in it)
Secondly, it might be a good idea to use html format to get a better looking result.
And lastly, it is good practice to write back to the sheet using one setValues instead of multiple setValue() in a loop.
Here is a possible replacement code, you'll have to "tune" it to your needs to eventually improve the message format but the main structure is there and working.
function Email_ReminderNS() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("July_August"),
statusArray = sheet.getDataRange().getValues();
var email = Session.getActiveUser().getEmail(); //replace with the email you want, this value will send mails to you I used it for test.
var class = statusArray[0][8],
status = "X",
students = [];
for (var i=7;i < statusArray.length; i++){
var emailSent = statusArray[i][84];
if (status == statusArray[i][4] & emailSent != "EMAIL_SENT") {
students.push(statusArray[i][0]);
statusArray[i][84]="EMAIL_SENT";
}
}
var subject = "No-Show Report for " + students.length + " from " + class;
var textBody = "This is a No-Show Report for " +students.length+ " from " + class+"\n";
var HTMLBody = "<b>This is a No-Show Report for " +students.length+ " from " + class+"</b><br><br>"
+'<table style="background-color:lightblue;border-collapse:collapse;" border = 1 cellpadding = 5><th>Sent Mails</th><tr>';
for(var n in students){
HTMLBody += '<tr><td>'+n+'</td><td>'+statusArray[n][0]+'</td></tr>';
textBody += '\n'+n+' - '+statusArray[n][0];
}
HTMLBody+='</table><BR> kind regards.' ;
textBody+='\n\nKind regards';
Logger.log(HTMLBody);
Logger.log(textBody);
MailApp.sendEmail(email,subject,textBody,{'NoReply' : true, 'htmlBody' : HTMLBody});
sheet.getRange(1,1,statusArray.length,statusArray[0].length).setValues(statusArray);
}

Conversion failed when converting the varchar value to data type

i search a lot but didn't find what i want this question is ask by many users here but i didn't find my solution so i ask this question.
i have page in which i have Assign and withdraw button which
is used to Assign and withdraw device id for the selected group
id (group id fetch from dropdownlist) from one list-box to another
that part is completed
Now when i add another device id for the same group id i need to
append that updated record and show it in listbox2.
here is my code:
string queryString1 = "select device_id from device_group_master where group_id='" + ddlGroupName.SelectedValue.ToString() +"'";
SqlDataAdapter newdataAdapter = new SqlDataAdapter(queryString1, con);
SqlCommandBuilder newcommandBuilder = new SqlCommandBuilder(newdataAdapter);
newdataAdapter.Fill(ds1, "table");
if (ds1.Tables["table"].Rows.Count != 0)
{
if (ds1.Tables["table"].Rows[0][0].ToString() == "0")
{
string queryString2 = "update DEVICE_GROUP_MASTER set DEVICE_ID='" + device.ToString() + "', NOT_EXCLUDE_DEVICE_ID='" + enable + "' where GROUP_ID='" + ddlGroupName.SelectedValue.ToString() + "'";
SqlCommand update = new SqlCommand(queryString2, con);
update.CommandType = CommandType.Text;
update.ExecuteNonQuery();
}
else
{
string append;
append = ds1.Tables["table"].Rows[0][0].ToString();
append += ","+ device;
string queryString2 = "update DEVICE_GROUP_MASTER set DEVICE_ID='" + append.ToString() + "' where GROUP_ID='" + ddlGroupName.SelectedValue.ToString() + "'";
SqlCommand update = new SqlCommand(queryString2, con);
update.CommandType = CommandType.Text;
update.ExecuteNonQuery();
}
}

more than one field cannot be used to specify a receiver

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.
The error message is:
Invalid request: More than one field cannot be used to specify a receiver
Here's the request I'm sending:
requestEnvelope.errorLanguage=en_US
&actionType=PAY_PRIMARY
&cancelUrl=http%3a%2f%2flocalhost%2fccc%2fProgramsandServices%2fCommunityFundingInitiative%2fOopsSome thingWentWrong!.aspx ¤cyCode=USD
&feesPayer=EACHRECEIVER
&ipnNotificationUrl=http%3a%2f%2flocalhost%2fccc%2fdesktopmodules%2fUCU_ProjectManagement%2fPayPalIPN.aspx
&receiverList.receiver(0).amount=10.00
&receiverList.receiver(0).email=A_VALID_SANDBOX_EMAIL_ACCOUNT_ADDRESS_FOR_BUSINESS_OWNER
&receiverList.receiver(0).phone.countryCode=001
&receiverList.receiver(0).phone.phoneNumber=VALID_PHONE_NUMBER
&receiverList.receiver(0).primary=true
&receiverList.receiver(0).invoiceId=51%7c1%7c6%2f16%2f2013+4%3a35%3a56+PM
&receiverList.receiver(0).paymentType=GOODS
&receiverList.receiver(1).amount=9.5000
&receiverList.receiver(1).email=A_VALID_SANDBOX_EMAIL_ACCOUNT_ADDRESS
&receiverList.receiver(1).phone.countryCode=001
&receiverList.receiver(1).phone.phoneNumber=VALID_PHONE_NUMBER
&receiverList.receiver(1).primary=false
&receiverList.receiver(1).invoiceId=51%7c1%7c6%2f16%2f2013+4%3a35%3a56+PM
&receiverList.receiver(1).paymentType=GOODS
&reverseAllParallelPaymentsOnError=false
&senderEmail=A_VALID_SANDBOX_PERSONAL_EMAIL_ACCOUNT
&returnUrl=http%3a%2f%2flocalhost%2fccc%2fProgramsandServices%2fCommunityFundingInitiative%2fThankYouforYourDonation.aspx
&trackingId=51%7c0%7c6%2f16%2f2013+4%3a35%3a56+PM&
I specified two receivers, one is Primary other is not.
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.
Here's the 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;
}
If you've worked through this or can spot the error, please let me know!
Thanks.
Removing the phone number fields returns a successful response. I'm not certain if phone number fields are not supposed to be available in a Delayed Chained Payment transaction. I'm going to have to reach out to the product team for Adaptive Payments and find out from them.
Edit: The phone number has to be a confirmed mobile one. The error you're getting is because the phone number field can also be used to define the receiver so you're actually attempting to define the receivers twice.
The request I tested with (the same as yours but has Sandbox e-mail addresses set) -
requestEnvelope.errorLanguage=en_US
actionType=PAY_PRIMARY
cancelUrl=http://localhost/ccc/ProgramsandServices/CommunityFundingInitiative/OopsSomethingWentWrong!.aspx
currencyCode=USD
feesPayer=EACHRECEIVER
ipnNotificationUrl=http://localhost/ccc/desktopmodules/UCU_ProjectManagement/PayPalIPN.aspx
receiverList.receiver(0).amount=10.00
receiverList.receiver(0).email=bending#bender.com
receiverList.receiver(0).primary=true
receiverList.receiver(0).invoiceId=51|1|6/16/2013 4:35:56 PM
receiverList.receiver(0).paymentType=GOODS
receiverList.receiver(1).amount=9.50
receiverList.receiver(1).email=stuff#stuffers.com
receiverList.receiver(1).primary=false
receiverList.receiver(1).invoiceId=51|1|6/16/2013 4:35:56 PM
receiverList.receiver(1).paymentType=GOODS
reverseAllParallelPaymentsOnError=false
senderEmail=testingAccess8x#paypal.com
returnUrl=http://localhost/ccc/ProgramsandServices/CommunityFundingInitiative/ThankYouforYourDonation.aspx
trackingId=51|0|6/16/2013 4:35:56 PM