承接 karlsen-technologies/gocardless-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

karlsen-technologies/gocardless-php

最新稳定版本:1.0.0

Composer 安装命令:

composer require karlsen-technologies/gocardless-php

包简介

Unofficial PHP package for using the GoCardless API

README 文档

README

This is an unofficial PHP library for the GoCardless Bank Account Data API.

It provides the same endpoints and uses the same arguments as the official api, see a full list of endpoints here.

Requirements

  • PHP: 8.2 or above

Installation

You can install the library using composer:

composer require karlsen-technologies/gocardless-php

Usage

In order to use this library you first need to setup an application and get your credentials from the GoCardless Dashboard.

Creating a client

use KarlsenTechnologies\GoCardless\DataObjects\Api\Credentials;
use KarlsenTechnologies\GoCardless\Client;

$credentials = new Credentials('secret_id', 'secret_key');
$client = new Client($credentials);

Using a client

See the official API documentation for a more detailed explanation of the endpoints and their arguments.

use KarlsenTechnologies\GoCardless\Client;

$client = new Client(...);

$client->getInstitutions();
$client->getInstitutions('COUNTRY');
$client->getInstitution('INSTITUTION_ID');

$client->getAgreements(); // Default limit of 100, offset of 0
$client->getAgreements(100, 10);  // Limit of 100, offset of 10
$client->getAgreement('AGREEMENT_ID');
$client->createAgreement('INSTIUTION_ID', 90, 90, ['SCOPES']);
$client->deleteAgreement('AGREEMENT_ID');
$client->acceptAgreement('AGREEMENT_ID', 'GoCardless-PHP', '127.0.0.1');

$client->getRequisitions(); // Default limit of 100, offset of 0
$client->getRequisitions(100, 10);  // Limit of 100, offset of 10
$client->getRequisition('REQUISITION_ID');
$client->createRequisition('http://localhost', 'INSTIUTION_ID', 'AGREEMENT_ID', 'REFRENCE', 'LANGUAGE', 'SSN', true, true);
$client->deleteRequisition('REQUISITION_ID');

$client->getAccount('ACCOUNT_ID');
$client->getAccountBalances('ACCOUNT_ID'); 
$client->getAccountDetails('ACCOUNT_ID');
$client->getAccountTransactions('ACCOUNT_ID', 'FROM_DATE', 'TO_DATE');

Getting and setting the access and refresh tokens

If you want to get and set the authentication tokens you may do so like this. This is useful if you want to cache the tokens and reuse them so you don't have to authenticate every time you want to use the api.

NOTE: At the moment the library automatically authenticates when you try to use the API. There is currently no way to force the library to authenticate without using the API.

use KarlsenTechnologies\GoCardless\DataObjects\Api\Tokens;

$client = new Client(...);

$tokens = $client->getTokens();

$newTokens = new Tokens('access_token', 3600, 'refresh_token', 86400);

$client->setTokens($newTokens);

Testing

Run the tests using:

composer test

License

This library is licensed under the MIT License.

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固