arckinteractive/stripe
Composer 安装命令:
composer require arckinteractive/stripe
包简介
This plugin provides an Elgg API layer for interfacing with Stripe
README 文档
README
Stripe.com API Layer for Elgg
The plugin is intended primarily for developers, who are implementing a payments flow.
Intro
This plugin implements an API Layer for interfacing with Elgg. It implements most common methods, including creating and updating customers, creating charges, adding and removing cards etc.
The goal is to provide a uniform API that works with Elgg's entity architecture, this includes maintaining references between, for example, Elgg users and Stripe customers.
The plugin also provides a UI for users to manage their payment methods, view their transaction history, etc.
Architecture is such as to avoid storing data in Elgg, where possible, so your site stays PCI compliant, while entertaining broad e-commerce possibilities.
The plugin provides API for creating/updating/deleting/viewing:
- Customers
- Cards
- Charges
- Plans
- Subscriptions
- Invoices
Additional features, such as Stripe Connect or transfers, can/might be implemented in separate plugins.
Security Considerations
It is the responsibility of the site owner to enable SSL encryption, as well as taking additional precautions to protect users from unauthorized access to their personal data (even though it is not stored in the Elgg database, some information will made available to viewers in real-time) as well as from unauthorized payments for goods on the site (in case the credit card is stored with the customer entity).
It is perhaps a good idea to ensure that user sessions time out regularly, or that stripe-related pages are password protected.
Webhooks
To ensure that Elgg receives some crucial updates, please set up your Stripe webhooks as follows:
Testing https://YOUR-SITE/services/api/rest/json?method=stripe.webhooks&environment=sandbox
Live https://YOUR-SITE/services/api/rest/json?method=stripe.webhooks&environment=production
Once you have set up the webhooks, you can add handlers for $stripe_event_type, 'stripe.events'
plugin hook in Elgg to implement additional logic. Your callback function will
receive a Stripe event object and an environment descriptor.
A list of Stripe events can be found here: https://stripe.com/docs/api#event_types
Customers
Customers are created automagically, whenever you pass an email, user guid or user entity to the API.
Whenever a user is registered with an email has a Stripe customer account, Stripe customer will be mapped to that user and the transaction history will be available to the user.
Example: adding a card
$token = get_input('token'); // this would have been generated by stripe.js $user = elgg_get_logged_in_user_entity(); $client = new StripeClient(); $client->createCard($user, $token);
Example: creating a charge
$user_guid = elgg_get_logged_in_user_guid(); $charge = array( 'amount' => 12545, // amount in cents 'currency' => 'USD', 'card' => $card_id, // optional if the customer has a card on file 'metadata' => array( 'cart_guid' => $cart_guid, 'shop_guid' => $shop_guid, ), ); $client = new StripeClient(); $client->createCharge($user_guid, $charge);
arckinteractive/stripe 适用场景与选型建议
arckinteractive/stripe 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 126 次下载、GitHub Stars 达 5, 最近一次更新时间为 2017 年 02 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「plugin」 「payments」 「stripe」 「elgg」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 arckinteractive/stripe 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 arckinteractive/stripe 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 arckinteractive/stripe 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
CakePHP 4.x AdminLTE Theme.
Flexible payment integration for Laravel, lunarphp, supporting multiple payment providers.
Dealing with payments through the Egyptian payment gateway PayMob
Librería para la gestión sencilla de pagos mediante TPV Redsys y Paypal
Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more
统计信息
- 总下载量: 126
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2017-02-15