定制 doskyft/helloasso-php 二次开发

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

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

doskyft/helloasso-php

最新稳定版本:v1.2.0

Composer 安装命令:

composer require doskyft/helloasso-php

包简介

Helloasso PHP Library

README 文档

README

Un sdk pour utiliser l'api d'helloasso

Installation

composer require doskyft/helloasso-php

Utilisation

Pour commencer, il faut créer une instance de HelloassoClient.

use Helloasso\HelloassoClientFactory;

$helloassoClient = HelloassoClientFactory::create(
    'hello_asso_id',
    'hello_asso_secret',
    'hello_asso_organization_slug',
    true # sandbox
);

Maintenant, on peut commencer à utiliser le client

CheckoutIntent

Créer un CheckoutIntent
use Helloasso\Models\Carts\CheckoutPayer;
use Helloasso\Models\Carts\InitCheckoutBody;

$checkoutIntent = (new InitCheckoutBody())
    ->setTotalAmount(1000)
    ->setInitialAmount(1000)
    ->setItemName('Un produit')
    ->setBackUrl('https://localhost/back')
    ->setErrorUrl('https://localhost/error')
    ->setReturnUrl('https://localhost/return')
    ->setPayer((new CheckoutPayer())
        ->setFirstName()
        ->setLastName()
        ->setEmail()
    )
    ->setMetadata([
        '' => '',
    ])
;

$helloassoClient->checkout->create($checkoutIntent);

Voir la documentation

Order

Annuler une commande (Order)
$helloassoClient->order->cancel($orderId);

Voir la documentation

Évènements

use Helloasso\Models\Event;

$event = $helloassoClient->decodeEvent($rawEventReceivedFromHelloasso); // Returns an instance of Event

Contribuer

Ce projet inclut des tests fonctionnels qui nécessitent un accès à la sandbox d'Helloasso.

Pour lancer les tests :

HELLOASSO_CLIENT_ID=[YourClientId] HELLOASSO_CLIENT_SECRET=[YourClientSecret] HELLOASSO_ORGANISATION=[YourOrganisation] vendor/bin/phpunit

Contributeurs

Damien Hebert
Damien Hebert
Olivier Dolbeau
Olivier Dolbeau

统计信息

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

GitHub 信息

  • Stars: 8
  • Watchers: 2
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-11-06