定制 maq89/paytabs-symfony 二次开发

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

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

maq89/paytabs-symfony

Composer 安装命令:

composer require maq89/paytabs-symfony

包简介

A Paytabs Payment bundle

关键字:

README 文档

README

Installation

Begin by installing this package through Composer. Just run following command to terminal-

composer require maq89/paytabs-symfony

Enable the bundle in the kernel, goto app/AppKernel.php

$bundles = array(
	// ...
	new Damas\PaytabsBundle\DamasPaytabsBundle(),
	// ...
);

Use Namespace

use Damas\PaytabsBundle\Util\Paytabs;

Example:

Create Payment Page:

$pt = Paytabs::getInstance("MERCHANT_EMAIL", "SECRET_KEY");
$result = $pt->create_pay_page(array(
	"merchant_email" => "MERCHANT_EMAIL",
	'secret_key' => "SECRET_KEY",
	'title' => "John Doe",
	'cc_first_name' => "John",
	'cc_last_name' => "Doe",
	'email' => "customer@email.com",
	'cc_phone_number' => "973",
	'phone_number' => "33333333",
	'billing_address' => "Juffair, Manama, Bahrain",
	'city' => "Manama",
	'state' => "Capital",
	'postal_code' => "97300",
	'country' => "BHR",
	'address_shipping' => "Juffair, Manama, Bahrain",
	'city_shipping' => "Manama",
	'state_shipping' => "Capital",
	'postal_code_shipping' => "97300",
	'country_shipping' => "BHR",
	"products_per_title"=> "Mobile Phone",
	'currency' => "BHD",
	"unit_price"=> "10",
	'quantity' => "1",
	'other_charges' => "0",
	'amount' => "10.00",
	'discount'=>"0",
	"msg_lang" => "english",
	"reference_no" => "1231231",
	"site_url" => "https://your-site.com",
	'return_url' => "http://127.0.0.1:8000/paytabs-response",
	"cms_with_version" => "API USING PHP"
));


if($result->response_code == 4012){
	return $this->redirect($result->payment_url);
}
else{
	throw new \Exception($result->result);	
}

Verify Payment:

$pt = Paytabs::getInstance("MERCHANT_EMAIL", "SECRET_KEY");
$result = $pt->verify_payment($request->request->get('payment_reference'));
if($result->response_code == 100){
	// Payment Success
}
else{
	throw new \Exception($result->result);	
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: LGPL-3.0
  • 更新时间: 2018-07-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固