本文整理汇总了PHP中Provider::FromPaymentConfigCode方法的典型用法代码示例。如果您正苦于以下问题:PHP Provider::FromPaymentConfigCode方法的具体用法?PHP Provider::FromPaymentConfigCode怎么用?PHP Provider::FromPaymentConfigCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Provider
的用法示例。
在下文中一共展示了Provider::FromPaymentConfigCode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __Construct
function __Construct($dictionary)
{
parent::__Construct(get_class(), "desktop.html", $dictionary);
//get input params
$paymentConfigCode = Params::Get('state');
$authCode = Params::Get('code');
//load provider (verify code)
$provider = Provider::FromPaymentConfigCode($paymentConfigCode);
if (is_null($provider)) {
//TODO: deal with this
} else {
//check stripe id isn't already set
if (!is_null($provider->getStripeAccountId())) {
//TODO: deal with this
} else {
$stripeAccount = StripeConnector::ConstructAccount($authCode);
if (is_null($stripeAccount)) {
//TODO: deal with this
} else {
//add to provider - clear code
$provider->setStripeAccountId($stripeAccount->getId());
$provider->setPaymentConfigCode(null);
$provider->save();
//notify success
$this->connected = true;
}
}
}
}
示例2: HomePage
} else {
$response = new HomePage($dictionary);
}
} else {
//special cases
if ($element0 == 'contact') {
$response = new HomePage($dictionary, true);
} elseif ($element0 == 'sitemap') {
$response = new SitemapResponse();
} elseif ($element0 == 'verify') {
$provider = Provider::FromVerificationCode($element1);
if (!is_null($provider)) {
$response = new ProviderSetupPage($dictionary, $provider);
}
} elseif ($element0 == 'stripe-setup') {
$provider = Provider::FromPaymentConfigCode($element1);
if (!is_null($provider)) {
$response = new StripeSetupPage($dictionary, $provider);
}
} elseif ($element0 == 'stripe-return') {
$response = new StripeReturnPage($dictionary);
} elseif ($client == 'mobile' && $element0 == 'static') {
$response = new MobileHoldingPage($dictionary);
} else {
//cmsPage
$cmsPage = null;
if ($element0 != '' && $element1 == '') {
$cmsPage = CmsPage::FromUri(Application::SITE_CODE, $element0);
} elseif ($element0 != '' && $element1 != '') {
$cmsPage = CmsPage::FromUri(Application::SITE_CODE, $element1, $element0);
}