jdavidbakr/laravel-profitstars
Composer 安装命令:
composer require jdavidbakr/laravel-profitstars
包简介
A service that processes ACH transactions throgh Jack Henry's ProfitStars API
关键字:
README 文档
README
Jack Henry ProfitStars provides an API for handling ACH transactions. This package is a Laravel/Lumen wrapper to access these transactions.
The package is currently not exhaustive in terms of what is available from the API; I have only implemented parts of the API that are needed for my use. That said, expanding this package should be fairly trivial and if you should need additional pieces please feel free to modify and submit a pull request.
Install
Via Composer
$ composer require jdavidbakr/laravel-profitstars
After installing via Composer, add the service provider:
jdavidbakr\ProfitStars\ProfitStarsServiceProvider::class
###Laravel Configuration
Publish the config file:
php artisan vendor:publish
This will place a file in the config directory that will manage your connection credentials.
###Lumen Configuration
Add the following to your .env file:
PROFIT_STARS_STORE_ID=YOUR STORE ID
PROFIT_STARS_STORE_KEY=YOUR STORE KEY
PROFIT_STARS_ENTITY_ID=YOUR ENTITY ID
PROFIT_STARS_LOCATION_ID=YOUR LOCATION ID
Usage - Testing
$proc = new \jdavidbakr\ProfitStars\ProcessTransaction; // Test connection if($proc->TestConnection()) { // Success } // Test credentials if($proc->TestCredentials()) { // Success }
Usage - Processing Transactions
$proc = new \jdavidbakr\ProfitStars\ProcessTransaction; $trans = new \jdavidbakr\ProfitStars\WSTransaction; // AuthorizeTransaction $trans->RoutingNumber = 111000025; $trans->AccountNumber = 5637492437; $trans->TotalAmount = 9.95; $trans->TransactionNumber = 12334; $trans->NameOnAccount = 'Joe Smith'; $trans->EffectiveDate = '2015-11-04'; if($proc->AuthorizeTransaction($tras)) { // ReferenceNumber in $proc->ReferenceNumber } else { // Error message in $proc->ResponseMessage } // CaptureTransaction $proc->ReferenceNumber = 'reference number'; if($proc->CaptureTransaction(9.95)) { // Success } else { // Error message in $proc->ResponseMessage } // VoidTransaction $proc->ReferenceNumber = 'reference number'; if($proc->VoidTransaction()) { // Success; } else { // Error message in $proc->ResponseMessage } // RefundTransaction $proc->ReferenceNumber = 'reference number'; if($proc->RefundTransaction()) { // Success, refund info in $proc->ResponseMessage } else { // Error message in $proc->ResponseMessage }
Usage - Recurring Payments
$proc = new \jdavidbakr\ProfitStars\ProcessTransaction; $recur = new \jdavidbakr\ProfitStars\WSRecurr; $cust = new \jdavidbakr\ProfitStars\WSCustomer; $account = new \jdavidbakr\ProfitStars\WSAccount; // RegisterCustomer $cust->IsCompany = false; $cust->CustomerNumber = 12345; $cust->FirstName = 'Alex'; $cust->LastName = 'Ramirez'; $cust->Email = 'test@example.com'; $cust->Address1 = '1234 N Sunny Ln'; $cust->City = 'Tulsa'; $cust->StateRegion = 'OK'; $cust->PostalCode = '12345'; if($proc->RegisterCustomer($cust)) { // Success; } else { // Error message in $proc->ResponseMessage } // RegisterAccount $account->CustomerNumber = 12345; // Should match the RegisterCustomer value $account->NameOnAccount = 'Joe Smith'; $account->RoutingNumber = 111000025; $account->AccountNumber = 5637492437; $account->AccountReferenceID = 67890; // This must be unique and will be used to setup the recurring payment if($proc->RegisterAccount($account)) { // Success } else { // Error message in $proc->ResponseMessage } // SetupRecurringPayment $recur->CustomerNumber = 12345; // What you used in RegisterCustomer $recur->AccountReferenceID = 67890; // What you used in RegisterAccount $recur->Amount = 1.23; // The amount that will be charged each time $recur->InvoiceNumber = 09876; // Optional $recur->Frequency = 'Once_a_Month'; // Once_a_Month, Twice_a_Month, Once_a_Week, Every_2_Weeks, Once_a_Quarter, Twice_a_Year, Once_a_Year $recur->PaymentDay = 1; // See notes below $recur->NumPayments = 10; // Valid values are 1 - 100, or 999 for indefinite $recur->PaymentsToDate = 0; // Should be zero $recur->NextPaymentDate = '2015-11-04'; // Must not be before tomorrow $recur->RecurringReferenceID = 12345; // Must set a value here like you did in the customer and account calls if($proc->SetupRecurringPayment($recur)) { // Success } else { // Error message is $proc->ResponseMessage }
Recurring Notes
For recurring, a Customer Number and Account Reference ID is required.
The Frequency and the PaymentDay define the schedule of the recurring payment. Payment Day is defined as follows:
- Once_a_Month: 1 - 31, or 32 for the last day of the month
- Once_a_Quarter: Same as above
- Twice_a_year: Same as above
- Once_a_Year: Same as above
- Twice_a_Month: 1 = 1st and 15th, 2 = 15th and last
- Once_a_Week: 0 - Sun, 1 = Mon, ... 5 = Fri, 6 = Sat
- Every_2_Weeks: same as Once_a_Week
Usage - Transaction Reporting
$reporter = new \jdavidbakr\ProfitStars\TransactionReporting; // Retrieve a collection of \jdavidbakr\ProfitStars\CreditAndDebitReportsResponse $start_date = Carbon::now()->subDays(90); // Max 90 days from start to end $end_date = Carbon::now(); $batches = $reporter->CreditAndDebitReports($start_date, $end_date); // Retrieve a collection of \jdavidbakr\ProfitStars\WSSettlementBatch objects for a batch $batch = $batches->first(); $transactions = $reporter->CreditsAndDebitsTransactionDetailReport($batch->batchID);
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Security
If you discover any security related issues, please email me@jdavidbaker.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
jdavidbakr/laravel-profitstars 适用场景与选型建议
jdavidbakr/laravel-profitstars 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 892 次下载、GitHub Stars 达 6, 最近一次更新时间为 2015 年 11 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「ach」 「ProfitStars」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 jdavidbakr/laravel-profitstars 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jdavidbakr/laravel-profitstars 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 jdavidbakr/laravel-profitstars 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Sila PHP SDK for API Version 0.2
Stripe integration with Magento 2
A library to manage users, transfer methods and payments through the Hyperwallet API
Production-ready PHP SDK for Iberbanco API v2 - Enterprise banking platform with 80+ currencies, professional enums, type-safe DTOs, optimized performance, and comprehensive financial services
A PHP wrapper for ACH Banking's API
AlphaCommerceHub integration with Magento 2
统计信息
- 总下载量: 892
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 20
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-11-04