Featured image of post A Zero-Dependency, Multi-Language, Multi-Currency, Multi-Tenant Apple Refund Management Assistant

A Zero-Dependency, Multi-Language, Multi-Currency, Multi-Tenant Apple Refund Management Assistant

This service is built on Laravel / Filament multi-tenant architecture, effectively helping developers prevent fraudulent refunds by instantly processing Apple's CONSUMPTION_REQUEST notifications and asynchronously returning consumption data.

Open Source

Overview

This service is built on Laravel / Filament multi-tenant architecture, effectively helping developers prevent fraudulent refunds by instantly processing Apple’s CONSUMPTION_REQUEST notifications and asynchronously returning consumption data.

  • Multi-tenant Support
  • Multi-language Support (中文 / English / Español / हिन्दी / العربية / Português / Русский / 日本語 / Français)
  • Multi-currency Support
  • Zero Dependency File+SQLite or upgrade to Redis+MySQL
  • 100% Test Coverage
  • Self-hosted App Keys Private keys are only stored in your database apps table (symmetric encryption, key generated by your application)
  • 12 Consumption Fields - Calculate all required Apple fields
  • Notification Message Forwarding Apple servers send to current service, current service forwards to your production server

Online Demo

🌐 Demo URL: https://apple-refund-assistant.shiguopeng.cn/

⚠️ Note: The system resets every 30 minutes.

Screenshots

Quick Start

Using Pre-built Image

docker run -d \
  -p 8080:8080 \
  --name apple-refund-assistant \
  --restart=always \
  ghcr.io/seth-shi/apple-refund-assistant:latest

Local Build and Run

git clone https://github.com/seth-shi/apple-refund-assistant
cd apple-refund-assistant
## Build image and deploy
./deploy.sh

If you need to mount data

touch database.sqlite
docker run -d \
  -p 8080:8080 \
  -v $(pwd)/database.sqlite:/var/www/html/database/database.sqlite \
  --name apple-refund-assistant \
  --restart=always \
  ghcr.io/seth-shi/apple-refund-assistant:latest

Consumption Field Strategy

FieldDescriptionData Table SourceCalculation Rule
accountTenureUser registration daysusers.register_atCurrent time minus registration time
appAccountTokenAccount tokenusers.app_account_tokenNeeds to be passed by client when creating orders
consumptionStatusConsumption statustransactions.expiration_dateCompare with current time, if expired return consumed
customerConsentedUser consent to provide dataNoneHardcoded true
deliveryStatusWhether successfully delivered a functional in-app purchase.NoneHardcoded 0(normal delivery)
lifetimeDollarsPurchasedTotal in-app purchase amountusers.purchased_dollarsAccumulate this field based on Apple transaction events, you can also accumulate manually
lifetimeDollarsRefundedTotal refund amountusers.refunded_dollarsAccumulate this field based on Apple refund events, you can also accumulate manually
platformPlatformNoneHardcoded 1(apple)
playTimeValue of customer app usage timeusers.play_secondsYour system needs to support updating this field, otherwise it’s 0
refundPreferenceExpected result of refund requesttransactions.expiration_dateCompare with current time, if expired hope to reject refund
sampleContentProvidedWhether trial is providedapps.sample_content_providedConfigure app when creating application
userStatusUser statusNoneHardcoded 1(normal user)

Future Plans

  • Have other ideas or interested in collaboration? Please submit an issue on GitHub - we look forward to your feedback!

Acknowledgments