ernestre/sms-payment-bundle

SMS支付包,包含Paysera支付网关集成。

安装: 13

依赖项: 0

建议者: 0

安全性: 0

星级: 0

关注者: 3

分支: 0

开放问题: 0

类型:symfony-bundle

v1.0 2017-01-14 12:14 UTC

This package is not auto-updated.

Last update: 2024-09-28 20:20:07 UTC


README

Build Status

此包使用webtopay/libwebtopay库通过Paysera支付网关接受短信支付。

安装

composer require ernestre/sms-payment-bundle

配置

  • 将包添加到app/AppKernel
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Ernestre\PaymentBundle\ErnestrePaymentBundle(),
            // ...
        );
    }
    // ...
}
  • 添加路由
ernestre_payment:
    resource: "@ErnestrePaymentBundle/Controller/"
    type:     annotation
  • 添加配置
ernestre_payment:
  project:
    id:             123 # Your project id
    sign_password:  123 # Your project's sign password
  • 在Paysera项目设置中将短信回调路由配置为/sms-callback

使用方法

每次收到付款后,都会创建并保存到数据库的SmsPayment实体。

然后发送包含SmsPayment实体(包含所有付款信息)的SmsPaymentReceivedEvent事件。

然后操作发送NOSMS响应。(有关响应消息的详细信息,请参阅此处。)

您的任务是创建一个监听器,该监听器监听smsPayment.received事件,并处理付款信息。

然而,使用NOSMS响应消息需要您向Paysera服务发送付款确认消息。您可以使用ernestre_payment.sms_payment.answer_sender服务生成此响应消息。服务的发送方法需要SmsPayment实体和响应文本(将发送给客户端)。响应文本可以用来向客户端发送某种代码(例如折扣券)。