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


PHP Gateway::create方法代码示例

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


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

示例1: __construct

 public function __construct($controller, $name, $order)
 {
     /* Store Settings Object */
     $conf = StoreSettings::get_settings();
     /* Comments Box, if enabled */
     if ($conf->CheckoutSettings_OrderComments) {
         $comments = TextareaField::create("CustomerComments", "Order Comments");
         $comments->setRightTitle("These comments will be seen by staff.");
     } else {
         $comments = HiddenField::create("CustomerComments", "");
     }
     /* Terms and Conditions, if enabled */
     if ($conf->CheckoutSettings_TermsAndConditions) {
         $terms = CheckboxField::create("Terms", "I agree to " . $conf->StoreSettings_StoreName . "'s " . "<a href=" . DataObject::get_by_id("SiteTree", $conf->CheckoutSettings_TermsAndConditionsSiteTree)->URLSegment . ">" . "Terms &amp; Conditions</a>.");
     } else {
         $terms = HiddenField::create("Terms", "");
     }
     /* Fields */
     $fields = FieldList::create($comments, OptionsetField::create("PaymentMethod", "Payment Method", Gateway::create()->getGateways($order)), $terms ? HeaderField::create("Terms and Conditions", 5) : HiddenField::create("TermsHeaderField", ""), $terms);
     /* Actions */
     $actions = FieldList::create(FormAction::create('payment', 'Place Order &amp; Continue to Payment'));
     /* Required Fields */
     $required = new RequiredFields(array("PaymentMethod", $terms ? "Terms" : null));
     /*
      * Now we create the actual form with our fields and actions defined 
      * within this class.
      */
     return parent::__construct($controller, $name, $fields, $actions, $required);
 }
开发者ID:micschk,项目名称:torindul-silverstripe-shop,代码行数:29,代码来源:OrderPaymentForm.php

示例2: run

 public function run()
 {
     Eloquent::unguard();
     $gateways = [['name' => 'BeanStream', 'provider' => 'BeanStream', 'payment_library_id' => 2], ['name' => 'Psigate', 'provider' => 'Psigate', 'payment_library_id' => 2], ['name' => 'moolah', 'provider' => 'AuthorizeNet_AIM', 'sort_order' => 1, 'recommended' => 1, 'site_url' => 'https://invoiceninja.mymoolah.com/', 'payment_library_id' => 1], ['name' => 'Alipay', 'provider' => 'Alipay_Express', 'payment_library_id' => 1], ['name' => 'Buckaroo', 'provider' => 'Buckaroo_CreditCard', 'payment_library_id' => 1], ['name' => 'Coinbase', 'provider' => 'Coinbase', 'payment_library_id' => 1], ['name' => 'DataCash', 'provider' => 'DataCash', 'payment_library_id' => 1], ['name' => 'Neteller', 'provider' => 'Neteller', 'payment_library_id' => 1], ['name' => 'Pacnet', 'provider' => 'Pacnet', 'payment_library_id' => 1], ['name' => 'PaymentSense', 'provider' => 'PaymentSense', 'payment_library_id' => 1], ['name' => 'Realex', 'provider' => 'Realex_Remote', 'payment_library_id' => 1], ['name' => 'Sisow', 'provider' => 'Sisow', 'payment_library_id' => 1], ['name' => 'Skrill', 'provider' => 'Skrill', 'payment_library_id' => 1]];
     foreach ($gateways as $gateway) {
         if (!DB::table('gateways')->where('name', '=', $gateway['name'])->get()) {
             Gateway::create($gateway);
         }
     }
 }
开发者ID:stewartadam,项目名称:invoice-ninja,代码行数:10,代码来源:PaymentLibrariesSeeder.php

示例3: run

 public function run()
 {
     Eloquent::unguard();
     $gateways = [array('name' => 'BeanStream', 'provider' => 'BeanStream', 'payment_library_id' => 2), array('name' => 'Psigate', 'provider' => 'Psigate', 'payment_library_id' => 2)];
     $updateProviders = array(0 => 'AuthorizeNet_AIM', 4 => 'PayPal_Pro', 5 => 'TwoCheckout');
     foreach ($gateways as $gateway) {
         Gateway::create($gateway);
     }
     Gateway::whereIn('provider', $updateProviders)->update(array('recommended' => 1));
     Gateway::where('provider', '=', 'AuthorizeNet_AIM')->update(array('sort_order' => 5, 'site_url' => 'http://reseller.authorize.net/application/?id=5560364'));
     //Gateway::where('provider', '=', 'BeanStream')->update(array('sort_order' => 10, 'site_url' => 'http://www.beanstream.com/'));
     //Gateway::where('provider', '=', 'FirstData_Connect')->update(array('sort_order' => 20, 'site_url' => 'https://www.firstdata.com/'));
     Gateway::where('provider', '=', 'PayPal_Pro')->update(array('sort_order' => 25, 'site_url' => 'https://www.paypal.com/'));
     Gateway::where('provider', '=', 'TwoCheckout')->update(array('sort_order' => 30, 'site_url' => 'https://www.2checkout.com/referral?r=2c37ac2298'));
 }
