nug01/molare
Composer 安装命令:
composer require nug01/molare
包简介
This package helps in fastspring subscriptions
README 文档
README
NUG01 Molare is a Laravel package that simplifies the integration of FastSpring subscriptions into your Laravel application. It provides a convenient set of controllers and helper functions to manage subscriptions.
Installation
You can install the package via Composer by running the following command:
composer require nug01/molare:dev-master
Environment
Add the fastspring secret key in .env like this:
FASTSPRING_TOKEN={YOUR_FASTSPRING_SECRET_KEY}
Publishing
Next, publish the package's configuration file, If you want:
php artisan vendor:publish --provider="NUG01\Molare\MolareServiceProvider" --tag="config"molare:dev-master
Usage
Setup
Add the following credentials to your .env file:
FASTSPRING_USERNAME=your_fastspring_username FASTSPRING_PASSWORD=your_fastspring_password
Account: Get an account.
```sh
use App\Services\FastSpringService;
// ...
$service = new FastSpringService();
$response = $service->getAccount($account_id);
return response()->json(['data' => $response['data'], 'result' => $response['result']]);
Management URL: Get the management URL for an account.
use App\Services\FastSpringService;
// ...
$service = new FastSpringService();
$response = $service->getManagementUrl($account_id);
return response()->json(['data' => $response['data'], 'result' => $response['result']]);
Subscription: Get subscription details.
use App\Services\FastSpringService;
// ...
$service = new FastSpringService();
$response = $service->getSubscription($subscription_id);
return response()->json(['data' => $response['data'], 'result' => $response['result']]);
Update Account: Update account details.
use App\Services\FastSpringService;
use Illuminate\Http\Request;
// ...
$service = new FastSpringService();
$response = $service->updateAccount($account_id, $request);
return response()->json(['data' => $response['data'], 'result' => $response['result']]);
Pause Subscription: Pause a subscription.
use App\Services\FastSpringService;
// ...
$service = new FastSpringService();
$response = $service->pauseSubscription($subscription_id, 1); // Adjust period count as needed
return response()->json(['data' => $response['data'], 'result' => $response['result']]);
Resume Subscription: Resume a paused subscription.
use App\Services\FastSpringService;
// ...
$service = new FastSpringService();
$response = $service->resumeSubscription($subscription_id);
return response()->json(['data' => $response['data'], 'result' => $response['result']]);
Configuration
You can configure the package by modifying the config/fastspring.php file. This file allows you to set various options related to the FastSpring integration and subscription management. Support
Support
If you encounter any issues or need assistance, please open an issue on GitHub. License
License
This package is open-source software licensed under the MIT license.
nug01/molare 适用场景与选型建议
nug01/molare 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7 次下载、GitHub Stars 达 1, 最近一次更新时间为 2023 年 08 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 nug01/molare 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 nug01/molare 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-07