qiwi php client
v0.1.1
특히 ? Zorra Telecom 및 Evenyone else
참석 : 현재 방법의 수가 매우 제한되어 있으면 Qiwi Doce가 정상적인 대안을 만들지 않으면 나중에 추가 될 것입니다 ...주의 : 현재 방법의 수는 매우 제한적이므로 나중에 Qiwi가 정상적인 대안을 만들지 않으면 나중에 추가 될 것입니다 ...
요청은 결제 계정을 만듭니다.
PUT /payin/v1/sites/{siteId}/bills/{billId}
요청은 지불 세부 정보를 받기위한 것입니다. 성공적인 답변에서 계정에 대한 데이터 목록과 요청 된 Billid에 대한 지불이 제공됩니다.
GET /payin/v1/sites/{siteId}/bills/{billId}/details
계정에서 지불 목록을 얻습니다
GET /payin/v1/sites/{siteId}/bills/{billId}
사용할 수 있습니다 : 계정 상태
요청은 지불 거래를 만듭니다.
PUT /payin/v1/sites/{siteId}/payments/{paymentId}
편리 할 때까지
지불 거래에 대한 정보를 얻으십시오.
GET /payin/v1/sites/{siteId}/payments/{paymentId}
편리 할 때까지
사용할 수 있습니다 : 계정 상태
추가 인증을 성공적으로 수행 한 후 TSP는 해당 유형의 추가 인증과 함께 매개 변수와 함께 요청을 보내어 감사를 완료해야합니다.
POST /payin/v1/sites/{siteId}/payments/{paymentId}/complete
편리 할 때까지
자금을 보유한 후 지불을 확인합니다. 두 가지 스텝 시나리오를 사용하는 경우 상인은 지불 승인 후이 요청을 보내야합니다.
PUT /payin/v1/sites/{siteId}/payments/{paymentId}/captures/{captureId}
편리 할 때까지
지정된 지불 확인 상태를 설명합니다.
GET /payin/v1/sites/{siteId}/payments/{paymentId}/captures/{captureId}
편리 할 때까지
요청은 최종 지불로 자금을 반환하기위한 것입니다. TSP는 부분 금액을 반환하기위한 몇 가지 요청을 수행 할 수 있습니다.
PUT /payin/v1/sites/{siteId}/payments/{paymentId}/refunds/{refundId}
편리 할 때까지
composer require terentev-space/qiwi-php-client // Factories
$ configFactory = new QiwiClient Factories ConfigFactory ();
$ clientFactory = new QiwiClient Factories ClientFactory ();
// Make Config
$ config = $ configFactory -> make (
' siteId ' ,
' token ' ,
' publicKey ' // optional
);
/* OR */
$ config = new QiwiClient Entities ClientConfig (
' siteId ' ,
' publicKey ' ,
' token '
);
// Make Client
$ client = $ clientFactory -> make (
' siteId ' ,
' token ' ,
' publicKey ' // optional
);
/* OR */
$ client = Qiwi:: client (
' siteId ' ,
' token '
);
/* OR */
$ client = new QiwiClient Client (
$ config ,
new GuzzleHttp Client (),
new Psr Log NullLogger ()
); $ billId = ' ... ' ;
$ amount = 1.01 ;
/* OR */
$ amount = 1.019 ; // = 1.01
$ currency = Qiwi:: CURRENCY_RUB ;
/* OR */
$ currency = ' RUB ' ;
$ expiration = null ; // +1 day
/* OR */
$ expiration = ' 2022-01-01T00:00:00+00:00 ' ;
/* OR */
$ expiration = new DateTime ();
/* OR */
$ expiration = $ datetime -> format ( QiwiClient Qiwi:: DATETIME_FORMAT );
$ flags = [
QiwiClient Qiwi:: FLAG_SALE , // optional
QiwiClient Qiwi:: FLAG_BIND_PAYMENT_TOKEN , // optional
];
$ account = ' string(64) - id ' ;
$ email = ' string(64) or null - email ' ;
$ phone = ' string(15) or null - phone ' ;
$ country = ' string(1000) or null ' ;
$ city = ' string(1000) or null ' ;
$ region = ' string(1000) or null ' ;
$ details = ' string(1000) or null ' ;
$ pan = ' string(19) or null ' ;
$ wallet = ' string(64) or null ' ;
$ inn = ' string(12) or null ' ;
$ phone = ' string(15) or null ' ;
$ bankAccount = ' string(20) or null ' ;
$ bic = ' string(9) or null ' ;
$ cf1 = ' string(256) or null ' ;
$ cf2 = ' string(256) or null ' ;
$ cf3 = ' string(256) or null ' ;
$ cf4 = ' string(256) or null ' ;
$ cf5 = ' string(256) or null ' ;
$ merchantThemeCode = ' string(256) or null ' ;
$ merchantContractId = ' string(256) or null ' ;
$ merchantBookingNumber = ' string(256) or null ' ;
$ merchantPhone = ' string(256) or null ' ;
$ merchantFullName = ' string(256) or null ' ;
$ invoiceCallbackUrl = ' string(256) or null ' ;
/** @var array $cheque Данные чека для операции. */
$ cheque = [ /* ... */ ];
$ request = PaySiteBillQuery:: make ( $ billId , $ amount , $ currency )
-> setExpirationDateTime ( $ expiration ) // optional
-> setFlags (... $ flags ) // optional
-> setCustomer (
$ account ,
$ email , // optional
$ phone // optional
) // optional
-> setAddress (
$ country , // optional
$ city , // optional
$ region , // optional
$ details // optional
) // optional
-> setReceiverData (
$ pan , // optional
$ wallet , // optional
$ inn , // optional
$ phone , // optional
$ bankAccount , // optional
$ bic // optional
) // optional
-> setCustomFields (
$ cf1 , // optional
$ cf2 , // optional
$ cf3 , // optional
$ cf4 , // optional
$ cf5 , // optional
$ merchantThemeCode , // optional
$ merchantContractId , // optional
$ merchantBookingNumber , // optional
$ merchantPhone , // optional
$ merchantFullName , // optional
$ invoiceCallbackUrl // optional
) // optional
-> setCheque ( $ cheque )
;
/* OR */
$ request = [
' billId ' => $ billId ,
' amount ' => [
' value ' => $ amount ,
' currency ' => $ currency ,
],
' expirationDateTime ' => $ expiration ,
' flags ' => $ flags ,
' customer ' => [
' account ' => $ account ,
' email ' => $ email ,
' phone ' => $ phone ,
],
' address ' => [
' country ' => $ country ,
' city ' => $ city ,
' region ' => $ region ,
' details ' => $ details ,
],
' receiverData ' => [
' pan ' => $ pan ,
' wallet ' => $ wallet ,
' inn ' => $ inn ,
' phone ' => $ phone ,
' bankAccount ' => $ bankAccount ,
' bic ' => $ bic ,
],
' customFields ' => [
' cf1 ' => $ cf1 ,
' cf2 ' => $ cf2 ,
' cf3 ' => $ cf3 ,
' cf4 ' => $ cf4 ,
' cf5 ' => $ cf5 ,
' merchantThemeCode ' => $ merchantThemeCode ,
' merchantContractId ' => $ merchantContractId ,
' merchantBookingNumber ' => $ merchantBookingNumber ,
' merchantPhone ' => $ merchantPhone ,
' merchantFullName ' => $ merchantFullName ,
' invoiceCallbackUrl ' => $ invoiceCallbackUrl ,
],
' cheque ' => $ cheque ,
];
$ response = $ client -> paySiteBill ( $ request );
$ response -> getCode (); // Response code 200
$ response -> getBody (); // Response data array
/** @var QiwiClientEntitiesResultsPaySiteBillResult $data */
$ data = $ response -> parseData ();
// ...
$ billId = $ data -> getBillId ();
// 1.01
$ amount = $ data -> getAmountValue ();
// RUB
$ currency = $ data -> getAmountCurrency ();
// 2000-00-00T00:00:00+00:00
$ exp = $ data -> getExpirationDateTime ();
// 00000000-0000-0000-0000-000000000000
$ invoice = $ data -> getInvoiceUid ();
// CREATED
$ status = $ data -> getStatusValue ();
// 2000-00-00T00:00:00+00:00
$ statusChanged = $ data -> getStatusChangedDateTime ();
// https://oplata.qiwi.com/form?invoiceUid=00000000-0000-0000-0000-000000000000
$ url = $ data -> getPayUrl ();
$ response = $ client -> getSiteBillDetails ( ' 1663126085 ' );
$ response -> getCode (); // Response code 200
$ response -> getBody (); // Response data array
/** @var QiwiClientEntitiesResultsGetSiteBillDetailsResult $data */
$ data = $ response -> parseData ();
// ...
$ billId = $ data -> getBillId ();
// 1.01
$ amount = $ data -> getAmountValue ();
// RUB
$ currency = $ data -> getAmountCurrency ();
// CREATED
$ status = $ data -> getStatusValue ();
// 2000-00-00T00:00:00+00:00
$ statusChanged = $ data -> getStatusChangedDateTime ();
/* ... */
// https://oplata.qiwi.com/form?invoiceUid=00000000-0000-0000-0000-000000000000
$ url = $ data -> getPayUrl ();
/** @var QiwiClientEntitiesItemsSiteBillPayment $payment */
$ payment = $ data -> getPayments ()[ 0 ];
// siteId
$ siteId = $ payment -> getSiteId ();
// ...
$ billId = $ payment -> getBillId ();
// 1.01
$ amount = $ payment -> getAmountValue ();
// RUB
$ currency = $ payment -> getAmountCurrency ();
// CREATED
$ status = $ payment -> getStatusValue ();
/* ... */
// []
$ status = $ payment -> getCustomFields ();docker build -t "qiwi-php-client" .docker run -it -v $(pwd):/qiwi-php-client qiwi-php-client bash 와 같은 프리 컨테이너를 시작할 수 있습니다.composer installphpunit.xml.dist 파일을 phpunit.xml 에 복사 할 필요는 없습니다../vendor/bin/phpunit MIT 라이센스. 자세한 내용은 라이센스 파일을 참조하십시오.