ecurring api php
v0.5.0
이것은 Ecurring API에 PHP 바인딩을 제공하는 비공식 라이브러리입니다.
ecurring home | Ecurring API 문서
이 라이브러리는 PHP의 Mollie API 클라이언트에서 영감을 받았습니다.
이 라이브러리를 사용하려면 다음이 필요합니다.
composer require mooore/ecurring-api-phpEcurring 클라이언트 초기화
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 ());