当前位置: 首页>>代码示例>>PHP>>正文


PHP Payment::add方法代码示例

本文整理汇总了PHP中Payment::add方法的典型用法代码示例。如果您正苦于以下问题:PHP Payment::add方法的具体用法?PHP Payment::add怎么用?PHP Payment::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Payment的用法示例。


在下文中一共展示了Payment::add方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: create

 public function create()
 {
     // get transferred_at
     // $transferred_at = explode('-', Input::get('transferred_at'));
     // $transferred_at = mktime(0,0,0,$transferred_at[1],$transferred_at[0],$transferred_at[2]);
     $transferred_at = strtotime(Input::get('transferred_at'));
     // get input
     $input = array('user_id' => Auth::user()->id, 'currency' => Input::get('currency'), 'total' => Input::get('total'), 'transferred_at' => $transferred_at, 'to_bank' => Input::get('to_bank'), 'bank_name' => Input::get('bank_name'), 'bank_account' => Input::get('bank_account'), 'bank_account_name' => Input::get('bank_account_name'), 'message' => Input::get('message'), 'donation_ids' => Input::get('donation_ids'));
     $result = Payment::add($input);
     if ($result['success']) {
         Session::flash('success', 'Proses konfirmasi pengiriman donasi Anda berhasil. Selanjutnya kami mohon kesediaan Anda untuk menunggu Admin BagiKasih melakukan verifikasi. BagiKasih akan mengirim Anda email jika proses verivikasi telah dilakukan. Terima kasih.');
         if (Request::ajax()) {
             return Response::json(['success' => true, 'redirect_url' => URL::route('riwayat-donasi')]);
         } else {
             return $result;
         }
     } else {
         // if fail
         if (Request::ajax()) {
             return Response::json(json_encode($result));
         } else {
             return $result;
         }
     }
     return $result;
 }
开发者ID:whiterun,项目名称:bagikasih-v2,代码行数:26,代码来源:PaymentController.php

示例2: PayPalTxn

 static function create_from_pptxn($pptxn_id)
 {
     $t = new PayPalTxn($pptxn_id);
     # if it already has a payment_id, stop here and just return that id
     if ($t->payment_id() > 0) {
         return $t->payment_id();
     }
     $student_id = $t->student_id();
     if ($student_id === false) {
         return false;
     }
     $set = array('student_id' => $student_id, 'created_at' => 'NOW()');
     $money = $t->money();
     $set['currency'] = $money->code;
     $set['millicents'] = $money->millicents;
     $info = $t->infoarray();
     if (!isset($info['item_number'])) {
         return false;
     }
     $d = new Document($info['item_number']);
     if ($d->failed()) {
         return false;
     }
     $set['document_id'] = $d->id;
     $p = new Payment(false);
     $payment_id = $p->add($set);
     $t->set(array('payment_id' => $payment_id));
     return $payment_id;
 }
开发者ID:songwork,项目名称:songwork,代码行数:29,代码来源:Payment.php

示例3: testPaymentAdd

 function testPaymentAdd()
 {
     $p = new Payment(false);
     $set = array('student_id' => 1, 'document_id' => 3, 'currency' => 'EUR', 'millicents' => 15000, 'details' => 'nah', 'created_at' => '2008-11-01');
     $new_id = $p->add($set);
     $p = new Payment($new_id);
     $m = $p->money();
     $this->assertEquals('€1.50 EUR', $m->show_with_code());
 }
开发者ID:songwork,项目名称:songwork,代码行数:9,代码来源:testPayment.php