开发者ID:poseidonjm,项目名称:invoice-ninja,代码行数:15,代码来源:PaymentLibrariesSeeder.php

示例4: getCMSFields

 /**
  * getCMSFields
  * Construct the FieldList used in the CMS. To provide a
  * smarter UI we don't use the scaffolding provided by
  * parent::getCMSFields.
  * 
  * @return FieldList
  */
 public function getCMSFields()
 {
     Requirements::css('torindul-silverstripe-shop/css/LeftAndMain.css');
     //Create the FieldList and push the Root TabSet on to it.
     $fields = FieldList::create($root = TabSet::create('Root', Tab::create("Main", HeaderField::create("Add/Edit Payment"))));
     /* 
      * If a Payment Gateway/Method hasn't been selected yet, prompt for one.
      * Otherwise, show the form fields for the database fields in the Order_Payment DataObject.
      */
     if (!$this->exists()) {
         $fields->addFieldsToTab("Root.Main", array(CompositeField::create(DropdownField::create("ClassName", "Payment Method", Gateway::create()->getGateways($this->Order(), true))->setRightTitle("Which payment method did the customer pay with?")->setEmptyString("(Select one)"))));
     } else {
         $fields->addFieldsToTab("Root.Main", array(CompositeField::create(DateField::create("Date", "Payment Date")->setConfig('dateformat', 'dd-MM-yyyy')->setConfig('showcalendar', true)->setRightTitle('To open a pop-up calendar click on the text field above.'), DropdownField::create("Status", "Payment Status", array("Pending" => "Pending", "Processing" => "Processing", "Denied" => "Denied", "Completed" => "Completed", "Refunded" => "Refunded")), FieldGroup::create("Amounts", NumericField::create("Amount", "Payment Amount")->setRightTitle("How much was paid?"), DropdownField::create("Currency", "Payment Currency", DataObject::get("StoreCurrency", "(`Enabled`=1)")->map("ID", "Code"))->setRightTitle("In which currency was the payment?")))));
     }
     return $fields;
 }
开发者ID:micschk,项目名称:torindul-silverstripe-shop,代码行数:24,代码来源:Order_Payment.php

示例5: saveNewGateway

 /**
  * saveNewGateway
  *
  * @param string $sProcessUID Default value empty
  * @param string $sTaskUID Default value empty
  * @param string $sNextTask Default value empty
  * @param string $sType Default value empty (Route Type)
  * @return string $sGatewayUID
  */
 public function saveNewGateway($sProcessUID = '', $sTaskUID = '', $sNextTask = '', $sType = '')
 {
     try {
         $oTask = new Task();
         $aTaskDetails = $oTask->load($sTaskUID);
         $aFields['PRO_UID'] = $sProcessUID;
         $aFields['TAS_UID'] = $sTaskUID;
         $aFields['GAT_NEXT_TASK'] = $sNextTask;
         $aFields['GAT_X'] = $aTaskDetails['TAS_POSX'] + $aTaskDetails['TAS_WIDTH'] / 2;
         $aFields['GAT_Y'] = $aTaskDetails['TAS_POSY'] + $aTaskDetails['TAS_HEIGHT'] + 10;
         switch ($sType) {
             case 'PARALLEL':
                 $aFields['GAT_TYPE'] = 'bpmnGatewayParallel';
                 break;
             case 'SEC-JOIN':
                 $aFields['GAT_TYPE'] = 'bpmnGatewayParallel';
                 break;
             case 'EVALUATE':
                 $aFields['GAT_TYPE'] = 'bpmnGatewayExclusiveData';
                 break;
             case 'PARALLEL-BY-EVALUATION':
                 $aFields['GAT_TYPE'] = 'bpmnGatewayInclusive';
                 break;
             case 'SELECT':
                 $aFields['GAT_TYPE'] = 'bpmnGatewayExclusiveData';
                 break;
             case 'DISCRIMINATOR':
                 $aFields['GAT_TYPE'] = 'bpmnGatewayComplex';
                 break;
         }
         $oGateway = new Gateway();
         $sGatewayUID = $oGateway->create($aFields);
         return $sGatewayUID;
     } catch (Exception $oError) {
         throw $oError;
     }
 }
开发者ID:rodrigoivan,项目名称:processmaker,代码行数:46,代码来源:class.processMap.php

