ecurring api php
v0.5.0
これは、エキュアリングAPIにPHPバインディングを提供する非公式ライブラリです。
家の退行| APIドキュメントを帯びています
このライブラリは、PHPのMollie APIクライアントに触発されています。
このライブラリを使用するには、次のことが必要です。
composer require mooore/ecurring-api-phpエキューリングクライアントの初期化
use Mooore eCurring eCurringHttpClient ;
$ client = new eCurringHttpClient ();
$ client -> setApiKey ( ' your_api_key ' );顧客の作成
$ customer = $ client -> customers -> create ([
' first_name ' => ' John ' ,
' last_name ' => ' Doe ' ,
' email ' => ' [email protected] '
]);顧客からサブスクリプションを作成します
$ customer = $ client -> customers -> get ( 200 );
$ subscription = $ customer -> createSubscription ( 1 );サブスクリプションプランからサブスクリプションを作成します
$ subscriptionPlan = $ client -> subscriptionPlans -> get ( 1 );
$ subscription = $ subscriptionPlan -> createSubscription ( 200 );すべてのサブスクリプションを取得します
$ customers = $ client -> customers -> page ();
do {
foreach ( $ customers as $ customer ) {
if ( $ subscription -> isActive ()) {
// do something
}
}
} while ( $ customers = $ customers -> next ());