mirror of https://github.com/axmolengine/axmol.git
Optimize the sample code of HelloIAP.
This commit is contained in:
parent
8e4567a784
commit
5201723b0f
|
@ -91,4 +91,7 @@ tools/jenkins_scripts/mac/android/userconf.ini
|
||||||
# Ignore files built by plugin
|
# Ignore files built by plugin
|
||||||
publish/*
|
publish/*
|
||||||
tools/toolsForPublish/environment.sh
|
tools/toolsForPublish/environment.sh
|
||||||
.settings
|
.settings
|
||||||
|
plugins/china*
|
||||||
|
plugins/punchbox*
|
||||||
|
samplesPrivate*
|
||||||
|
|
|
@ -112,27 +112,11 @@ void HelloWorld::eventMenuCallback(CCObject* pSender)
|
||||||
{
|
{
|
||||||
CCMenuItemLabel* pMenuItem = (CCMenuItemLabel*)pSender;
|
CCMenuItemLabel* pMenuItem = (CCMenuItemLabel*)pSender;
|
||||||
TProductInfo pInfo;
|
TProductInfo pInfo;
|
||||||
MyPurchase::MyPayMode mode = MyPurchase::eNoneMode;
|
MyPurchase::MyPayMode mode = (MyPurchase::MyPayMode) (pMenuItem->getTag() - TAG_PAY_BY_ALIPAY + 1);
|
||||||
|
pInfo["productName"] = "100金币";
|
||||||
switch (pMenuItem->getTag())
|
pInfo["productPrice"] = "0.01";
|
||||||
{
|
pInfo["productDesc"] = "100个金灿灿的游戏币哦";
|
||||||
case TAG_PAY_BY_ALIPAY:
|
pInfo["Nd91ProductId"] = "685994";
|
||||||
pInfo["productName"] = "100金币";
|
|
||||||
pInfo["productPrice"] = "0.1";
|
|
||||||
pInfo["productDesc"] = "100个金灿灿的游戏币哦";
|
|
||||||
mode = MyPurchase::eAlipay;
|
|
||||||
break;
|
|
||||||
case TAG_PAY_BY_ND91:
|
|
||||||
pInfo["productName"] = "100金币";
|
|
||||||
pInfo["productPrice"] = "0.01";
|
|
||||||
pInfo["productDesc"] = "100个金灿灿的游戏币哦";
|
|
||||||
pInfo["Nd91ProductId"] = "685994";
|
|
||||||
mode = MyPurchase::eND91;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
MyPurchase::sharedPurchase()->payByMode(pInfo, mode);
|
MyPurchase::sharedPurchase()->payByMode(pInfo, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue