ecurring api php
v0.5.0
هذه مكتبة غير رسمية توفر روابط PHP لأجهزة واجهة برمجة تطبيقات Ecurring.
المنزل البيئي | وثيقة API Ecurring
هذه المكتبة مستوحاة من عميل Mollie API لـ PHP.
من أجل استخدام هذه المكتبة ، تحتاج إلى:
composer require mooore/ecurring-api-phpتهيئة العميل Ecurring
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 ());