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


PHP Payment::getAmount方法代码示例

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


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

示例1: Payment

 function test_payment_amount()
 {
     $payment = new Payment(12.35, 'Inscripcio', '29292929');
     $this->assertEqual('1235', $payment->getAmount());
     $payment->setAmount(12);
     $this->assertEqual('1200', $payment->getAmount());
     $payment->setAmount(120);
     $this->assertEqual('12000', $payment->getAmount());
     $payment->setAmount(120.3);
     $this->assertEqual('12030', $payment->getAmount());
     $payment->setAmount(120.21);
     $this->assertEqual('12021', $payment->getAmount());
     $payment->setAmount('12.35');
     $this->assertEqual('1235', $payment->getAmount());
     $payment->setAmount('12');
     $this->assertEqual('1200', $payment->getAmount());
     $payment->setAmount('120');
     $this->assertEqual('12000', $payment->getAmount());
     $payment->setAmount('120.3');
     $this->assertEqual('12030', $payment->getAmount());
     $payment->setAmount('120.21');
     $this->assertEqual('12021', $payment->getAmount());
 }
开发者ID:ritxi,项目名称:sermepa_tpv,代码行数:23,代码来源:payment_test.php

示例2: dirname

<?php

include dirname(__FILE__) . '/../../bootstrap/Doctrine.php';
include dirname(__FILE__) . '/../../testTools.php';
$t = new lime_test(2, new lime_output_color());
PropertyTable::set('currency_decimals', 3);
$p = new Payment();
$p->setAmount(2.1215);
$t->is($p->getAmount(), 2.122, 'rounds amount to 3 decimals');
PropertyTable::set('currency_decimals', 2);
$p->setAmount(2.123);
$t->is($p->getAmount(), 2.12, 'rounds amount to 2 decimals');
开发者ID:solutema,项目名称:siwapp-sf1,代码行数:12,代码来源:PaymentTest.php

示例3: addPayment

 /**
  * Add the payment
  * 
  * @param \Cx\Modules\Order\Model\Entity\Payment $payment
  */
 public function addPayment(Payment $payment)
 {
     $payment->setInvoice($this);
     $this->payments[] = $payment;
     if ($payment->getAmount() == $this->getAmount()) {
         $this->paid = true;
     }
     if ($payment->getAmount() > $this->getAmount()) {
         throw new InvoiceException('Amount of payment must not be greater than invoice amount');
     }
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:16,代码来源:Invoice.class.php

示例4: isset

include_once 'include/common.php';
include_once 'include/ServiceRequest.php';
include_once 'include/AccessRights/SuperadminAdminClient.php';
$serviceRequestId = isset($_REQUEST["id"]) ? $_REQUEST["id"] : NULL;
$mode = isset($_REQUEST["paymentmode"]) ? $_REQUEST["paymentmode"] : NULL;
$isBank = $mode == "bank";
$isPaypal = $mode == "paypal";
$currentUser = $_SESSION["user"];
$serviceRequest = new ServiceRequest();
$serviceRequestDetails = $serviceRequest->getServiceRequest(array("service_no" => "DESC"), array("service_no" => array($serviceRequestId, Equal)));
$serviceRequestDetails = $serviceRequestDetails[0];
$payment = new Payment();
$payments = $payment->getPayments(array("payment_no" => "DESC"), array("service_no" => array($serviceRequestId, Equal)));
$totalPayments = 0;
foreach ($payments as $payment) {
    $totalPayments += $payment->getAmount();
}
if ($isPaypal && isset($_REQUEST["PaypalSubmit"])) {
    $paypal = new Paypal($_POST);
    if ($result = $paypal->DoPayment()) {
        $packageAmount = $serviceRequestDetails->getPackageDetails()[0]->getPrice();
        $paymenstatus = $totalPayments + $result["amount"] >= $packageAmount ? "complete" : "partial";
        $payment->setOr_id($result["transactionID"]);
        $payment->setMode("paypal");
        $payment->setAmount($result["amount"]);
        $payment->setService_no($serviceRequestId);
        $payment->setStat($paymenstatus);
        $payment->save();
        header("Location:ViewPayments.php?id=" . $serviceRequestId);
    } else {
        header("Location:" . $_SERVER["PHP_SELF"] . "?message=Failed");
开发者ID:bongdelarosa,项目名称:cateringsystem-bong,代码行数:31,代码来源:CreatePayment.php


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