paysera/lib-wallet-transfer-rest-client 问题修复 & 功能扩展

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

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

paysera/lib-wallet-transfer-rest-client

最新稳定版本:0.3.0

Composer 安装命令:

composer require paysera/lib-wallet-transfer-rest-client

包简介

PHP REST client for Paysera.com Wallet Transfers

README 文档

README

Provides methods to manipulate Transfers API. It automatically authenticates all requests and maps required data structure for you.

Usage

This library provides ClientFactory class, which you should use to get the API client itself:

use Paysera\Client\TransfersClient\ClientFactory;

$clientFactory = new ClientFactory([
    'base_url' => 'https://wallet.paysera.com/transfer/rest/v1/', // optional, in case you need a custom one.
    'basic' => [                                        // use this, it API requires Basic authentication.
        'username' => 'username',
        'password' => 'password',
    ],
    'oauth' => [                                        // use this, it API requires OAuth v2 authentication.
        'token' => [
            'access_token' => 'my-access-token',
            'refresh_token' => 'my-refresh-token',
        ],
    ],
    // other configuration options, if needed
]);

$transfersClient = $clientFactory->getTransfersClient();

Please use only one authentication mechanism, provided by Paysera.

Now, that you have instance of TransfersClient, you can use following methods

Methods

It reserves funds for transfer and makes it "reserved". It's enough for transfer to be processed. If there are not enough funds, any limits are reached etc., transfer will be still "new" and no action will take place. Returns error if no funds available.

use Paysera\Client\TransfersClient\Entity as Entities;

$transferRegistrationParameters = new Entities\TransferRegistrationParameters();

$transferRegistrationParameters->setConvertCurrency($convertCurrency);
$transferRegistrationParameters->setUserIp($userIp);
    
$result = $transfersClient->reserveTransfer($id, $transferRegistrationParameters);

Provide password for transfer with status waiting_password. If operation is successful, transfer status becomes done. Available only for internal transfers. Returns error if password provided is invalid.

use Paysera\Client\TransfersClient\Entity as Entities;

$transferPassword = new Entities\TransferPassword();

$transferPassword->setValue($value);
    
$result = $transfersClient->provideTransferPassword($id, $transferPassword);

Make transfer visible in frontend for signing. If currency convert operations are related to transfer, they are done when transfer becomes reserved. If there are expectations in currency convert requests, transfer becomes failed together with related conversion request(s) if those expectations fails. This only makes transfer "reserved", so it's visible in our Web UI for signing

use Paysera\Client\TransfersClient\Entity as Entities;

$transferRegistrationParameters = new Entities\TransferRegistrationParameters();

$transferRegistrationParameters->setConvertCurrency($convertCurrency);
$transferRegistrationParameters->setUserIp($userIp);
    
$result = $transfersClient->registerTransfer($id, $transferRegistrationParameters);

Signs the transfer

use Paysera\Client\TransfersClient\Entity as Entities;

$transferRegistrationParameters = new Entities\TransferRegistrationParameters();

$transferRegistrationParameters->setConvertCurrency($convertCurrency);
$transferRegistrationParameters->setUserIp($userIp);
    
$result = $transfersClient->signTransfer($id, $transferRegistrationParameters);

Get transfer.

$result = $transfersClient->getTransfer($id);

Revoke transfer.

$result = $transfersClient->deleteTransfer($id);

Create transfer in the system. Created transfer is invisible and will be deleted if no more actions are performed.

use Paysera\Client\TransfersClient\Entity as Entities;

$transferInput = new Entities\TransferInput();

$transferInput->setAmount($amount);
$transferInput->setBeneficiary($beneficiary);
$transferInput->setPayer($payer);
$transferInput->setFinalBeneficiary($finalBeneficiary);
$transferInput->setPerformAt($performAt);
$transferInput->setChargeType($chargeType);
$transferInput->setUrgency($urgency);
$transferInput->setNotifications($notifications);
$transferInput->setPurpose($purpose);
$transferInput->setPassword($password);
$transferInput->setCancelable($cancelable);
$transferInput->setAutoCurrencyConvert($autoCurrencyConvert);
$transferInput->setAutoChargeRelatedCard($autoChargeRelatedCard);
$transferInput->setAutoProcessToDone($autoProcessToDone);
$transferInput->setReserveUntil($reserveUntil);
$transferInput->setCallback($callback);
    
$result = $transfersClient->createTransfer($transferInput);

Standard SQL-style Result filtering

use Paysera\Client\TransfersClient\Entity as Entities;

$transfersFilter = new Entities\TransfersFilter();

$transfersFilter->setCreatedDateFrom($createdDateFrom);
$transfersFilter->setCreatedDateTo($createdDateTo);
$transfersFilter->setCreditAccountNumber($creditAccountNumber);
$transfersFilter->setDebitAccountNumber($debitAccountNumber);
$transfersFilter->setStatuses($statuses);
    
$result = $transfersClient->getTransfers($transfersFilter);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 未知

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固