本文整理汇总了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));
}
示例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();
}
示例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();
}
示例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++;
}
示例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;
}