alsharie/floosak-payment 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

alsharie/floosak-payment

最新稳定版本:2.2.1

Composer 安装命令:

composer require alsharie/floosak-payment

包简介

Floosak payment gateway

README 文档

README

img.png

laravel package for floosak payment getway

Floosak payment api after update to (p2mcl)

install the package composer require alsharie/floosak-payment

You can publish using the following command

php artisan vendor:publish --provider="Alsharie\FloosakPayment\FloosakServiceProvider"

When published, the config/floosak.php config file contains:

return [
    'auth' => [
        'phone' => env('FLOOSAK_MERCHANT_PHONE'),
        'short_code' => env('FLOOSAK_MERCHANT_SHORT_CODE'),
        'wallet_id' => env('FLOOSAK_MERCHANT_WALLET_ID'),
        'key' => env('FLOOSAK_MERCHANT_KEY'),
    ],
    'url' => [
        'base' => env('FLOOSAK_BASE_URL', 'https://staging.fintech-expert.net'),
    ]
];

If you don't have the request_id and key you must do the following:

1. get request Id

 $floosak = new Floosak();
 $response = $floosak->requestKey();

 if ($response->isSuccess()) {
    $request_id = $response->getRequestId();
    ....
    ....
 } 
        

2. verify request Id

after getting the response YOU MUST store key,request_id in config/floosak.php or in your .env

$floosak = new Floosak();
$response = $floosak
    ->setOtp(/*otp*/)
    ->setRequestId(/*requestId*/) 
    ->verifyKey();

if ($response->isSuccess()) {
    $key= $response->getKey();
    $wallet_id= $response->getWalletId();
    //todo:: store $key and $wallet_id
    
} else {

    return $response->body();
}  

To purchase using Floosak payment

1. Purchase

 $floosak = new Floosak();
 $response = $floosak
     ->setRequestId(/*ref_id*/) // random number you generate most 
     ->setAmount(/*amount*/)
     ->setCustomerPhone(/*phone*/)
     ->setPurpose(/*purpose*/)
     ->purchase();

 if ($response->isSuccess()) {
    $purchase_id = $response->getPurchaseId();
    ....
    ....
 } 
        

2. Confirm purchase

 $floosak = new Floosak();
 $response = $floosak
      ->setPurchaseId(/*purchase_id*/) // you get it from the response of the above request `purchase()`
      ->setOtp(/*user_otp*/)
      ->confirmPurchase();
 if ($response->isSuccess()) {
    $tran_id = $response->getTransactionId();
    ....
    ....
 } 
        

Refund

 $floosak = new Floosak();
 $response = $floosak
     ->setRequestId(/*ref_id*/) // the random number you generated  
     ->setTransactionId(/*tran_id*/)
     ->setAmount(/*amount*/) // amount to refund
     ->refund();

 if ($response->isSuccess()) {
     return $response->getBalance();
 }

you can get the full response body using $response->body() for all requests

统计信息

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

GitHub 信息

  • Stars: 16
  • Watchers: 1
  • Forks: 9
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-10-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固