Fortumo Plugin
The Fortumo plugin enables developers to charge for premium features and sell virtual credits inside their Android applications.
Platforms:
this plugin only works with Android. Note on tablets and devices without sim cards you have to have service live to test.Functions:
fortumo.pay(displayName, productName, purchaseType, serviceId, appSecret, params, listener)-- make payment
displayName(string) what to tell user they are buying
productName(string) product name, used when restoring
purchaseType(string)(optional default is "nonconsumable") types are "consumable"(coins, food), "nonconsumable"(remove ads, coin doublers), or "subscription"(Netflix, Spotify)
serviceId(string) the service id of a service setup in Fortumo Dashboard
appSecret(string) the app secret of a service setup in Fortumo Dashboard
params(table)(optional) Params: isLightBackground (boolean, default is false, which will give a dark background), price(string)(optional) sets price amount, priceCurrency(string)(optional) sets price currency, setButtonBackgroundColor(array) rgb of button background {1,0,0}(red), setButtonTextColor (array) rgb of text color {0,1,0}(green), isRounded(boolean) is box rounded, creditsMultiplier(integer) the amount to multiply credits by,
listener(funtion) returns event.error(string), event.isError(boolean), event.billingStatus(string could be "pending", "not send", "failed", or "billed"), event.creditAmount(string amount to credit), event.creditAmount(string amount to credit), event.creditName(string), event.messageId(string), event.paymentCode(string), event.paymentAmmount(string), event.serviceId(string), and event.userId(string)
fortumo.paymentStatus(serviceId, appSecret, productName, listener)--used to get non consumable payment
serviceId(string) the service id of a service setup in Fortumo Dashboard
appSecret(string) the app secret of a service setup in Fortumo Dashboard
displayName(string) what to tell user they are buying
listener(funtion) returns event.billingStatus (string) "pending", "not send", "failed", or "billed"
Fortumo Setup:
Go to the Fortumo website, create an account, and setup an android in app purchase service.s