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
|
||||
publish/*
|
||||
tools/toolsForPublish/environment.sh
|
||||
.settings
|
||||
.settings
|
||||
plugins/china*
|
||||
plugins/punchbox*
|
||||
samplesPrivate*
|
||||
|
|
|
@ -112,27 +112,11 @@ void HelloWorld::eventMenuCallback(CCObject* pSender)
|
|||
{
|
||||
CCMenuItemLabel* pMenuItem = (CCMenuItemLabel*)pSender;
|
||||
TProductInfo pInfo;
|
||||
MyPurchase::MyPayMode mode = MyPurchase::eNoneMode;
|
||||
|
||||
switch (pMenuItem->getTag())
|
||||
{
|
||||
case TAG_PAY_BY_ALIPAY:
|
||||
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::MyPayMode mode = (MyPurchase::MyPayMode) (pMenuItem->getTag() - TAG_PAY_BY_ALIPAY + 1);
|
||||
pInfo["productName"] = "100金币";
|
||||
pInfo["productPrice"] = "0.01";
|
||||
pInfo["productDesc"] = "100个金灿灿的游戏币哦";
|
||||
pInfo["Nd91ProductId"] = "685994";
|
||||
MyPurchase::sharedPurchase()->payByMode(pInfo, mode);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue