Custom Payment Window with Balance, Card Validation, Penalties
#1
A custom payment scene taking inspiration from several posts on this forum (ex. LoserCard from Xx_Noice_xX and Total Spend from TerriblePerson123), made with AI as I'm not familiar with Godot, so there are likely some bugs or edge cases I did not find.

The idea is that you have some starting balance, but you will need to watch some degrading videos (or w/e your preference is, you could make it ADS for example) to earn money for you balance to buy the subscription levels. The system tracks your total amount spend and your current balance.

Feel free to do w/e with this code as I did not write it, I only directed AI to write it, so I take no ownership.

Features:
  • Tracks Total Spend
  • Window Timeout (configurable amounts of time), the payment window will timeout and close itself if you ignore it
  • Custom Wallet Balance (configurable start amount)
  • Earn Money for you Balance by Watching Custom Videos
  • Payment Window has a Randomly Generated Credit Card that you must enter so that you can't just enter random data (configurable chance to change each time it loads)
  • Penalties if you enter the wrong credit card info, if you try to pay when you don't have enough balance, or ignore the window and it times out (no penalty if you ignore at max level)
  • Penalties apply a multiplier to how much it payments cost
  • You can lower you Penalties by making a successful payment
  • Reset button to reset penalties, balance, and total spent for the Payment Window (separate from the reset for the game/collection)

Setup
  1. Set Money Scaling to 1.0 (so the amount of money you get will be 100, which now becomes your credits which is now different from the money in the payment scene). You can set the Looking Cost to whatever you want to get the time you want at each level and the Currency Symbol will still be used on the payment scene. 
  2. I would also update your Level Names to mention Credits instead of your currency, as you are now using your currency to buy credits instead of intermingling the two. Below is what I have set for Level names for 5 levels.
    FREE USER\nAccess denied !;SUBSCRIBER Level {level}\nCredits remaining : {money};SUBSCRIBER Level {level}\nCredits remaining : {money};SUBSCRIBER Level {level}\nCredits remaining : {money};SUBSCRIBER Level {level}\nCredits remaining : {money};SUBSCRIBER Level {level}\nCredits remaining : {money};You can adjust cost_multiplier variable as mentioned below, to adjust the prices in the payment scene, I have it set to 0.1 so with the default 1.0 Money Scaling Tier 1 costs $10, then Tier 2 $20, .... You can increase or decrease this to your liking along with the other variables like starting balance. With the way the Levels collection works you always only get the 100 worth of money at the current Level, so to make it extra spicy you can set the advanced setting "Progress when losing a level" to 0 so that if you drop down a level it drops you all the way back to level 1 (but that is up to you, if you don't then you will have 100 credits at the previous level when dropping a level)
  3. Extract the custom_payment_system.zip into your CUSTOM_DATA folder. Inside the EarnVideos folder place videos that will be played to earn money for your account balance. 

The resulting folder should look like:
CUSTOM_DATA
└─custom_payment_system
     └─EarnVideos
         └─PLACE OGV VIDEOS HERE
     └─custom_payment_system.paymenu.tscn

For configuration edit the below variables in the scene, I have tired added comments to explain what they control:
# custom variables
var countdown_seconds: float = 30.0  # Set to 0 or less to disable the auto-close timer
var countdown_pay_additional_second: float = 30.0 # additional seconds to add when clicking on pay for refill or subscription
var countdown_processing_payment_failed: float = 30.0 # time to set timer to when failing to process payment
# cardholder name
var card_holder_name: String = \"Cuck Loser\"
var card_change: float = 10.0 # percent chance that the card generated will change (0.0 - 100.00 in %)
var initial_balance: float = 100.0 # starting card balance
var for_x_credits: float = 100.0 # how many credits you get, please match this to how much money the default system gives you when purchasing a level for example at money scaling 1.0 this is 100.0
var cost_multiplier: float = 0.1 # custom amount to muliply the cost_to_refill and cost_for_better_subscription by when opening the payment window
var cost_penalty_multipler: float = 1.26 # amount to multiply the cost by for each penalty
var max_number_penalty: int = 10 # max number of penalties
var earn_video_folder: String = \"CUSTOM_DATA/custom_payment_system/EarnVideos\"
var earn_video_height: int = 300 #max height of the video
var earn_video_time: float = 15.0 # time needed to watch video
var earn_video_percent_change: float = 25.0 # chance to switch to another random video when clicking get paid (0.0 - 100.00 in %)
var earn_money_amount: float = 10.0 # amount of money earned for watching the video


Attached Files Thumbnail(s)
           

.zip   custom_payment_system.zip (Size: 9.39 KB / Downloads: 43)
  Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)