This commit is contained in:
aozhiwei 2023-08-02 13:30:09 +08:00
parent 928b6f6615
commit 21dc8f1d57
3 changed files with 19 additions and 21 deletions

View File

@ -248,8 +248,7 @@ class ShopController extends BaseAuthedController {
}
if (!in_array($goodsMeta['shop_id'],
array(
mt\Shop::INAPP_SHOP_CEG,
mt\Shop::INAPP_SHOP_DIAMOND
mt\Shop::INAPP_SHOP_CEG
)
)) {
$this->_rspErr(3, "inapp purchase failed");

View File

@ -43,7 +43,6 @@ class Shop {
const WEEKLY_BUY_LIMIT = 2;
const TOTAL_BUY_LIMIT = 3;
const INAPP_SHOP_CEG = 7;
const INAPP_SHOP_DIAMOND = 9;
const OUTSIDE_SHOP = 100;

View File

@ -16,11 +16,28 @@ use models\ShopBuyRecord;
use services\LogService;
// {
// channel: 'google',
// sign: '123456677' // 签名字段
// records: [{
// productId: '2999', // 从google play console获取的product id
// gameOrderId: '1231321312', // 开始支付时, 从游戏相关服务那获得的订单id
// orderId: 'GPA.3355-1172-9416-16839', // 从google develope API 获取的订单id
// status: 9, // 订单状态, 上报的订单状态一般只有2种情况, 9: 支付成功, 96: 用户退款
// }]
// }
// let reportData: any = {
// channel: 'google',
// records,
// }
// const hashSort = ''
// const signStr = 'channel=google&' + records.map(record =>Object.keys(record).sort().map(key => `${key}=${record[key]}`).join('&')).join('&')
class InAppPurchase {
public function process()
{
error_log('ShopInappPurchaseDiamonds:' . json_encode($_REQUEST, JSON_PRETTY_PRINT));
error_log('ShopInappPurchaseDiamonds:' . json_encode($_REQUEST));
error_log('----- inappPurchaseDiamonds -----');
$body = json_decode(file_get_contents('php://input'), true);
error_log('body:' . json_encode($body));
@ -28,23 +45,6 @@ class InAppPurchase {
$records = $body['records'];
$sign = $body['sign'];
// {
// channel: 'google',
// sign: '123456677' // 签名字段
// records: [{
// productId: '2999', // 从google play console获取的product id
// gameOrderId: '1231321312', // 开始支付时, 从游戏相关服务那获得的订单id
// orderId: 'GPA.3355-1172-9416-16839', // 从google develope API 获取的订单id
// status: 9, // 订单状态, 上报的订单状态一般只有2种情况, 9: 支付成功, 96: 用户退款
// }]
// }
// let reportData: any = {
// channel: 'google',
// records,
// }
// const hashSort = ''
// const signStr = 'channel=google&' + records.map(record =>Object.keys(record).sort().map(key => `${key}=${record[key]}`).join('&')).join('&')
// const sign = hmacsha256(signStr, hashSort)
// 定义一个空数组,用来存放每个记录的键值对字符串