承接 dohone/payment 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

dohone/payment

Composer 安装命令:

composer require dohone/payment

包简介

Pay-out API To charge a customer, this means to send this form to DOHONE duly filled in by your system.

README 文档

README

If you wish to make your customers pay by Orange Money, MTN Mobile Money, Express Union Mobile or DOHONE transfert, on your mobile application and your website with or without a DOHONE graphic interface, the principle is simple.

Features

  1. Make Quotation
  2. Make Payment with Web interface
  3. Make Payment without Web interface
  4. Make SMS verification
  5. Make payment verification
  6. Make payout to mobile phone
  7. Make payout to back account

Usage

Step 1:

Installation (with Composer)

composer require dohone/payment

Step 2:

Configuration

$ php artisan vendor:publish --provider="Dohone\DohonePayServiceProvider"

Step 3:

Update your config/dohone.php config with your merchand hashcode

return [
   'merchantToken' => 'XXXXXXXX',
    'currency' => 'XAF',
    'projectName' => env('APP_NAME', "Dohone"),
    'projectLogo' => 'http://localhost/assets/images/logo.png',
    'endPage' => env('APP_URL', "http://localhost"),
    'payInNotifyPage' => env('APP_URL', "http://localhost"),
    'cancelPage' => env('APP_URL', "http://localhost"),
    'language' => 'fr',
    'method' => '1, 2, 3, 10, 17',
    'numberNotifs' => 5,
    'payInUrl' => env("DOHONE_SANDBOX",false) ? 'https://www.my-dohone.com/dohone-sandbox/pay' : 'https://www.my-dohone.com/dohone/pay',

    'payOutHashCode' => 'XXXXXXXX',
    'payOutPhoneAccount' => 'XXXXXXXX',
    'payOutNotifyPage' => env('APP_URL', "http://localhost"),
    'payOutUrl' => env("DOHONE_SANDBOX",false) ? 'https://www.my-dohone.com/dohone-sandbox/transfert' : 'https://www.my-dohone.com/dohone/transfert',
   ];

Step 4: (optional)

Enable debugger mode by using sandbox account (Please make sure to delete the line or set it to false in production)

DOHONE_SANDBOX=true

PAYIN API AND WEB

1. Make Quotation

$response = DohonePayIn::quotation()
        ->setAmount(123)
        ->setFeedsLevel(4)
        ->setMethod(DohonePayIn::quotation()::MTN)
        ->get();
     if ($response->isSuccess()) {
    //success code goes here
        echo $response->getMessage();
    } else {
    //error code goes here
        echo $response->getMessage();
    }

2. Make Payment using Web interface

 $builder = DohonePayIn::payWithUI()
        ->setAmount(123)
        ->setClientPhone("695499969")
        ->setClientEmail("yann@email.com")
        ->setCommandID("aazertyuiop");
    try {
         return   $builder->getView();
    }catch (Exception $exception){
        //Return error view
        return $builder->getErrors();
    }

3. Make Payment with API REST (You need authorization to use this method)

$response = DohonePayIn::payWithAPI()
        ->setAmount(123)
        ->setClientPhone("the phone of the user")
        ->setClientEmail("the email of the user")
        ->setCommandID("your order unique id")
        ->setOTPCode(123456)
        ->setMethod(DohonePayIn::quotation()::ORANGE)
        ->get();
     if ($response->isSuccess()) {
    //success code goes here
        echo $response->getMessage();
    } else {
    //error code goes here
        echo $response->getMessage();
    }

4. Make SMS verification

$response = DohonePayIn::sms()
        ->setCode("the code receive by SMS")
        ->setPhone("the phone which has receive the SMS")
        ->get();
    if ($response->isSuccess()) {
    //success code goes here
        echo $response->getMessage();
    } else {
    //error code goes here
        echo $response->getMessage();
    }

5. Make payment verification

$response = DohonePayIn::verify()
        ->setAmount(6546545)
        ->setCommandID("your command unique id")
        ->setPaymentToken("the ttoken receive after the successful payment")
        ->get();
    if ($response->isSuccess()) {
    //success code goes here
        echo $response->getMessage();
    } else {
    //error code goes here
        echo $response->getMessage();
    }

PAYOUT API

1. Make payout to mobile phone

$response = DohonePayOut::mobile()
        ->setAmount("amount to send")
        ->setMethod(6)
        ->setReceiverAccount('receiver phone number with country country code ex:237XXXXXX')
        ->setReceiverCity("city")
        ->setReceiverCountry("country name")
        ->setReceiverName("receiver name")
        ->post();
    if ($response->isSuccess()) {
    //success code goes here
        echo $response->getMessage();
    } else {
    //error code goes here
        echo $response->getMessage();
    }

Response object method return by each

Method Description
isSuccess() Is true when there is no error
getMessage() Content a description of the response
shouldVerifySMS() Return true if a SMS has been send to user for confirmation. Use this method to allow user to enter the code
getPaymentUrl() This method return the link generate by DohonePayOut::payWithUI()
getErrors() Get all errors catch during execution such as data validation

dohone/payment 适用场景与选型建议

dohone/payment 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 157 次下载、GitHub Stars 达 1, 最近一次更新时间为 2021 年 04 月 15 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 dohone/payment 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 dohone/payment 我们能提供哪些服务?
定制开发 / 二次开发

基于 dohone/payment 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-04-15