Download the PHP package clanmax/tinkoff-autopay without Composer
On this page you can find all versions of the php package clanmax/tinkoff-autopay. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package tinkoff-autopay
Tinkoff Autopay
Small library which help you to use methods from Tinkoff API Documentation.
It was made for Laravel 7.0, but basically it working on Laravel 11 and almost all others PHP applications.
It use some of Laravel-Tinkoff functions inside.
What it's doing
Just basic things. For example, we can:
- Add customer
- Get customer data
- Remove customer
- Get card list of customer
- Remove customer cards
- Charge money
You have to be sure you already have permission to use this kind of function. You could ask your own manager in Tinkoff bank.
Which methods supported
To be more clear it's work with:
Init
AddCustomer
GetCustomer
RemoveCustomer
GetCardList
RemoveCard
Charge
This library not implement Init
method in version 0.01. But it's implemented in 0.02.
Probably in some close future I will add FinishAuthorize
method, but not sure right now.
What in plans
FinishAuthorize
probably will work- Right now library not return additional values of users (email, IP, etc). Will fix it.
How does it work
Install library from composer
Connect library with you controller by using use
Logic
Step by step how to use Charge
Preparing
- Add customer (it will be added automatically in
Init
method, btw) - Request
Init
(not included in 0.01) withCustomerKey
andRecurrent
parameters - Redirect user to payment form from
PaymentURL
value
Charging
- Request
Init
withoutCustomerKey
andRecurrent
parameters - Save
PaymentID
- Request
GetCardList
and take from card which you want to useRebillId
- Request
Charge
withPaymentID
,RebillId
, and OperationInitiatorType
In this case user will be charged automatically and payment will be approved instantly.
How to use
Make sure you already have Terminal Key and Terminal Password from you bank account. For using FinishAuthorize
method you can get public key when switch you terminal working mode to Mobile application.
Initial payment
Make POST
request to Init
with two additional parameters:
Where CustomerKey
name of already added client and Recurrent
just with Y
For example:
Return will look like this:
Just to be sure Tax in Items could be:
- osn — общая
- usn_income — упрощенная (доходы)
- usn_income_outcome — упрощенная (доходы минус расходы)
- patent — патентная
- envd — единый налог на вмененный доход
- esn — единый сельскохозяйственный налог
Charge money
Few steps:
- Make
POST
request to Init, but withoutRecurrent
andCustomerKey
- Grab
PaymentId
from there
Add customer
You have to make customer always before he did pay. One customer may have lots of connected cards by Init
method.
Get customer
Return existing customers. You have to have his name which you used before.
Remove customer
Just removing all data of user. Be sure you won't use RebillId
of this user anymore.
Get card list
You will use this method for get RebillId
. Return bunch of cards which user saved by Init
method.
Remove card
If your client have tons of cards but you are not ready to use them instead of delete user you may just delete card. Just get card number from GetCardList
Find errors
I would recommend always check all request for errors by this way
Error
keep some information and you may use it for show to user (but be aware).
Get token
In some moment you probably will need token for testing. You may use methods in TinkoffKey class.
How does it work:
- Connect class
- Change your data (or send you own)
- Get data