PayPal\Api\Invoice::setLogoUrl PHP Method

setLogoUrl() public method

Full URL of an external image to use as the logo. Maximum length is 4000 characters.
public setLogoUrl ( string $logo_url )
$logo_url string
    public function setLogoUrl($logo_url)
    {
        UrlValidator::validate($logo_url, "LogoUrl");
        $this->logo_url = $logo_url;
        return $this;
    }

Usage Example

示例#1
0
$tax2->setPercent(3)->setName("Local Tax on Injection");
$items[1]->setTax($tax2);
$invoice->setItems($items);
// #### Final Discount
// You can add final discount to the invoice as shown below. You could either use "percent" or "value" when providing the discount
$cost = new Cost();
$cost->setPercent("2");
$invoice->setDiscount($cost);
$invoice->getPaymentTerm()->setTermType("NET_45");
// ### Shipping Information
$invoice->getShippingInfo()->setFirstName("Sally")->setLastName("Patient")->setBusinessName("Not applicable")->setPhone(new Phone())->setAddress(new InvoiceAddress());
$invoice->getShippingInfo()->getPhone()->setCountryCode("001")->setNationalNumber("5039871234");
$invoice->getShippingInfo()->getAddress()->setLine1("1234 Main St.")->setCity("Portland")->setState("OR")->setPostalCode("97217")->setCountryCode("US");
// ### Logo
// You can set the logo in the invoice by providing the external URL pointing to a logo
$invoice->setLogoUrl('https://www.paypalobjects.com/webstatic/i/logo/rebrand/ppcom.svg');
// For Sample Purposes Only.
$request = clone $invoice;
try {
    // ### Create Invoice
    // Create an invoice by calling the invoice->create() method
    // with a valid ApiContext (See bootstrap.php for more on `ApiContext`)
    $invoice->create($apiContext);
} catch (Exception $ex) {
    // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
    ResultPrinter::printError("Create Invoice", "Invoice", null, $request, $ex);
    exit(1);
}
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printResult("Create Invoice", "Invoice", $invoice->getId(), $request, $invoice);
return $invoice;
All Usage Examples Of PayPal\Api\Invoice::setLogoUrl