citg/laravel-converge-payment
Composer 安装命令:
composer require citg/laravel-converge-payment
包简介
Laravel Library for Converge Payment Gateway
README 文档
README
This Library is for Converge Payment Gateway It's a Laravel Wrapper around XML endpoint of Converge Payment Gateway
Compatibility
This package will work with PHP >= 8.2 with CURL enabled.
Installation
To install this library follow the following steps:
composer require citg/laravel-converge-payment
Publish Config File
- Execute the following command from the command-line to publish the configuration file config/converge-payment.php. this command will generate a file as above
php artisan vendor:publish --provider="CITG\ConvergePayment\ConvergePaymentServiceProvider"
<?php return [ 'merchant_id' => env('CONVERGE_ID', ''), 'user_id' => env('CONVERGE_USER_ID', ''), 'pin' => env('CONVERGE_PIN', ''), 'endpoint' => env('CONVERGE_ENDPOINT', 'https://api.demo.convergepay.com/VirtualMerchantDemo/process.do'), ];
**Please Note: When you are deploying this application to live. You have to change the endpoint **
return [ 'merchant_id' => env('CONVERGE_ID', ''), 'user_id' => env('CONVERGE_USER_ID', ''), 'pin' => env('CONVERGE_PIN', ''), 'endpoint' => env('CONVERGE_ENDPOINT', 'https://api.convergepay.com/VirtualMerchant/process.do'), ];
All Transaction Types
TransactionTypes::CC_AUTH_ONLY TransactionTypes::CC_AVS_ONLY TransactionTypes::CC_SALE TransactionTypes::CC_VERIFY TransactionTypes::CC_GET_TOKEN TransactionTypes::CC_CREDIT TransactionTypes::CC_FORCE TransactionTypes::CC_BAL_INQUIRY TransactionTypes::CC_RETURN TransactionTypes::CC_VOID TransactionTypes::CC_COMPLETE TransactionTypes::CC_DELETE TransactionTypes::CC_UPDATE_TIP TransactionTypes::CC_SIGNATURE TransactionTypes::CC_ADD_RECURRING TransactionTypes::CC_ADD_INSTALL TransactionTypes::CC_UPDATE_TOKEN TransactionTypes::CC_DELETE_TOKEN TransactionTypes::CC_QUERY_TOKEN
Create a Customer
use CITG\ConvergePayment\Misc\Customer;
$customer = Customer::make( firstName: 'XXX', lastName: 'XXX', phone: 'XXXXX', email: 'XXXX@xxx.com', address: 'XXX XXX XX', city: 'XXX', state: 'XX', zip: 'XXX', customerCode: 'XXX', customerNumber: 'XX' );
Create a Credit Crad
use CITG\ConvergePayment\Misc\CreditCard;
$creditCard = CreditCard::make( creditCardNumber: 'XXXXXXXXXXXXXXXXXXXXXX', expirationDate: 'XXX', cvv: 'XX' );
Process a Payment
use CITG\ConvergePayment\Enums\TransactionTypes;
use CITG\ConvergePayment\ConvergePaymentManager;
$paymentManager = ConvergePaymentManager::setTransactionType(TransactionTypes::CC_SALE) ->setCreditCard($creditCard) ->setCustomer($customer) ->setAmount(30.00) ->processPayment([ 'description' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ]);
Available Methods
Here is a function description table for the main public methods in ConvergePaymentService:
| Method | Description | Parameters | Returns |
|---|---|---|---|
setMerchantID($merchantID) |
Set the merchant ID for the transaction. | string $merchantID |
static |
setUserID($userID) |
Set the user ID for the transaction. | string $userID |
static |
setPin($pin) |
Set the PIN for the transaction. | string $pin |
static |
setEndpoint($endpoint) |
Set the API endpoint URL. | string $endpoint |
static |
setTransactionType(TransactionTypes $transactionType) |
Set the transaction type (see TransactionTypes enum). | TransactionTypes $transactionType |
static |
setCreditCard(CreditCard $creditCard) |
Set the credit card details for the transaction. | CreditCard $creditCard |
static |
setCustomer(Customer $customer) |
Set the customer details for the transaction. | Customer $customer |
static |
setAmount(float $amount) |
Set the transaction amount. | float $amount |
static |
setFallbackErrorMessage(string $fallbackErroMessage): static |
Set fallback error message. | string $fallbackErroMessage |
static |
processPayment(array $additionalParameters = []) |
Process the payment with the provided details. with an parameter of type array to send additional parameters | array $additionalParameters |
static |
paymentResponse() |
Get the parsed response from the payment gateway. | None | array |
isSuccessful() |
Check if the request was successful. | None | bool |
errorMessage() |
Get the error message from the response, if any. | None | string |
$paymentManager->setMerchantID($merchantID); $paymentManager->setUserID($userID); $paymentManager->setPin($pin); $paymentManager->setEndpoint($endpoint); $paymentManager->setTransactionType(TransactionTypes::CC_SALE); $paymentManager->setCreditCard($creditCard); $paymentManager->setCustomer($customer); $paymentManager->setAmount(30.00); $paymentManager->processPayment([ 'description' => 'Payment for order #123' ]); $response = $paymentManager->paymentResponse(); $success = $paymentManager->isSuccessful(); $error = $paymentManager->errorMessage();
Query a Payment
use CITG\ConvergePayment\Enums\TransactionTypes;
use CITG\ConvergePayment\ConvergeQueryManager;
$queryManager = ConvergeQueryManager::setTransactionType(TransactionTypes::TX_TRANSACTION_QUERY) ->query([ 'ssl_search_start_date' => 'MM/DD/YYYY', 'ssl_search_end_date' => 'MM/DD/YYYY', 'ssl_search_card_type' => 'creditcard', 'ssl_invoice_number' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ]);
Available Methods
Here is a function description table for the main public methods in ConvergePaymentService:
| Method | Description | Parameters | Returns |
|---|---|---|---|
setMerchantID($merchantID) |
Set the merchant ID for the transaction. | string $merchantID |
static |
setUserID($userID) |
Set the user ID for the transaction. | string $userID |
static |
setPin($pin) |
Set the PIN for the transaction. | string $pin |
static |
setEndpoint($endpoint) |
Set the API endpoint URL. | string $endpoint |
static |
setTransactionType(TransactionTypes $transactionType) |
Set the transaction type (see TransactionTypes enum). | TransactionTypes $transactionType |
static |
query(array $queryParameters) |
Search transactions | array $queryParameters |
array |
hasApprovedTransaction() |
Check if there was any approved transaction | None | mixed |
queryResponse() |
Get the query response. | None | string |
$queryManager->setMerchantID($merchantID); $queryManager->setUserID($userID); $queryManager->setPin($pin); $queryManager->setEndpoint($endpoint); $paymentManager->setTransactionType(TransactionTypes::TX_TRANSACTION_QUERY); $paymentManager->query([ 'ssl_invoice_number' => 'XXX' ]); $response = $queryManager->queryResponse(); $transaction = $queryManager->hasApprovedTransaction();
Imprtant LINKS:
citg/laravel-converge-payment 适用场景与选型建议
citg/laravel-converge-payment 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 48 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 05 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「payment」 「gateway」 「laravel」 「converge」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 citg/laravel-converge-payment 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 citg/laravel-converge-payment 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 citg/laravel-converge-payment 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
repository php library
Payyo Gateway for the Omnipay payment processing library
Client library to send SMS using Comilio SMS Gateway API (https://www.comilio.it)
Alfabank REST API integration
GovPayNet driver for the Omnipay payment processing library
BlueSnap driver for the Omnipay payment processing library
统计信息
- 总下载量: 48
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-05-09