示例4: storePayments

 /**
  * Stores the Payments as present in the POST request
  *
  * See {@see Payment::delete()},
  * {@see Payment::add()}, and
  * {@see Payment::update()}.
  */
 static function storePayments()
 {
     $result = NULL;
     if (isset($_GET['delete_payment'])) {
         $payment_id = intval($_GET['delete_payment']);
         $result = Payment::delete($payment_id);
     }
     if (isset($result)) {
         self::$changed = true;
         self::$success &= $result;
     }
     //DBG::log("after Payment::delete: ".self::$success.", changed: ".self::$changed);
     $result = Payment::add();
     if (isset($result)) {
         self::$changed = true;
         self::$success &= $result;
     }
     //DBG::log("after Payment::add: ".self::$success.", changed: ".self::$changed);
     $result = Payment::update();
     if (isset($result)) {
         self::$changed = true;
         self::$success &= $result;
     }
     //DBG::log("after Payment::update: ".self::$success.", changed: ".self::$changed);
     Payment::reset();
     if (empty($_POST['bpayment'])) {
         return;
     }
     // NOTE: All the following could be handled by Payment::settings()
     \Cx\Core\Setting\Controller\Setting::set('payrexx_instance_name', trim(strip_tags(contrexx_input2raw($_POST['payrexx_instance_name']))));
     \Cx\Core\Setting\Controller\Setting::set('payrexx_api_secret', trim(strip_tags(contrexx_input2raw($_POST['payrexx_api_secret']))));
     \Cx\Core\Setting\Controller\Setting::set('payrexx_active', !empty($_POST['payrexx_active']));
     \Cx\Core\Setting\Controller\Setting::set('postfinance_shop_id', trim(strip_tags(contrexx_input2raw($_POST['postfinance_shop_id']))));
     \Cx\Core\Setting\Controller\Setting::set('postfinance_active', !empty($_POST['postfinance_active']));
     //        \Cx\Core\Setting\Controller\Setting::set('postfinance_hash_seed',
     //            trim(strip_tags(contrexx_input2raw($_POST['postfinance_hash_seed']);
     // Replaced by
     \Cx\Core\Setting\Controller\Setting::set('postfinance_hash_signature_in', trim(strip_tags(contrexx_input2raw($_POST['postfinance_hash_signature_in']))));
     \Cx\Core\Setting\Controller\Setting::set('postfinance_hash_signature_out', trim(strip_tags(contrexx_input2raw($_POST['postfinance_hash_signature_out']))));
     \Cx\Core\Setting\Controller\Setting::set('postfinance_authorization_type', trim(strip_tags(contrexx_input2raw($_POST['postfinance_authorization_type']))));
     // OBSOLETE -- Determined by the available cards and the PostFinance
     // backend settings
     //        \Cx\Core\Setting\Controller\Setting::set('postfinance_accepted_payment_methods', $strYellowpayAcceptedPM);
     \Cx\Core\Setting\Controller\Setting::set('postfinance_use_testserver', !empty($_POST['postfinance_use_testserver']));
     // Postfinance Mobile
     \Cx\Core\Setting\Controller\Setting::set('postfinance_mobile_webuser', trim(strip_tags(contrexx_input2raw($_POST['postfinance_mobile_webuser']))));
     \Cx\Core\Setting\Controller\Setting::set('postfinance_mobile_sign', trim(strip_tags(contrexx_input2raw($_POST['postfinance_mobile_sign']))));
     \Cx\Core\Setting\Controller\Setting::set('postfinance_mobile_ijustwanttotest', !empty($_POST['postfinance_mobile_ijustwanttotest']));
     \Cx\Core\Setting\Controller\Setting::set('postfinance_mobile_status', !empty($_POST['postfinance_mobile_status']));
     // Saferpay
     \Cx\Core\Setting\Controller\Setting::set('saferpay_id', trim(strip_tags(contrexx_input2raw($_POST['saferpay_id']))));
     \Cx\Core\Setting\Controller\Setting::set('saferpay_active', !empty($_POST['saferpay_active']));
     \Cx\Core\Setting\Controller\Setting::set('saferpay_finalize_payment', !empty($_POST['saferpay_finalize_payment']));
     \Cx\Core\Setting\Controller\Setting::set('saferpay_use_test_account', !empty($_POST['saferpay_use_test_account']));
     \Cx\Core\Setting\Controller\Setting::set('saferpay_window_option', intval($_POST['saferpay_window_option']));
     // Paypal
     \Cx\Core\Setting\Controller\Setting::set('paypal_account_email', trim(strip_tags(contrexx_input2raw($_POST['paypal_account_email']))));
     \Cx\Core\Setting\Controller\Setting::set('paypal_active', !empty($_POST['paypal_active']));
     \Cx\Core\Setting\Controller\Setting::set('paypal_default_currency', trim(strip_tags(contrexx_input2raw($_POST['paypal_default_currency']))));
     // Datatrans
     \Cx\Core\Setting\Controller\Setting::set('datatrans_merchant_id', trim(strip_tags(contrexx_input2raw($_POST['datatrans_merchant_id']))));
     \Cx\Core\Setting\Controller\Setting::set('datatrans_active', !empty($_POST['datatrans_active']));
     \Cx\Core\Setting\Controller\Setting::set('datatrans_request_type', trim(strip_tags(contrexx_input2raw($_POST['datatrans_request_type']))));
     \Cx\Core\Setting\Controller\Setting::set('datatrans_use_testserver', !empty($_POST['datatrans_use_testserver']));
     // Paymill
     \Cx\Core\Setting\Controller\Setting::set('paymill_active', !empty($_POST['paymill_active']));
     \Cx\Core\Setting\Controller\Setting::set('paymill_use_test_account', !empty($_POST['paymill_use_test_account']));
     \Cx\Core\Setting\Controller\Setting::set('paymill_test_private_key', trim(strip_tags(contrexx_input2raw($_POST['paymill_test_private_key']))));
     \Cx\Core\Setting\Controller\Setting::set('paymill_test_public_key', trim(strip_tags(contrexx_input2raw($_POST['paymill_test_public_key']))));
     \Cx\Core\Setting\Controller\Setting::set('paymill_live_private_key', trim(strip_tags(contrexx_input2raw($_POST['paymill_live_private_key']))));
     \Cx\Core\Setting\Controller\Setting::set('paymill_live_public_key', trim(strip_tags(contrexx_input2raw($_POST['paymill_live_public_key']))));
     // LSV
     \Cx\Core\Setting\Controller\Setting::set('payment_lsv_active', !empty($_POST['payment_lsv_active']));
     // All preceding should be handled by Payment::settings()
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:82,代码来源:ShopSettings.class.php


注:本文中的Payment::add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。