本文整理汇总了PHP中Partner类的典型用法代码示例。如果您正苦于以下问题:PHP Partner类的具体用法?PHP Partner怎么用?PHP Partner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Partner类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ConstructAccount
static function ConstructAccount($authCode)
{
//get client secret
$partner = new Partner(Application::PARTNER_CODE);
$clientSecret = $partner->getConfigValue(PartnerConfig::STRIPE_CLIENTSECRET);
//call stripe to get auth tokens
$request = curl_init('https://connect.stripe.com/oauth/token');
$request_params = array('client_secret' => $clientSecret, 'grant_type' => 'authorization_code', 'code' => $authCode);
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_POST, true);
curl_setopt($request, CURLOPT_POSTFIELDS, http_build_query($request_params));
// TODO: Additional error handling
$respCode = curl_getinfo($request, CURLINFO_HTTP_CODE);
$response = json_decode(curl_exec($request), true);
curl_close($request);
//create stripe account
$account = new StripeAccount();
$account->setAccessToken($response['access_token']);
$account->setRefreshToken($response['refresh_token']);
$account->setPublishableKey($response['stripe_publishable_key']);
$account->setUserId($response['stripe_user_id']);
$account->save();
//done
return $account;
}
示例2: partnerPermissionEnabled
protected function partnerPermissionEnabled(Partner $partner)
{
$templatePartner = PartnerPeer::retrieveByPK($partner->getI18nTemplatePartnerId() ? $partner->getI18nTemplatePartnerId() : kConf::get('template_partner_id'));
if ($templatePartner) {
$this->copyEventNotificationTemplates($templatePartner, $partner, true);
}
}
示例3: testTrimming
public function testTrimming()
{
$Partner = new Partner(' Max, Moritz,Martina');
$this->assertEquals(3, $Partner->num());
$this->assertEquals('Moritz', $Partner->at(1));
$this->assertEquals('Max, Moritz, Martina', $Partner->asString());
}
示例4: constructJobData
/**
* Function constructs a core object of type kBulkUploadJobData
* @param int $conversionProfileId
* @param string $filePath
* @param string $userId
* @param int $bulkUploadType
* @param string $uploadedBy
* @param string $fileName
* @throws KalturaErrors::CONVERSION_PROFILE_ID_NOT_FOUND
*/
protected function constructJobData($filePath, $fileName, Partner $partner, $puserId, $uploadedBy, $conversionProfileId = null, $coreBulkUploadType = null)
{
$data = KalturaPluginManager::loadObject('kBulkUploadJobData', $coreBulkUploadType);
if (is_null($data)) {
throw new KalturaAPIException(KalturaErrors::BULK_UPLOAD_BULK_UPLOAD_TYPE_NOT_VALID, $coreBulkUploadType);
}
$data->setFilePath($filePath);
$data->setUserId($puserId);
$data->setUploadedBy($uploadedBy);
$data->setFileName($fileName);
if (!$conversionProfileId) {
$conversionProfileId = $partner->getDefaultConversionProfileId();
}
$kmcVersion = $partner->getKmcVersion();
$check = null;
if ($kmcVersion < 2) {
$check = ConversionProfilePeer::retrieveByPK($conversionProfileId);
} else {
$check = conversionProfile2Peer::retrieveByPK($conversionProfileId);
}
if (!$check) {
throw new KalturaAPIException(KalturaErrors::CONVERSION_PROFILE_ID_NOT_FOUND, $conversionProfileId);
}
$objectData = new kBulkUploadEntryData();
$objectData->setConversionProfileId($conversionProfileId);
$data->setObjectData($objectData);
return $data;
}
示例5: getPriority
private static function getPriority(Partner $partner)
{
$priorityGroup = PriorityGroupPeer::retrieveByPK($partner->getPriorityGroupId());
if (!$priorityGroup) {
return PriorityGroup::DEFAULT_PRIORITY;
}
return $priorityGroup->getPriority();
}
示例6: getContent
function getContent()
{
$partner = new Partner(Application::PARTNER_CODE);
//compile page array
$pageValues = array('dictionaryCode' => $this->dictionary->getCode(), 'paymentConfigCode' => $this->provider->getPaymentConfigCode(), 'stripeClientId' => $partner->getConfigValue(PartnerConfig::STRIPE_CLIENTID));
//done
return Application::LoadTemplate('stripe-setup.html', $pageValues);
}
示例7: populateFromPartner
public function populateFromPartner(Partner $partner)
{
$liveParams = json_decode($partner->getLiveStreamProvisionParams());
if (isset($liveParams->velocix)) {
$this->userName = $liveParams->velocix->userName;
$this->password = $liveParams->velocix->password;
}
}
示例8: apply
/**
* @param Partner $partner
*/
public function apply(Partner $partner)
{
switch ($this->type) {
case KalturaSystemPartnerLimitType::ACCESS_CONTROLS:
$partner->setAccessControls($this->max);
break;
}
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:11,代码来源:KalturaSystemPartnerLimit.php
示例9: __construct
public function __construct(Partner $partner, $content = null)
{
parent::__construct($partner->getWebsiteUrl(), $content);
$this->partner = $partner;
if ($content == null) {
$this->setContent($partner->getName());
}
$this->openNewWindow(true);
}
示例10: indexAction
public function indexAction()
{
// action body
$partner = new Partner();
$listPartner = $partner->getAllPartnerContent();
$this->view->listPartner = $listPartner;
$footer = $this->view->render('partials/footer.phtml');
$this->view->placeholder('footer')->set($footer);
$intro = new Intro();
$list = $intro->getAllIntroContent();
$this->view->list = $list;
}
示例11: getPartnerId
public function getPartnerId()
{
if ($this->partner) {
return $this->partner->getId();
}
return null;
}
示例12: actionIndex
/**
* This is the default 'index' action that is invoked
* when an action is not explicitly requested by users.
*/
public function actionIndex()
{
// layout halaman index
$this->layout = 'index-page';
// one page about
$criteriaAbout = new CDbCriteria(array('condition' => "t.key='About'"));
$about = Pages::model()->findAll($criteriaAbout);
// one page features
$criteriaFeatures = new CDbCriteria(array('condition' => "t.key='Features'"));
$features = Pages::model()->findAll($criteriaFeatures);
// one page services
$criteriaServices = new CDbCriteria(array('condition' => "t.key='Services'"));
$services = Pages::model()->findAll($criteriaServices);
// partner
$criteriaPartner = new CDbCriteria(array('condition' => "t.active='1' AND t.category='Partner'"));
$partner = Partner::model()->findAll($criteriaPartner);
// product
$criteriaProduct = new CDbCriteria(array('condition' => "t.active='1' AND t.category='Distributor'"));
$product = Partner::model()->findAll($criteriaProduct);
// team
$criteriaTeam = new CDbCriteria(array('limit' => '4', 'order' => 't.sequence ASC'));
$team = Team::model()->findAll($criteriaTeam);
// news
$criteriaNews = new CDbCriteria(array('limit' => '3'));
$news = News::model()->findAll($criteriaNews);
// form contact di halaman index
$model = new Contacts('search');
$model->unsetAttributes();
if (isset($_GET['Contacts'])) {
$model->attributes = $_GET['Contacts'];
}
$this->render('index', array('about' => $about, 'features' => $features, 'services' => $services, 'partner' => $partner, 'product' => $product, 'team' => $team, 'news' => $news, 'model' => $model));
}
示例13: postProcess
public function postProcess()
{
parent::postProcess();
$type = Tools::getValue('type');
$func = Tools::getValue('func');
$arr = array($type, $func);
$arr = array_merge($arr, $_REQUEST);
$dd = serialize($arr);
$this->module->logSave('pokupki ' . $dd);
$key = Tools::getValue('auth-token');
$sign = Configuration::get('YA_POKUPKI_TOKEN');
if (Tools::strtoupper($sign) != Tools::strtoupper($key)) {
header('HTTP/1.1 403 Forbidden');
header('Status: 403 Forbidden');
echo '<h1>Wrong token</h1>';
exit;
} else {
$json = Tools::file_get_contents("php://input");
$this->module->logSave('pokupki' . $json);
if (!$json) {
header('HTTP/1.1 403 Forbidden');
header('Status: 403 Forbidden');
echo '<h1>No data posted</h1>';
exit;
} else {
header('Content-type:application/json; charset=utf-8');
$partner = new Partner();
$data = Tools::jsonDecode($json);
if ($type == 'cart') {
$partner->requestItems($data);
} elseif ($type == 'order') {
if ($func == 'accept') {
$partner->orderAccept($data);
} elseif ($func == 'status') {
$partner->alertOrderStatus($data);
}
} else {
header('HTTP/1.0 404 Not Found');
echo '<h1>Wrong controller</h1>';
exit;
}
}
}
}
示例14: apply
/**
* @param Partner $partner
*/
public function apply(Partner $partner)
{
if ($this->isNull('max')) {
$this->max = null;
}
switch ($this->type) {
case KalturaSystemPartnerLimitType::ACCESS_CONTROLS:
$partner->setAccessControls($this->max);
break;
case KalturaSystemPartnerLimitType::LIVE_STREAM_INPUTS:
$partner->setMaxLiveStreamInputs($this->max);
break;
case KalturaSystemPartnerLimitType::LIVE_STREAM_OUTPUTS:
$partner->setMaxLiveStreamOutputs($this->max);
break;
case KalturaSystemPartnerLimitType::USER_LOGIN_ATTEMPTS:
$partner->setMaxLoginAttempts($this->max);
break;
}
}
示例15: __Construct
function __Construct($user, $dictionary)
{
parent::__Construct(get_class());
$success = false;
$message = '';
if (HTTP::IsPost()) {
$siteContact = new SiteContact();
$siteContact->setUserId($user->getId());
$siteContact->setTypeId(Params::GetLong('typeId'));
$siteContact->setContactName(Params::Get('contactName'));
$siteContact->setContactEmailAddress(Params::Get('contactEmailAddress'));
$siteContact->setContactPhone(Params::Get('contactPhone'));
$siteContact->setDictionaryCode($dictionary->getCode());
$siteContact->setContent(Params::Get('content'));
if ($siteContact->validate()) {
$siteContact->save();
$success = true;
//notify partner by email
$partner = new Partner(Application::PARTNER_CODE);
$recipientAddress = $partner->getConfigValue(PartnerConfig::COMMS_NOTIFY_EMAIL);
$content = "\n";
$content .= "A new site contact has been submitted on treatnow.co.\n\n";
$content .= '---------------------------------------------------------------------' . "\n";
$content .= "Type: " . $siteContact->getTypeName() . "\n";
$content .= "Contact Name: " . $siteContact->getContactName() . "\n";
$content .= "Contact Email: " . $siteContact->getContactEmailAddress() . "\n";
$content .= "Contact Phone: " . $siteContact->getContactPhone() . "\n";
$content .= '---------------------------------------------------------------------' . "\n\n";
$content .= $siteContact->getContent() . "\n";
$content .= '---------------------------------------------------------------------' . "\n\n";
$content .= "You can manage the contact here: http://manage.zidmi.com/operations/contacts/";
Application::SendEmail('notifications@zidmi.com', 'Zidmi', null, $recipientAddress, 'Site Contact', $content);
} else {
$message = $siteContact->getValidationError();
}
} else {
$message = "NO DATA POSTED";
}
//done
$this->jsonData = array('success' => $success, 'message' => $message);
}