Urgent.News

What's breaking now, across thousands of outlets.

Tech

Prices round up, discounts round down, and one package decides both

Munchable Premium is £10 a month. The price list has 24 currencies in it, and the rule the whole thing is built around is that the number you read is the number your card is charged. Not approximately, not after conversion at the last screen. The same number. That rule is easy to state and easy to break, because "show a price" and "charge a price" are normally two code paths in two parts of an…

The pricing system for Munchable Premium charges customers a fixed price in their local currency, without any approximation or conversion. The pricing is determined by a package containing currency information, product prices, and rounding rules. The package is separate from the Stripe client module, to prevent mixing Stripe SDK code with the component responsible for rendering the price.

Each currency has a single premium price, with local amounts derived from a fixed value in pence. Prices are rounded up using a two-step process: first, a conversion fee buffer is applied, and second, a retail round-up is performed based on the currency's formatting. Discounts, on the other hand, are rounded down using the plain mid-market rate.

The system also includes a guard to ensure that a zero discount does not result in an unexpected rounding up to a non-zero amount.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Deferred Deep Links in React Native: Complete Integration Guide

If you've shipped a React Native app, you've probably wired up universal links / app links already. Existing users tap a link, the OS hands it to your app, Linking.addEventListener fires, you push the…

  • Deferred deep linking preserves link context when app is not installed
  • Integration guide uses LinkTrail SDK for React Native apps
  • Handle both installed and first-time installs the same in router

I built a wellness app that is designed to be closed

Most wellness apps earn more the more often you open them. That one fact explains a lot of their design: the streak you are afraid to break, the 9 pm notification, the red badge, the "you missed…

  • AsanaPals is an offline Android app designed for brief, focused use.
  • The app uses a one-time purchase model with no subscriptions, ads, or in-app purchases.
  • All features, including five animal companions, are included at no additional cost.

Como proteger sua aplicação frontend contra ataques CSRF

Sabe o que é e como se proteger de ataques CSRF (Cross-Site Request Forgery) ? CSRF é um tipo de ataque no qual um usuário autenticado é induzido a executar uma ação que não pretendia realizar em uma…

  • CSRF tokens prevent unauthorized actions by authenticating users
  • Server generates unique, unpredictable CSRF tokens for user sessions
  • Frontend sends CSRF token in requests, backend validates before processing

Kram: A Tiny macOS Tool for Taming Chaotic Folders

I Built Kram: A File Organizer That Knows What Not to Touch My Downloads folder had become a crime scene. Hundreds of files. Random screenshots. ZIP archives. PDFs. DMGs. Old projects.

  • Kram is a macOS file organization tool
  • Categorizes files by type into sensible folders
  • CLI-first tool with future features in development

More from Saturday 26 September →