定制 kpasokhi/savano 二次开发

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

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

kpasokhi/savano

Composer 安装命令:

composer require kpasokhi/savano

包简介

Savano Payment Gateway For Laravel

README 文档

README

Savano Payment Gateway For Laravel

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require kpasokhi/savano

or add

"kpasokhi/savano": "1.*"

to the require section of your composer.json file.

How to use this extension

For example, imagine that you have a controller called this PaymentController at first you need 2 actions, one of them is for request payment and another is verify payment.

You need to use an storage to save your payments and payments status.

PaymentController.php

..... 

<?php
public function actionRequest()
{
    /* Your Data */
    $pin      = 'Your Pin';
    $callback = 'Your Callback Url';

    /* Save Price, OrderId and Authority In Your Storage */
    $price    = 1000;
    $orderId  = 1;

    $savano = new Savano;
    $savano->pin = $pin;

    if($request = $savano->request($price, $orderId, $callback)->getResult() === 1)
    {
        // $authority = $savano->getAuthority();
        // You can save your payment request data to the database in here before redirect user to bank

        return $this->redirect($savano->getRedirectUrl());
    }
    else
    {
        // Show Error.
        echo $savano->getErrorMessage();
    }
}

public function actionVerify()
{
    $pin = 'Your Pin';

    /* Fetch Price, OrderId and Authority From Your Storage */
    $authority = 'xxxxxxxxxxxxxxx';
    $price     = 1000;
    $orderId   = 1;

    $savano = new Savano;
    $savano->pin = $pin;

    if($verify = $savano->verify($authority, $price, $orderId)->getResult() === 1)
    {
        // Payment Successfully
    }
    else
    {
        // Show Error
        echo $savano->getErrorMessage();
    }
}

.....

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-02-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固