Optimize the sample code of HelloIAP.

This commit is contained in:
zhangbin 2013-04-08 17:32:58 +08:00
parent 8e4567a784
commit 5201723b0f
2 changed files with 9 additions and 22 deletions

5
plugin/.gitignore vendored
View File

@ -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*

View File

@ -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);
}