Download the PHP package lemoba/mobile-monetization without Composer

On this page you can find all versions of the php package lemoba/mobile-monetization. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mobile-monetization

Mobile Monetization for Laravel

Laravel 扩展包,用于移动端短剧/内容应用常见的后端验证能力:

本包只做「可信验证、签名校验、接口封装、结果归一化、推送发送」,不创建数据表,不写数据库,不给用户加金币,不开通 VIP,不解锁视频。订单幂等、金币流水、会员权益、短剧解锁、推送 token 保存等业务逻辑全部由调用方完成。

安装

本地 path 仓库示例:

发布配置:

环境变量

配置文件会按职责发布到主项目:

路由

本包不注册任何默认路由,由调用方在主项目中自行定义路由和控制器。示例:

缓存

JWKS、公钥集合、Google Play OAuth token、App Store Server API bearer token、FCM OAuth token 都会走 Laravel Cache,并默认使用 Redis:

调用方可以改 store 使用任意 Laravel cache store,但生产环境建议 Redis。

登录验证

Apple:

Google:

返回字段包含:

调用方应该用 provider + provider_user_id 去绑定或创建自己的用户。

provider_user_id 来自 Apple / Google ID token 的 sub 字段。本包会强制校验 sub,如果 token 中没有 sub 会直接抛出异常,不会返回空的 provider_user_id

支付验证

iOS App Store:

Android Google Play 一次性消耗商品:

Android Google Play VIP 周/月/年订阅:

统一返回对象:

关键字段:

建议调用方业务处理:

LevelPlay 激励广告

在 LevelPlay 后台配置 S2S Rewarded Video Callback URL:

本包不提供默认 HTTP 控制器,也不注册默认路由。调用方需要在主项目中自行创建回调入口,调用本包完成验签,并保存 event_id 做唯一幂等。

业务控制器示例:

本地测试如果不方便生成 LevelPlay 签名,可以传入第二个参数 true 开启 dev 模式,跳过 LEVELPLAY_SECRETsignature 校验:

verifyRewardCallback() 返回:

Firebase Cloud Messaging 推送

由于 Android 和 iOS 不在同一个 Firebase 后台,本包在 config/mobile-push.php 中分别配置两套 service account:

发送到单个设备 token:

发送到 Android:

发送到 topic:

data 会统一转成字符串值,符合 FCM HTTP v1 对 data payload 的要求。FCM OAuth token 会按平台和 service account 缓存在 Redis 中。

数据库说明

本包没有迁移文件,也不会调用 DB、Model 或 Schema。推荐调用方自行维护这些业务表或存储:


All versions of mobile-monetization with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
firebase/php-jwt Version ^7.0
illuminate/contracts Version ^9.0|^10.0|^11.0|^12.0
illuminate/http Version ^9.0|^10.0|^11.0|^12.0
illuminate/routing Version ^9.0|^10.0|^11.0|^12.0
illuminate/support Version ^9.0|^10.0|^11.0|^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lemoba/mobile-monetization contains the following files

Loading the files please wait ...