Example #1
0
 /**
  * Get JS files
  *
  * @return array
  */
 public function getJSFiles()
 {
     $list = parent::getJSFiles();
     $api = \XLite\Module\CDev\Paypal\Main::getRESTAPIInstance();
     if ($api->isInContextSignUpAvailable()) {
         $list[] = 'modules/CDev/Paypal/settings/signup.js';
     }
     return $list;
 }
Example #2
0
 /**
  * Get URL of referral page
  *
  * @param \XLite\Model\Payment\Method $method Payment method
  *
  * @return string
  */
 public function getReferralPageURL(\XLite\Model\Payment\Method $method)
 {
     $api = \XLite\Module\CDev\Paypal\Main::getRESTAPIInstance();
     $controller = \XLite::getController();
     if ($api->isInContextSignUpAvailable()) {
         $returnUrl = $controller->getShopURL($controller->buildURL('paypal_settings', 'update_credentials'));
         $url = $api->getSignUpUrl($returnUrl);
     } else {
         $url = parent::getReferralPageURL($method);
     }
     return $url;
 }
Example #3
0
 /**
  * Is In-Context Boarding SignUp available
  *
  * @return boolean
  */
 public function isInContextSignUpAvailable()
 {
     $api = Paypal\Main::getRESTAPIInstance();
     return $api->isInContextSignUpAvailable();
 }
Example #4
0
 /**
  * Get default attributes
  *
  * @return array
  */
 protected function getDefaultAttributes()
 {
     $params = array('target' => 'PPFrame', 'data-paypal-button' => 'true');
     $api = \XLite\Module\CDev\Paypal\Main::getRESTAPIInstance();
     return $api->isInContextSignUpAvailable() ? $params : array();
 }