本文整理汇总了PHP中Paypal::get_currency方法的典型用法代码示例。如果您正苦于以下问题:PHP Paypal::get_currency方法的具体用法?PHP Paypal::get_currency怎么用?PHP Paypal::get_currency使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Paypal
的用法示例。
在下文中一共展示了Paypal::get_currency方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_payment
/**
* Payment deatails and paypal configuration can be configured here
* @return [view] Renders view with form inputs
*/
public function action_payment()
{
// validation active
//$this->template->scripts['footer'][]= '/js/oc-panel/settings.js';
Breadcrumbs::add(Breadcrumb::factory()->set_title(__('Payments')));
$this->template->title = __('Payments');
// all form config values
$paymentconf = new Model_Config();
$config = $paymentconf->where('group_name', '=', 'payment')->find_all();
$paypal_currency = Paypal::get_currency();
// currencies limited by paypal
// save only changed values
if ($this->request->post()) {
$validation = Validation::factory($this->request->post())->rule('sandbox', 'range', array(':value', 0, 1))->rule('authorize_sandbox', 'range', array(':value', 0, 1))->rule('stripe_address', 'range', array(':value', 0, 1));
if ($validation->check()) {
foreach ($config as $c) {
$config_res = $this->request->post($c->config_key);
if ($c->config_key == 'paypal_currency') {
$config_res = $paypal_currency[core::post('paypal_currency')];
}
if ($config_res != $c->config_value) {
$c->config_value = $config_res;
try {
$c->save();
} catch (Exception $e) {
echo $e;
}
}
}
} else {
$errors = $validation->errors('config');
foreach ($errors as $error) {
Alert::set(Alert::ALERT, $error);
}
$this->redirect(Route::url('oc-panel', array('controller' => 'settings', 'action' => 'payment')));
}
Alert::set(Alert::SUCCESS, __('Payment Configuration updated'));
$this->redirect(Route::url('oc-panel', array('controller' => 'settings', 'action' => 'payment')));
}
$pages = array('' => __('Deactivated'));
foreach (Model_Content::get_pages() as $key => $value) {
$pages[$value->seotitle] = $value->title;
}
$this->template->content = View::factory('oc-panel/pages/settings/payment', array('config' => $config, 'pages' => $pages, 'paypal_currency' => $paypal_currency));
}
示例2: action_payment
/**
* Payment deatails and paypal configuration can be configured here
* @return [view] Renders view with form inputs
*/
public function action_payment()
{
// validation active
//$this->template->scripts['footer'][]= '/js/oc-panel/settings.js';
Breadcrumbs::add(Breadcrumb::factory()->set_title(__('Payments')));
$this->template->title = __('Payments');
// all form config values
$paymentconf = new Model_Config();
$config = $paymentconf->where('group_name', '=', 'payment')->find_all();
$paypal_currency = Paypal::get_currency();
// currencies limited by paypal
// save only changed values
if ($this->request->post()) {
foreach ($config as $c) {
$config_res = $this->request->post($c->config_key);
if ($c->config_key == 'paypal_currency') {
$config_res = $paypal_currency[core::post('paypal_currency')];
}
if ($config_res != $c->config_value) {
$c->config_value = $config_res;
try {
$c->save();
} catch (Exception $e) {
echo $e;
}
}
}
Alert::set(Alert::SUCCESS, __('General Configuration updated'));
$this->request->redirect(Route::url('oc-panel', array('controller' => 'settings', 'action' => 'payment')));
}
$this->template->content = View::factory('oc-panel/pages/settings/payment', array('config' => $config, 'paypal_currency' => $paypal_currency));
}