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'], if (!in_array($goodsMeta['shop_id'],
array( array(
mt\Shop::INAPP_SHOP_CEG, mt\Shop::INAPP_SHOP_CEG
mt\Shop::INAPP_SHOP_DIAMOND
) )
)) { )) {
$this->_rspErr(3, "inapp purchase failed"); $this->_rspErr(3, "inapp purchase failed");

View File

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

View File

@ -16,18 +16,6 @@ use models\ShopBuyRecord;
use services\LogService; use services\LogService;
class InAppPurchase {
public function process()
{
error_log('ShopInappPurchaseDiamonds:' . json_encode($_REQUEST, JSON_PRETTY_PRINT));
error_log('----- inappPurchaseDiamonds -----');
$body = json_decode(file_get_contents('php://input'), true);
error_log('body:' . json_encode($body));
$channel = $body['channel'];
$records = $body['records'];
$sign = $body['sign'];
// { // {
// channel: 'google', // channel: 'google',
// sign: '123456677' // 签名字段 // sign: '123456677' // 签名字段
@ -45,6 +33,18 @@ class InAppPurchase {
// const hashSort = '' // const hashSort = ''
// const signStr = 'channel=google&' + records.map(record =>Object.keys(record).sort().map(key => `${key}=${record[key]}`).join('&')).join('&') // 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));
error_log('----- inappPurchaseDiamonds -----');
$body = json_decode(file_get_contents('php://input'), true);
error_log('body:' . json_encode($body));
$channel = $body['channel'];
$records = $body['records'];
$sign = $body['sign'];
// const sign = hmacsha256(signStr, hashSort) // const sign = hmacsha256(signStr, hashSort)
// 定义一个空数组,用来存放每个记录的键值对字符串 // 定义一个空数组,用来存放每个记录的键值对字符串