<?php
 
    /**
 
     * @author Mubashir Ali (Lahore, Pakistan)
 
     * [email protected]
 
     * @category Paypal Invoice API
 
     * @@abstract This performs the UpdateInvoice API Operation
 
     * @since 03-01-2011
 
     * @version 2.0
 
     */
 
 
    $API_Username = "xxxxxxxxxxxxxxxxx.xxx.xxx";
 
    $API_Password = "xxxxxxxxxx";
 
    $Signature    = "xxxxxxxxxxxxxxxxx.xxxxxxxxxxxxx-xxxxxxxxxxxxx-xxxxxxxxxx";
 
    $business = "[email protected]";
 
 
    require_once('class.invoice.php');
 
 
    $ppInv = new PaypalInvoiceAPI("sandbox");
 
 
    /**
 
     * Populate Data
 
     */
 
    $aryData['language'] = "en_US";
 
    $aryData['merchantEmail'] = $business;
 
 
    $aryData['payerEmail'] = "[email protected]";
 
    $aryData['currencyCode'] = "USD";
 
 
    $aryData['orderId'] = strtotime('now');
 
    $aryData['paymentTerms'] = "Net10";   //[DueOnReceipt, DueOnDateSpecified, Net10, Net15, Net30, Net45]
 
    $aryData['logoURL'] = "Company Logo URL";
 
    $aryData['invoiceID'] = "xxxx-xxxx-xxxx-xxxx-xxxx";
 
 
    $aryItems[0]['name'] = "Item 1";
 
    $aryItems[0]['description'] = "Item 1 Description";
 
    $aryItems[0]['date'] = "2011-12-31T05:38:48Z";
 
    $aryItems[0]['quantity'] = "2";
 
    $aryItems[0]['unitprice'] = "10.00";
 
    $aryItems[0]['taxName'] = "I Tax Name";
 
    $aryItems[0]['taxRate'] = "5.00";
 
 
    $res = $ppInv->doUpdateInvoice($aryData, $aryItems);
 
    if($res['responseEnvelope.ack']== "Success")
 
    {
 
        echo "<pre>";
 
        print_r($res);
 
        echo "</pre>";
 
    }
 
    else
 
    {
 
        echo $ppInv->formatErrorMessages($res);
 
    }
 
 
?>
 
 |