public function start(array $items, $settings = array(), $paymentMethod = 'paypal', $currency = 'USD') { ## unable to authenticate if (!$this->authenthication($settings['environment'])) { return false; } #set ApiContext $apiContext = PaypalContext::ApiContext($this->credentials, $this->sdkConfiguration); #set payment method $payer = PaymentMethod::ConfigPayment($paymentMethod); #set Items and Total to bill if (!($itemsList = Items::setItemsList($items, $currency))) { ## unable to load the items to sell. return false; } #set final amount. $amount = Amount::setAmount(Items::getTotal(), $currency); #set transaction. $transaction = Transaction::setTransaction($amount, $itemsList); #set redirections. $redirectUrls = Redirections::setURLs(); self::_createPaymentURL($payer, $redirectUrls, $transaction, $apiContext); }