定制 dotlines-io/foster 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dotlines-io/foster

Composer 安装命令:

composer require dotlines-io/foster

包简介

This package can be used for Payment Integration with Foster Payments Platform.

README 文档

README

Latest Version on Packagist Tests Psalm GitHub Code Style Action Status Total Downloads Total Downloads

This composer package can be used for payment integration with Foster Payments Platform.

For the credentials, please contact with info@fosterpayments.com.bd or call 8801730372941

Installation

You can install the package via composer:

composer require dotlines-io/foster

Usage

/**
 * ******************************************************
 * ******************* Charge Request *******************
 * ******************************************************
 */

$charge_request_url = "<SERVER_URL>/fosterpayments/paymentrequest.php"; // Contact Foster Payments for it
$mcnt_AccessCode = '';          // Contact Foster Payments for it
$mcnt_ShortName = "";           // Contact Foster Payments for it
$mcnt_ShopId = '';              // Contact Foster Payments for it
$secretkey = "";                // Contact Foster Payments for it

$mcnt_TxnNo = '';               // Mandatory | Unique | Max: 32 Char 
$mcnt_Amount = 100;             // Mandatory | The total amount payable | Decimal
$mcnt_Currency = 'BDT';         // Mandatory | 3 Letter currency code  
$cust_InvoiceTo = '';           // Mandatory | Customer ID
$cust_CustomerServiceName = ''; // Mandatory | Service or Items sold
$cust_CustomerName = '';        // Mandatory | Customer ID
$cust_CustomerEmail = '';       // Mandatory | Customer Email
$cust_CustomerAddress = '';     // Mandatory | Customer Address
$cust_CustomerContact = '';     // Mandatory | Customer Contact no
$cust_CustomerCity = '';        // Mandatory | Customer City
$cust_CustomerState = '';       // Optional | Customer State
$cust_CustomerPostcode = '';    // Optional
$cust_CustomerCountry = '';     // Mandatory | Customer Country
$cust_Billingaddress = '';      // Mandatory | Customer Billing Address
$cust_ShippingAddress = '';     // Mandatory | Customer Shipping Address
$cust_orderitems = '';          // Mandatory | Customer ordered itme name, no, etc.
$success_url = '';              // Mandatory | Customer redirection URL after successful payment 
$cancel_url = '';               // Mandatory | Customer redirection URL after payment is canceled
$fail_url = '';                 // Mandatory | Customer redirection URL after payment failure
$merchentdomainname = '';       // Mandatory | Domain Name
$merchentip = '';               // Mandatory | Domain IP
$merchentip = '';               // Mandatory | Domain IP
$gateway = '';                  // Optional  | Gateway name
$card_type = '';                // Optional  | Card Type


$chargeRequest = \Dotlines\Foster\ChargeRequest::getInstance($charge_request_url, $mcnt_AccessCode, $mcnt_ShortName, $mcnt_ShopId, $secretkey,
    $mcnt_TxnNo, $mcnt_Amount, $mcnt_Currency, $cust_InvoiceTo, $cust_CustomerServiceName, $cust_CustomerName, $cust_CustomerEmail, $cust_CustomerAddress,
    $cust_CustomerContact, $cust_CustomerCity, $cust_CustomerState, $cust_CustomerPostcode, $cust_CustomerCountry, $cust_Billingaddress, $cust_ShippingAddress,
    $cust_orderitems, $success_url, $cancel_url, $fail_url, $merchentdomainname, $merchentip, $gateway, $card_type);
echo json_encode($chargeRequest->send()) . '<br/>';

/**
 * Success Charge Request Response looks like below.
 * You must store "payment_id" and redirect the user to the "redirect_url" for payment.
 * {
 *  "status": "200",
 *  "message": "Your Request Successfully received",
 *  "data": {
 *      "payment_id": "Testdc400a5.49862879-93218-nYaHX",
 *      "redirect_url": "https://demo.fosterpayments.com.bd/short/redirect.php",
 *      "merchant_ShopId": "6"
 *  }
 * }
 * Fail response only contains status > 200
 */


/**
 * ******************************************************
 * ******************* Status Request *******************
 * ******************************************************
 */

$status_url = "<SERVER_URL>/fosterpayments/TransactionStatus/txstatus.php";
$mcnt_TxnNo = '';   // Transaction No provided during payment request initiation
$secretkey = '';    // Secret key provided by admin 

$statusRequest = \Dotlines\Foster\StatusRequest::getInstance($status_url, $mcnt_TxnNo, $secretkey);
echo json_encode($statusRequest->send()) . '<br/>';

/**
 * Status Request Response looks like below:
 *[
 * {
 *      "MerchantTxnNo":"XXXXXXXXXXXXX",
 *      "TxnResponse":2,
 *      "TxnAmount":"1020.00",
 *      "Currency":"BDT",
 *      "ConvertionRate":"1",
 *      "OrderNo":"1803600769",
 *      "fosterid":"BUP8d8b615.97386539",
 *      "hashkey":"b3bceae17f843a910a4e295feed349a4",
 *      "message":"Transaction Successfully."
 *  }
 * ]
 * Fail response only contains status > 200
 */

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 112
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-05-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固