定制 hmimeee/revolut 二次开发

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

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

hmimeee/revolut

最新稳定版本:1.0

Composer 安装命令:

composer require hmimeee/revolut

包简介

A package to integrate Revolut payment gateway. Revolut is a British financial technology company that offers banking services, but as of December 2022 does not have a UK banking licence.

README 文档

README

A package to integrate Revolut payment gateway. Revolut is a British financial technology company that offers banking services, but as of December 2022 does not have a UK banking licence.

Read the documentation below to integrate the library for your PHP Application.

Requirements

PHP 5.6.0 and later.

Composer

You can install the bindings via Composer. Run the following command:

composer require hmimeee/revolut

To use the bindings, use Composer's autoload:

require_once('vendor/autoload.php');

Dependencies

The bindings require the following extensions in order to work properly:

  • curl, although you can use your own non-cURL client if you prefer
  • json
  • mbstring (Multibyte String)

If you use Composer, these dependencies should be handled automatically. If you install manually, you'll want to make sure that these extensions are available.

Getting Started

Simple usage looks like:

$revolut = getRevolut([
    'env' => 'sandbox', //or, live
    'key' => 'Your marchant secret key here'
]);
$response = $revolut->createOrder([
    'amount' => 1210, //The amount must be the smallest currency unit like (from $12.10 to 1210)
    'currency' => 'GBP',
    'description' => 'An example order', //Can skip it as it's optional.
    'name' => 'John Doe', //Can skip it as it's optional.
    'email' => 'email@example.com', //Can skip it as it's optional.
]);

if ($response['status']) {
    $orderId = $response['data']->id; //Keep the Order ID to verify the payment in the Webhook Endpoint.
    
    header("location:" . $response['data']->checkout_url);
} else {
    echo $response['message'];
}

Webhook Endpoint Preparing

A Post request will be sent from Revolut along with the data below:

{
  "event": "ORDER_COMPLETED",
  "order_id": "9fc01989-3f61-4484-a5d9-ffe768531be9",
  "merchant_order_ext_ref": "Test #3928"
}

Now match with the Order ID and take your further action like the code below:

if($_POST['event'] == 'ORDER_COMPLETED') {
  //Match that previous $orderId with $_POST['order_id'], and take proper action.
}

💥 Boom! You've done everything.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-02-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固