本文整理汇总了PHP中Transaction::setType方法的典型用法代码示例。如果您正苦于以下问题:PHP Transaction::setType方法的具体用法?PHP Transaction::setType怎么用?PHP Transaction::setType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transaction
的用法示例。
在下文中一共展示了Transaction::setType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildTransferReversal
private function buildTransferReversal($xml)
{
$transferReversal = new TransferReversal();
$transferReversal->setRequestId((string) $xml->RequestId);
$transferReversal->setOriginalRequestId((string) $xml->OriginalRequestId);
$transferReversal->setTransactionReference((string) $xml->TransactionReference);
$transactionHistory = new TransactionHistory();
$tmpTransaction = new Transaction();
$transaction = $xml->TransactionHistory->Transaction;
$tmpTransaction->setType((string) $transaction->Type);
$tmpTransaction->setSystemTraceAuditNumber((string) $transaction->SystemTraceAuditNumber);
$tmpTransaction->setNetworkReferenceNumber((string) $transaction->NetworkReferenceNumber);
$tmpTransaction->setSettlementDate((string) $transaction->SettlementDate);
$tmpResponse = new Response();
$response = $transaction->Response;
$tmpResponse->setCode((string) $response->Code);
$tmpResponse->setDescription((string) $response->Description);
$tmpTransaction->setSubmitDateTime((string) $transaction->SubmitDateTime);
$tmpTransaction->setResponse($tmpResponse);
$transactionHistory->setTransaction($tmpTransaction);
$transferReversal->setTransactionHistory($transactionHistory);
return $transferReversal;
}
示例2: retrieveByClient
static public function retrieveByClient($status, $client_id = null)
{
//echo $status;
$types= array('all','sell','purchase','switch');
$statuses= array('all','pending','completed','cancelled');
if(!in_array($status,$statuses))
if(!in_array($status,$types))
die('Wrong status when getting tranaction collection!');
$IsTypeOriented = in_array($status,$statuses) ? false: true;
if(!$client_id)
die('Should add case for all clients!');
$transactions= array();
if($IsTypeOriented)
$addition = ($status!= 'all') ? " AND types = '$status'" : "";
else
$addition = ($status!= 'all') ? " AND status = '$status'" : "";
$query = " SELECT t.id, t.created_at, t.comment_user, t.comment_admin, a.name aname, i.fund_name name,
i.ISIN code, t.status, t.types, t.amount1 FROM transactions t, custody_ac a, fund i
WHERE t.id_client = '$client_id' AND a.id = t.id_account AND i.id = t.id_isin1 $addition ";
//echo $query;
$qres=mysql_query($query) or die(mysql_error());
while($row=mysql_fetch_assoc($qres))
{
if(trim($row['id_isin2']))
{
$query = " SELECT name, code FROM isin WHERE id = '".trim($row['id_isin2'])."' LIMIT 1";
//die($query);
$qres1=mysql_query($query);
$crow=mysql_fetch_assoc($qres1);
}
$transaction = new Transaction();
$transaction->setId($row['id']);
$transaction->setStatus($row['status']);
$transaction->setType($row['types']);
$transaction->setCommentUser($row['comment_user']);
$transaction->setCommentAdmin($row['comment_admin']);
$transaction->setSecurity1($row['name']);
$transaction->setAmount1($row['amount1']);
$transaction->setSecurity2($crow['name']?$crow['name']:0);
$transaction->setAmount2($row['amount2']);
$transaction->setIsin($row['code']);
$transaction->setIsin2($crow['code']);
$transaction->setAccount($row['aname']);
$transaction->setDatetime($row['created_at']);
$transactions[] = $transaction;
}
return $transactions;
}
示例3: buildTransfer
private function buildTransfer($xml)
{
$transfer = new Transfer();
$transfer->setRequestId((string) $xml->RequestId);
$transfer->setTransactionReference((string) $xml->TransactionReference);
$transactionHistory = new TransactionHistory();
$transactionArray = array();
foreach ($xml->TransactionHistory->Transaction as $transaction) {
$tmpTransaction = new Transaction();
$tmpTransaction->setType((string) $transaction->Type);
$tmpTransaction->setSystemTraceAuditNumber((string) $transaction->SystemTraceAuditNumber);
$tmpTransaction->setNetworkReferenceNumber((string) $transaction->NetworkReferenceNumber);
$tmpTransaction->setSettlementDate((string) $transaction->SettlementDate);
$tmpResponse = new Response();
$response = $transaction->Response;
$tmpResponse->setCode((string) $response->Code);
$tmpResponse->setDescription((string) $response->Description);
$tmpTransaction->setSubmitDateTime((string) $transaction->SubmitDateTime);
$tmpTransaction->setResponse($tmpResponse);
array_push($transactionArray, $tmpTransaction);
}
$transactionHistory->setTransaction($transactionArray);
$transfer->setTransactionHistory($transactionHistory);
return $transfer;
}
示例4: readTransaction
public static function readTransaction($str_xml)
{
// Parser
$parser = new xmlParser($str_xml);
// <transaction>
$data = $parser->getResult('transaction');
$transaction = new Transaction();
// <transaction> <lastEventDate>
if (isset($data["lastEventDate"])) {
$transaction->setLastEventDate($data["lastEventDate"]);
}
// <transaction> <date>
if (isset($data["date"])) {
$transaction->setDate($data["date"]);
}
// <transaction> <code>
if (isset($data["code"])) {
$transaction->setCode($data["code"]);
}
// <transaction> <reference>
if (isset($data["reference"])) {
$transaction->setReference($data["reference"]);
}
// <transaction> <type>
if (isset($data["type"])) {
$transaction->setType(new TransactionType($data["type"]));
}
// <transaction> <status>
if (isset($data["status"])) {
$transaction->setStatus(new TransactionStatus($data["status"]));
}
if (isset($data["paymentMethod"]) && is_array($data["paymentMethod"])) {
// <transaction> <paymentMethod>
$paymentMethod = new PaymentMethod();
// <transaction> <paymentMethod> <type>
if (isset($data["paymentMethod"]['type'])) {
$paymentMethod->setType(new PaymentMethodType($data["paymentMethod"]['type']));
}
// <transaction> <paymentMethod> <code>
if (isset($data["paymentMethod"]['code'])) {
$paymentMethod->setCode(new PaymentMethodCode($data["paymentMethod"]['code']));
}
$transaction->setPaymentMethod($paymentMethod);
}
// <transaction> <grossAmount>
if (isset($data["grossAmount"])) {
$transaction->setGrossAmount($data["grossAmount"]);
}
// <transaction> <discountAmount>
if (isset($data["discountAmount"])) {
$transaction->setDiscountAmount($data["discountAmount"]);
}
// <transaction> <feeAmount>
if (isset($data["feeAmount"])) {
$transaction->setFeeAmount($data["feeAmount"]);
}
// <transaction> <netAmount>
if (isset($data["netAmount"])) {
$transaction->setNetAmount($data["netAmount"]);
}
// <transaction> <extraAmount>
if (isset($data["extraAmount"])) {
$transaction->setExtraAmount($data["extraAmount"]);
}
// <transaction> <installmentCount>
if (isset($data["installmentCount"])) {
$transaction->setInstallmentCount($data["installmentCount"]);
}
if (isset($data["items"]['item']) && is_array($data["items"]['item'])) {
$items = array();
$i = 0;
if (isset($data["items"]['item'][0])) {
foreach ($data["items"]['item'] as $key => $value) {
$item = self::parseTransactionItem($value);
$items[$i] = $item;
$i++;
}
} else {
$items[0] = self::parseTransactionItem($data["items"]['item']);
}
// <transaction> <items>
$transaction->setItems($items);
}
if (isset($data["sender"])) {
// <transaction> <sender>
$sender = new Sender();
// <transaction> <sender> <name>
if (isset($data["sender"]["name"])) {
$sender->setName($data["sender"]["name"]);
}
// <transaction> <sender> <email>
if (isset($data["sender"]["email"])) {
$sender->setEmail($data["sender"]["email"]);
}
if (isset($data["sender"]["phone"])) {
// <transaction> <sender> <phone>
$phone = new Phone();
// <transaction> <sender> <phone> <areaCode>
if (isset($data["sender"]["phone"]["areaCode"])) {
$phone->setAreaCode($data["sender"]["phone"]["areaCode"]);
//.........这里部分代码省略.........