Adding a note to the PayPal invoice?

Printer-friendly version    Send to friend    2 replies
Thrifty Vet
User offline. Last seen 26 weeks 5 days ago.

Is there a way to add an automated note to all PayPal transactions?   Such as modifying or creating a form element that sends when the customer clicks on checkout?

Reason for this is that we need to tell customers the estimated arrival time and would like to say "Please allow up to 15 business days (_FUTURE_DATE_) for delivery" as quite a few ignore (or don't see) the same note on the web site and go straight to PayPal to file non-receipt disputes.   The future date would be automatically calculated and added through XSLT or JavaScript.

I've done it before with PayPal itemized invoices on a different shopping cart by sending the note through the form options 'on0_1' and 'os0_1'

Thank you

5
Your rating: None Average: 5 (1 vote)
Thrifty Vet
User offline. Last seen 26 weeks 5 days ago.
RE: Adding a note to the PayPal invoice?

We desperatey need the ability to pass the estimated delivery note into the actual Paypal payment, a customer ordered off of the ASP web site on October 30th and has now filed a Paypal claim 5 business days later saying our "eBay site" promised delivery in 4 days or less which is impossible since we haven't sold anything on eBay since 2008. 

The customers can leave order comments why can't that be copied to PP???  As said before if I had full control over the ASP source code I could rig this myself. 

Thanks

Thrifty Vet
User offline. Last seen 26 weeks 5 days ago.
RE: Adding a note to the PayPal invoice?

Anyone figured it out yet??  I have everything ready except for the ability to submit comments or notes into the Paypal transaction...

Quick PHP code to serve the correct date off of a 2nd site: http://thriftyvet.com/D.php and also store the same date in cookie "TV_D":
<?php
setcookie("TV_D",date("n-j-Y"),time()+30000,"/","thriftyvet.com");
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
header("Content-type: application/x-javascript");

$Now = getdate();
echo "TV_Dt  = ('".date("n-j-Y")."').split('-');\n";
echo "TV_Day = ".$Now["wday"].";\n\n";
?>

JavaScript in the main template header loading up that code into the script only for normal http connections to avoid security warnings since the SSL certificate used is only registered to the CA (www.) side of the site, storing the date in a small cookie for the secure transition during checkout: 
var TV_Dt = false;
if (document.location.protocol == "http:") {
    document.writeln('<scr'+'ipt language="JavaScr'+'ipt" SRC="http://thriftyvet.com/D.php?dt='+Math.round(Math.random()*8888888)+'"></scr'+'ipt>');
    }

JavaScript functions to compute business days into the future:
function TV_BusinessDays(n,D){
    D = D || new Date();
    var num=Math.abs(n);
    var tem,count=0;
    var dir= (n<0)? -1: 1;
    while(count< num){
        D= new Date(D.setDate(D.getDate()+dir));
        if(D.isHoliday())continue;
        tem=D.getDay();
        if(tem!=0 && tem!=6) ++count;
        }
    return D.toDateString();
    }
Date.prototype.isHoliday=function(){
    var A = [this.getMonth()+1,this.getDate()]
    var hol = {
        'Christmas':[12,25],
        'GroundHogDay':[2,2]
        }
    var tem;
    for(var p in hol){
        tem= hol[p];
        if(A[0]==tem[0] && A[1]==tem[1]) return p;
        }
    return false;
    }

JavaScript towards the end of the page to format the date into a readable note or make up a new date based on the customer's own time/date settings if no date cookie is found: 
    var TV_DtJ = "";
    var TV_DtC = TV_getNote("TV_D");  /* ### ### business day estimator (starting point MM-DD-YYYY cookie) ### ### */
    if (TV_Dt === false) { 
        if (TV_DtC == "") {
            var TV_Dtd = new Date();    // no stored or PHP date found so create one from the customer's own settings (unreliable) and save it temporarily
            TV_DtJ = (parseInt(TV_Dtd.getMonth(),10) + 1) + "-" + TV_Dtd.getDate() + "-" + TV_Dtd.getFullYear();
            TV_Dt = TV_DtJ.split("-");
            TV_setNote("TV_D",TV_DtJ,1); // Custom 'setcookie' function set to expire after 1 day
            } else {
                TV_DtJ = TV_DtC;
  // no scripted date found so use the one found in the cookie
                TV_Dt = TV_DtC.split("-");
                }
        } else {
            TV_DtJ = TV_Dt.join("-");
   // PHP served date was found , use that (most reliable)
            if (TV_DtC != TV_DtJ) {
                TV_setNote("TV_D",TV_DtJ,1);
                }
            }
   
    var TV_StartDate = new Date(); // Create starting point based on above date
    TV_StartDate.setMonth(parseInt(TV_Dt[0],10) - 1);
    TV_StartDate.setDate(TV_Dt[1]);
    TV_StartDate.setFullYear(TV_Dt[2]);

Get the 2 future dates, 5 and 15 days:
    var TV_DT_Est_5  = TV_BusinessDays(5,TV_StartDate);
    var TV_DT_Est_15 = TV_BusinessDays(15,TV_StartDate);

And finally add that note to the "order notes" section of checkout which WORKS but only for the storefront side:
    if (document.getElementById("OrderNotes")) {
        if (!TV_GetValue("OrderNotes","V","").match(/[a-z]/i)) {
            TV_SetValue("OrderNotes","V","Allow 5 to 15 business days for delivery \n" + TV_DT_Est_15);
           }
        }

I haven't yet updated the code to add the actual exact date estimate (got it pending live testing last Friday) but the above order notes code has been working successfully to add the "Allow 5 to 15 business days for delivery" comment directly into the customer's adpdotnetstorefront file.  The main problem with using only that is customers will not always view the storefront receipt and instead use the emails CA and PP send which lack the specific dates.  I suspect the note would also appear inside the Paypal email if we can get this to work.

If it is possible there should only be 1 or 2 additional lines of code required to send the same comment to the Paypal side, we just need to know what form-submit variable name Paypal is expecting.  The variable names still are 'on0_1' and 'os0_1' for the older version of their interface but I do not want to randomly start plugging in things in because it might block the orders.

Thanks