I am having hard time integrating fortumo with my app. It said “Sorry could not load payment details. Check wifi or data connection.” I am connected thru usb internet and i also tried data conn, im sure im online but still cannot process it. Now i tried to show an alert displaying the response.billing status and it was zero(0) which is cancelled. I tried searching about this and come up with an idea that i dont have http request server. I didnt set this up bec it says it’s optional and i dont know to create one anyways. Here is my code, tnx
function onPaymentComplete( response )
local productName = response.productName
local serviceId = response.serviceId
local alert = native.showAlert(“Fortumo Payment”, response.billingStatus, {‘OK’})
if ( response.billingStatus == fortumo.BILLING_STATUS_BILLED ) then
local alert = native.showAlert( “Mobile Top-up Successful”, “Congratulations! 20 gold has been added. Thank you for your patronage.”, {“Thank you.”})
cPlus = 20
c = c + cPlus
elseif ( response.billingStatus == fortumo.BILLING_STATUS_PENDING ) then
local alert = native.showAlert( “Mobile Top-up Pending”, “Please wait. 20 gold will be added shortly. Thank you for your patronage.”, {“Thank you.”})
else
local function onComplete()
native.requestExit()
end
local alert = native.showAlert( “Mobile Top-up Failed”, “Sorry. Transaction cannot be processed. Please check your mobile balance or call your network provider. Thank you.”, {“Ok”}, onComplete)
end
end
local request = fortumo.newPaymentRequest()
request:setService( “xxxxxx”, “xxxxx” )
request:setProductName( “gold” )
request:setType( fortumo.PRODUCT_TYPE_NON_CONSUMABLE )
fortumo.makePayment(request, onPaymentComplete)