amount = $order->amount; # 分转分. $this->charge_amount = $order->amount; $this->order_id = $order->cpOrderId; $this->currency_type = $order->currency; $this->payment = $payMent; $this->product = $order->dbOrder()->product_id; # 附加一下道具id $this->channel = $order->channel; } } /** * 支付事件 * @author gwang */ class TapDBPayEvent { /** * 充值事件的数据格式的构造函数 * @param string $uid * @param \loyalsoft\pay\OrderNotice $order * @param string $payMent 支付渠道: alipay/wxpay */ public function __construct($order, $payMent) { $this->client_id = TapDB_config::Ins()->gameClientId; $this->user_id = $order->uid; // $this->index = TapDB_config::Ins()->gameClientId; // $this->identify = $order->uid; $this->properties = new TapDBPayEventProperties($order, $payMent); } // public $module = "GameAnalysis"; // 固定参数 public $name = "charge"; // 事件名,固定为 "charge" public $type = "track"; // 必须, 固定为 "track" // public $index = "APPID"; // 必需。注意APPID需要被替换成TapDB的appid // public $identify = "userId"; // 必需。用户ID。必须和SDK的setUser接口传递的userId一样,并且该用户已经通过SDK接口进行过推送 public $client_id; // 必需。注意 ClientID 需要被替换成游戏的 ClientID public $user_id; // 必需。用户ID。必须和SDK的setUser接口传递的userId一样,并且该用户已经通过SDK接口进行过推送 public $properties; // 充值属性值 }