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


PHP Payment::write方法代码示例

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


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

示例1: testCreateIdentifier

 public function testCreateIdentifier()
 {
     $payment = new Payment();
     $payment->write();
     $this->assertNotNull($payment->Identifier);
     $this->assertNotEquals('', $payment->Identifier);
     $this->assertEquals(30, strlen($payment->Identifier));
 }
开发者ID:helpfulrobot,项目名称:silverstripe-silverstripe-omnipay,代码行数:8,代码来源:PaymentModelTest.php

示例2: markCompleted

 /**
  * Mark this payment process as completed.
  * This sets the desired end-status on the payment, sets the transaction reference and writes the payment.
  *
  * In subclasses, you'll want to override this and:
  * * Log/Write the GatewayMessage
  * * Call a "complete" hook
  *
  * Don't forget to call the parent method from your subclass!
  *
  * @param string $endStatus the end state to set on the payment
  * @param ServiceResponse $serviceResponse the service response
  * @param mixed $gatewayMessage the message from Omnipay
  * @return void
  */
 protected function markCompleted($endStatus, ServiceResponse $serviceResponse, $gatewayMessage)
 {
     $this->payment->Status = $endStatus;
     if ($gatewayMessage && ($reference = $gatewayMessage->getTransactionReference())) {
         $this->payment->TransactionReference = $reference;
     }
     $this->payment->write();
 }
开发者ID:burnbright,项目名称:silverstripe-omnipay,代码行数:23,代码来源:PaymentService.php

示例3: setup

 /**
  * Save preliminary data to database before processing payment
  */
 public function setup()
 {
     $this->payment->Amount->Amount = $this->paymentData['Amount'];
     $this->payment->Amount->Currency = $this->paymentData['Currency'];
     $this->payment->Reference = isset($this->paymentData['Reference']) ? $this->paymentData['Reference'] : null;
     $this->payment->Status = Payment::PENDING;
     $this->payment->Method = $this->methodName;
     $this->payment->write();
 }
开发者ID:vinstah,项目名称:body,代码行数:12,代码来源:PaymentProcessor.php

示例4: migrateRecord

 protected function migrateRecord($record)
 {
     $payment = new Payment($record);
     $payment->Status = "Created";
     $payment->ClassName = "Payment";
     $payment->MoneyAmount = $record['AmountAmount'];
     $payment->MoneyCurrency = $record['AmountCurrency'];
     $payment->Gateway = $this->classToGateway($record['ClassName']);
     $statusmap = array('Incomplete' => 'Created', 'Success' => 'Captured', 'Failure' => 'Void', 'Pending' => 'Authorized', '' => 'Created');
     $payment->Status = $statusmap[$record['Status']];
     $payment->write();
     $this->count++;
 }
开发者ID:helpfulrobot,项目名称:silverstripe-silverstripe-omnipay,代码行数:13,代码来源:MigratePaymentTask.php

示例5: generateNextPaymentFrom

 function generateNextPaymentFrom($latest)
 {
     switch ($this->Frequency) {
         case 'Weekly':
             $date = date('Y-m-d', strtotime('+1 week', strtotime($latest->PaymentDate)));
             break;
         case 'Monthly':
             $date = date('Y-m-d', strtotime('+1 month', strtotime($latest->PaymentDate)));
             break;
         case 'Yearly':
             $date = date('Y-m-d', strtotime('+1 year', strtotime($latest->PaymentDate)));
             break;
     }
     $payment = new Payment();
     $payment->RecurringPaymentID = $this->ID;
     $payment->PaymentDate = $date;
     $payment->Amount->Amount = $this->Amount->Amount;
     $payment->Amount->Currency = $this->Amount->Currency;
     $payment->write();
     return $payment;
 }
开发者ID:helpfulrobot,项目名称:silverstripe-payment,代码行数:21,代码来源:RecurringPayment.php


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