示例6: run

 public function run()
 {
     // TEST DATA
     /*
     $contact = new Contact;
     $contact->first_name = 'Hillel';
     $contact->last_name = 'Hillel';
     $contact->email = 'hillelcoren@gmail.com';
     $contact->last_name = '2125551234';
     $client->contacts()->save($contact);
     
     $invoice = new Invoice;
     $invoice->invoice_number = '0001';
     $client->invoices()->save($invoice);
     
     $invoice = new Invoice;
     $invoice->invoice_number = '0002';
     $client->invoices()->save($invoice);
     
     $invoice = new Invoice;
     $invoice->invoice_number = '0003';
     $client->invoices()->save($invoice);
     
     $invoice = new Invoice;
     $invoice->invoice_number = '0004';
     $client->invoices()->save($invoice);
     */
     PaymentType::create(array('name' => 'Apply Credit'));
     PaymentType::create(array('name' => 'Bank Transfer'));
     PaymentType::create(array('name' => 'Cash'));
     PaymentType::create(array('name' => 'Debit'));
     PaymentType::create(array('name' => 'ACH'));
     PaymentType::create(array('name' => 'Visa Card'));
     PaymentType::create(array('name' => 'MasterCard'));
     PaymentType::create(array('name' => 'American Express'));
     PaymentType::create(array('name' => 'Discover Card'));
     PaymentType::create(array('name' => 'Diners Card'));
     PaymentType::create(array('name' => 'EuroCard'));
     PaymentType::create(array('name' => 'Nova'));
     PaymentType::create(array('name' => 'Credit Card Other'));
     PaymentType::create(array('name' => 'PayPal'));
     PaymentType::create(array('name' => 'Google Wallet'));
     PaymentType::create(array('name' => 'Check'));
     Theme::create(array('name' => 'amelia'));
     Theme::create(array('name' => 'cerulean'));
     Theme::create(array('name' => 'cosmo'));
     Theme::create(array('name' => 'cyborg'));
     Theme::create(array('name' => 'flatly'));
     Theme::create(array('name' => 'journal'));
     Theme::create(array('name' => 'readable'));
     Theme::create(array('name' => 'simplex'));
     Theme::create(array('name' => 'slate'));
     Theme::create(array('name' => 'spacelab'));
     Theme::create(array('name' => 'united'));
     Theme::create(array('name' => 'yeti'));
     InvoiceStatus::create(array('name' => 'Draft'));
     InvoiceStatus::create(array('name' => 'Sent'));
     InvoiceStatus::create(array('name' => 'Viewed'));
     InvoiceStatus::create(array('name' => 'Partial'));
     InvoiceStatus::create(array('name' => 'Paid'));
     Frequency::create(array('name' => 'Weekly'));
     Frequency::create(array('name' => 'Two weeks'));
     Frequency::create(array('name' => 'Four weeks'));
     Frequency::create(array('name' => 'Monthly'));
     Frequency::create(array('name' => 'Three months'));
     Frequency::create(array('name' => 'Six months'));
     Frequency::create(array('name' => 'Annually'));
     Industry::create(array('name' => 'Accounting & Legal'));
     Industry::create(array('name' => 'Advertising'));
     Industry::create(array('name' => 'Aerospace'));
     Industry::create(array('name' => 'Agriculture'));
     Industry::create(array('name' => 'Automotive'));
     Industry::create(array('name' => 'Banking & Finance'));
     Industry::create(array('name' => 'Biotechnology'));
     Industry::create(array('name' => 'Broadcasting'));
     Industry::create(array('name' => 'Business Services'));
     Industry::create(array('name' => 'Commodities & Chemicals'));
     Industry::create(array('name' => 'Communications'));
     Industry::create(array('name' => 'Computers & Hightech'));
     Industry::create(array('name' => 'Defense'));
     Industry::create(array('name' => 'Energy'));
     Industry::create(array('name' => 'Entertainment'));
     Industry::create(array('name' => 'Government'));
     Industry::create(array('name' => 'Healthcare & Life Sciences'));
     Industry::create(array('name' => 'Insurance'));
     Industry::create(array('name' => 'Manufacturing'));
     Industry::create(array('name' => 'Marketing'));
     Industry::create(array('name' => 'Media'));
     Industry::create(array('name' => 'Nonprofit & Higher Ed'));
     Industry::create(array('name' => 'Pharmaceuticals'));
     Industry::create(array('name' => 'Professional Services & Consulting'));
     Industry::create(array('name' => 'Real Estate'));
     Industry::create(array('name' => 'Retail & Wholesale'));
     Industry::create(array('name' => 'Sports'));
     Industry::create(array('name' => 'Transportation'));
     Industry::create(array('name' => 'Travel & Luxury'));
     Industry::create(array('name' => 'Other'));
     Industry::create(array('name' => 'Photography'));
     Size::create(array('name' => '1 - 3'));
     Size::create(array('name' => '4 - 10'));
//.........这里部分代码省略.........
开发者ID:poseidonjm,项目名称:invoice-ninja,代码行数:101,代码来源:ConstantsSeeder.php


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