Commit a1e73bae by TingSong-Syu

import pay_center classes

parent a1bce805
......@@ -10,7 +10,7 @@
}
],
"require": {
"x2ts/x2ts-rpc": "^2.0"
"x2ts/x2ts-rpc": "^2.1"
},
"autoload": {
"psr-4": {
......
<?php
/**
* Created by IntelliJ IDEA.
* User: rek
* Date: 2017/5/12
* Time: PM1:21
*/
namespace neoteched\rpc;
use x2ts\rpc\RPCWrapper;
class PayCenter extends RPCWrapper {
}
\ No newline at end of file
<?php
/**
* Created by IntelliJ IDEA.
* User: rek
* Date: 2017/5/11
* Time: PM4:36
*/
namespace neoteched\rpc\pay_center;
use Exception;
class ApiException extends Exception {
}
\ No newline at end of file
<?php
/**
* Created by IntelliJ IDEA.
* User: rek
* Date: 2017/5/10
* Time: PM6:25
*/
namespace neoteched\rpc\pay_center;
trait AssignTrait {
public function assign(array $array) {
foreach ($array as $key => $value) {
if (property_exists($this, $key)) {
$this->$key = $value;
}
}
return $this;
}
}
\ No newline at end of file
<?php
/**
* Created by IntelliJ IDEA.
* User: rek
* Date: 2017/5/10
* Time: PM2:40
*/
namespace neoteched\rpc\pay_center;
use x2ts\IAssignable;
class Feature implements IAssignable {
use AssignTrait;
const TYPE_CARD = 'card';
const MAP_TYPE = [
'',
self::TYPE_CARD,
];
public $name = '';
public $description = '';
public $type = '';
public $ctime = 0;
public $mtime = 0;
}
\ No newline at end of file
<?php
/**
* Created by IntelliJ IDEA.
* User: rek
* Date: 2017/5/10
* Time: PM3:09
*/
namespace neoteched\rpc\pay_center;
use x2ts\IAssignable;
class Order implements IAssignable {
use AssignTrait;
const ST_NEW = 'new';
const ST_PAID = 'paid';
const ST_CLOSED = 'closed';
const ST_REFUNDING = 'refunding';
const ST_REFUNDED = 'refunded';
const ST_PRESENT = 'present';
const PAY_PRESENT = 'present';
const PAY_WX = 'wx';
const PAY_ALI = 'ali';
const PAY_OFFLINE = 'offline';
public $id = 0;
public $product_id = 0;
public $user_id = 0;
public $state = 'new';
public $ctime = 0;
public $mtime = 0;
public $money = 0;
public $available = 1;
public $comment = '';
public $since = null;
public $until = null;
public $use_wxpay = 0;
public $real_pay_method = 0;
}
\ No newline at end of file
<?php
/**
* Created by IntelliJ IDEA.
* User: rek
* Date: 2017/5/11
* Time: PM3:57
*/
namespace neoteched\rpc\pay_center;
use Exception;
class OrderClosedException extends Exception {
}
\ No newline at end of file
<?php
/**
* Created by IntelliJ IDEA.
* User: rek
* Date: 2017/5/11
* Time: PM3:58
*/
namespace neoteched\rpc\pay_center;
use Exception;
class OrderPaidException extends Exception {
}
\ No newline at end of file
<?php
/**
* Created by IntelliJ IDEA.
* User: rek
* Date: 2017/5/10
* Time: PM2:26
*/
namespace neoteched\rpc\pay_center;
use x2ts\IAssignable;
class Product implements IAssignable {
use AssignTrait;
public $name = '';
public $price = 0;
public $can_buy = 1;
public $repeatable = 0;
public $description = '';
public $ctime = 0;
public $mtime = 0;
}
\ No newline at end of file
<?php
/**
* Created by IntelliJ IDEA.
* User: rek
* Date: 2017/5/11
* Time: PM2:25
*/
namespace neoteched\rpc\pay_center;
use Exception;
class ProductCannotBeBoughtException extends Exception {
}
\ No newline at end of file
<?php
/**
* Created by IntelliJ IDEA.
* User: rek
* Date: 2017/5/10
* Time: PM3:39
*/
namespace neoteched\rpc\pay_center;
use x2ts\IAssignable;
class Purpose implements IAssignable {
use AssignTrait;
/**
* @var string $productName 产品名称
*/
public $productName = '';
/**
* @var int $userId 购买用户ID
*/
public $userId = 0;
/**
* @var int $money 支付金额
*/
public $money = null;
/**
* @var string $payMethod 支付方式
*/
public $payMethod = Order::PAY_PRESENT;
/**
* @var string $comment 备注
*/
public $comment = '';
/**
* @var string|null $since 有效期起点
*/
public $since = null;
/**
* @var string|null $until 有效期终点
*/
public $until = null;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment