setEmail() public method

Email Address associated with the Payee's PayPal Account. If the provided email address is not associated with any PayPal Account, the payee can only receive PayPal Wallet Payments. Direct Credit Card Payments will be denied due to card compliance requirements.
public setEmail ( string $email )
$email string
Ejemplo n.º 1
0
 public static function createPayee()
 {
     $payee = new Payee();
     $payee->setEmail(self::$email);
     $payee->setMerchantId(self::$merchant_id);
     $payee->setPhone(self::$phone);
     return $payee;
 }
// Use this optional field to set additional
// payment information such as tax, shipping
// charges etc.
$details = new Details();
$details->setShipping(1.2)->setTax(1.3)->setSubtotal(17.5);
// ### Amount
// Lets you specify a payment amount.
// You can also specify additional details
// such as shipping, tax.
$amount = new Amount();
$amount->setCurrency("USD")->setTotal(20)->setDetails($details);
// ### Payee
// Specify a payee with that user's email or merchant id
// Merchant Id can be found at https://www.paypal.com/businessprofile/settings/
$payee = new Payee();
$payee->setEmail("*****@*****.**");
// ### Transaction
// A transaction defines the contract of a
// payment - what is the payment for and who
// is fulfilling it.
$transaction = new Transaction();
$transaction->setAmount($amount)->setItemList($itemList)->setDescription("Payment description")->setPayee($payee)->setInvoiceNumber(uniqid());
// ### Redirect urls
// Set the urls that the buyer must be redirected to after
// payment approval/ cancellation.
$baseUrl = getBaseUrl();
$redirectUrls = new RedirectUrls();
$redirectUrls->setReturnUrl("{$baseUrl}/ExecutePayment.php?success=true")->setCancelUrl("{$baseUrl}/ExecutePayment.php?success=false");
// ### Payment
// A Payment Resource; create one using
// the above types and intent set to 'sale'