pkoznar/comgate-bundle 问题修复 & 功能扩展

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

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

pkoznar/comgate-bundle

Composer 安装命令:

composer require pkoznar/comgate-bundle

包简介

README 文档

README

A symfony bundle for Comgate payments

Installation

Step 1: Download MufinComgateBundle using composer

Require the mufin/comgate-bundle with composer Composer.

$ composer require mufin/comgate-bundle

Step 2: Enable the bundle

Enable the bundle in the kernel:

<?php

// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        // ...
        new Mufin\ComgateBundle\MufinComgateBundle(),
        // ...
    );
}

Step 3: Configure the MufinComgateBundle

Below is a minimal example of the configuration necessary to use the MufinComgateBundle in your application:

# .env

###> mufin/comgate-bundle ###
MERCHANT_ID="your merchant id"
SECRET_KEY="secret key from comgate dashboard"
TEST_MODE=false
###< mufin/comgate-bundle ###

Step 4: Usage of MufinComgateBundle

# CartController

/**
     * @Route("/cart/payment", name="cart_payment")
     * @param ComgateConnector $comgate
     * @param Request
     * @return Response
     */
    public function payment(ComgateConnector $comgate): Response
    {
        
        $payment = new CreatePayment('PRICE', 'Your order ID', $this->getUser()->getEmail(), 'Some product');
        // to create payment on background according to API requirements
        $payment->setPrepareOnly(true);
        $response = $comgate->send($payment);
        if($response->getMessage()=="OK"){
            // do something with cart
            return $this->redirect($response->getRedirectUrl());
        }

        return $this->render('cart/payment.html.twig', []);
    }

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-08-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固