One time Payment

Hello Comunuty, i am making an app in which user buys an package to use app
When app open user click on start so he should redirect to payment screen once he done payment he can start using app
Next time when hi opens app and click on start he should be directly redirected to start screen means he can use app dont have to do payment again. I have tried so many times but didnt get any success

What I Have Done
One main screen i have 3 vertical arrangement
1 main, 2. Payment and third one is arragnment after payment

When apps open user get on main arragement
Once he click on tap to start the tinydb checks for value(purchased) if value not found then
Main arrangement is false
Payment aragement is true

And if user has paid then next time he opens app
So when he click on tap to start he should not see the payment screen for this case i use tinydb get value

But I didnt get success :pensive:
Can anyone tell me how to do it

If tinydb purchase value found 
Then (main arrng visible to true and payment visible to false)
Else  (main arr visible to false and payment visible to true)

Or use in-app billing extension

Can you tell me the blockbi cant understand it

What koder! It seems already you designed the blocks it seems. Just reverse the logics in else block that’s all

I have used the method you have given but its didnt work when i click on start i directly shows after payment screen not payment screen on first time

Then your tinydb conditions blocks is not filled properly it seems. Can you show us your blocks

I used this

when button 1 click
If call tiny tb get value tag=purchased = not blank ( ) then set payment screen visibilty to false and after payment screen visibilty to true
Else set payment screen visibilty to true and after payment screen visibility to false

After payment succesful

Call tiny db store value tag= purchased value = purchased
Set payment screen visibilty to false and set after payment screen visibility to true

Yeah this is correct only…

Check tinydb tag. Whether you have given any extra space in either tag

So why iam not getting success

Untill you share the blocks we cannot sure where the problem is

heres what i used

What is the meaning of procedure called loading


If purchase is not done mean then tiny web dB may not execute because no such tag will present. Instead when user open the app first time, save device ID (as tag) value as false

Once payment done save the value as true. So in such case no need to tinydb…

So tinydb web get value is empty won’t trigger as there is no such tag

Else make sure it is triggering good

i dont understand what you say can you explanin once again

Don’t use tinydb purchase tag value. Straight away use tinywebdb

App open first time
Save tinywebdb tag (device ID) value to false 

On start button click. Call this webdb tag value. 

If the value is  false
Then  proceed to payment page
Else proceed to after payment page

Once payment done, save tinydbweb tag value as true

means i have to replace tinydb with tinywebdb

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.