|
1 | | -# SimPay-API-php |
2 | | -Znajdziesz tu pliki do pobrania i instalacji oficjalnego klienta PHP wszystkich dostępnych API SimPay. |
| 1 | +## Simpay.pl API PHP SDK |
3 | 2 |
|
4 | | -Dzięki naszemu klientowi *zyskasz narzędzia i biblioteki* do integracji API systemu płatności SimPay z Twoją stroną. Dzięki temu zyskasz pełen dostęp do wszystkich funkcji SimPay. |
| 3 | +# Description |
5 | 4 |
|
6 | | -## Dokumentacja |
7 | | -[Kliknij tutaj](https://docs.simpay.pl/pl/php/?php#wstep) |
| 5 | +This documentation is intended for current and future Simpay Partners. Prior to implementation, it is necessary to define the service in the Partner Panel and wait for its activation directly from the operators. |
8 | 6 |
|
9 | | -## Wymagania |
10 | | -* PHP 7.4+ |
| 7 | +## Installation & Usage |
11 | 8 |
|
12 | | -## Instalacja |
| 9 | +### Requirements |
13 | 10 |
|
14 | | -SimPay API php można zainstalować za pomocą [Composer](https://packagist.org/packages/simpaypl/simpay). |
| 11 | +PHP 7.4 and later. |
| 12 | +Should also work with PHP 8.0. |
15 | 13 |
|
16 | 14 | ### Composer |
17 | 15 |
|
18 | | -#### Instalacja automatyczna |
19 | | -```composer require simpaypl/simpay``` |
| 16 | +To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`: |
20 | 17 |
|
21 | | -#### Instalacja ręczna |
22 | | -Wewnątrz `composer.json` dodaj następujący wpis: |
23 | | - |
24 | | -``` json |
| 18 | +```json |
25 | 19 | { |
| 20 | + "repositories": [ |
| 21 | + { |
| 22 | + "type": "vcs", |
| 23 | + "url": "https://github.com/8lines/simpay-php-sdk.git" |
| 24 | + } |
| 25 | + ], |
26 | 26 | "require": { |
27 | | - "simpaypl/simpay": "dev-master" |
| 27 | + "8lines/simpay-php-sdk": "*@dev" |
28 | 28 | } |
29 | 29 | } |
30 | 30 | ``` |
31 | 31 |
|
32 | | -## Dlaczego warto wybrać SimPay? |
33 | | -* *Prosta i szybka integracja* – nasz klient API jest intuicyjny w obsłudze, dzięki czemu poradzisz sobie z integracją nawet bez większych umiejętności. |
34 | | -* *Natychmiastowe zarobki* – ażdego dnia prześlemy Ci zyski z płatności online |
35 | | -* *Bezpieczeństwo i ciągłe wsparcie techniczne* – gwarantujemy odpowiednie zabezpieczenie wszystkich płatności. A w razie problemów z integracją lub działaniem systemów SimPay, natychmiast reagujemy wsparciem. |
| 32 | +Then run `composer install` |
36 | 33 |
|
37 | | -Masz problem z integracją lub chcesz dowiedzieć się więcej? Napisz na [email protected] |
| 34 | +### Manual Installation |
38 | 35 |
|
39 | | ---- |
| 36 | +Download the files and include `autoload.php`: |
40 | 37 |
|
41 | | -# SimPay-API-php |
42 | | -Here you will find files to download and install the official PHP client of all available SimPay APIs. |
| 38 | +```php |
| 39 | +<?php |
| 40 | +require_once('/prject/path/vendor/autoload.php'); |
| 41 | +``` |
43 | 42 |
|
44 | | -With our client, you will get *the tools and libraries* to integrate the SimPay payment system API into your site. This will give you full access to all SimPay features. |
| 43 | +## Getting Started |
45 | 44 |
|
46 | | -## Documentation |
47 | | -[Click here](https://docs.simpay.pl/en/php/?php#wstep) |
| 45 | +```php |
| 46 | +<?php |
48 | 47 |
|
49 | | -## Requirements |
50 | | -* PHP 7.4+ |
| 48 | +require_once(__DIR__ . '/vendor/autoload.php'); |
51 | 49 |
|
52 | | -## Installation |
| 50 | +$configuration = new Configuration('your_api_key', 'your_api_password', 'en'); |
| 51 | +$client = new Client([ |
| 52 | + 'base_uri' => Configuration::API_BASE_URI, |
| 53 | +]); |
53 | 54 |
|
54 | | -The SimPay API php can be installed using [Composer](https://packagist.org/packages/simpaypl/simpay). |
| 55 | +$api = new Simpay\DirectBillingApi( |
| 56 | + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. |
| 57 | + // This is optional, `GuzzleHttp\Client` will be used as default. |
| 58 | + $client, |
| 59 | + $config |
| 60 | +); |
55 | 61 |
|
56 | | -### Composer |
| 62 | +try { |
| 63 | + $result = $api->directBillingGetServices(); |
| 64 | + print_r($result); |
| 65 | +} catch (\Exception $e) { |
| 66 | + echo 'Exception when calling DirectBillingApi->directbillingGetServices: ', $e->getMessage(), PHP_EOL; |
| 67 | +} |
57 | 68 |
|
58 | | -#### Automatic install |
59 | | -```composer require simpaypl/simpay``` |
| 69 | +``` |
| 70 | +### Examples |
| 71 | + |
| 72 | +All examples are in the [examples](docs/examples/) directory. |
| 73 | + |
| 74 | +## Documentation for API Endpoints |
| 75 | + |
| 76 | +## API Endpoints |
| 77 | + |
| 78 | +All URIs are relative to *https://api.simpay.pl* |
| 79 | +- [Configuration](docs/Configuration.md) |
| 80 | +- [DirectBillingApi](docs/DirectBillingApi.md) |
| 81 | +- [DirectBillingCalculateApi](docs/DirectBillingCalculateApi.md) |
| 82 | +- [DirectBillingTransactionApi](docs/DirectBillingTransactionApi.md) |
| 83 | +- [HttpClientFactory](docs/HttpClientFactory.md) |
| 84 | +- [PaymentApi](docs/PaymentApi.md) |
| 85 | +- [SmsNumberApi](docs/SmsNumberApi.md) |
| 86 | +- [SmsServiceApi](docs/SmsServiceApi.md) |
| 87 | +- [SmsTransactionApi](docs/SmsTransactionApi.md) |
| 88 | + |
| 89 | +## Models |
| 90 | + |
| 91 | +### Requests: |
| 92 | +- [Amount](docs/Model/Amount.md) |
| 93 | +- [AmountType](docs/Model/AmountType.md) |
| 94 | +- [Billing](docs/Model/Billing.md) |
| 95 | +- [CallbackReturnUrl](docs/Model/Request/CallbackReturnUrl.md) |
| 96 | +- [CartItem](docs/Model/Request/CartItem.md) |
| 97 | +- [Channel](docs/Model/Request/Channel.md) |
| 98 | +- [ChannelType](docs/Model/Request/ChannelType.md) |
| 99 | +- [Control](docs/Model/Request/Control.md) |
| 100 | +- [CreatePayment](docs/Model/Request/CreatePayment.md) |
| 101 | +- [Currency](docs/Model/Request/Currency.md) |
| 102 | +- [Customer](docs/Model/Request/Customer.md) |
| 103 | +- [Description](docs/Model/Request/Description.md) |
| 104 | +- [DirectBillingTransaction](docs/Model/Request/DirectBillingTransaction.md) |
| 105 | +- [DirectBillingTransactionStatus](docs/Model/Request/DirectBillingTransactionStatus.md) |
| 106 | +- [DirectChannel](docs/Model/Request/DirectChannel.md) |
| 107 | +- [Filters](docs/Model/Request/Filters.md) |
| 108 | +- [Operator](docs/Model/Request/Operator.md) |
| 109 | +- [PaymentTransactionId](docs/Model/Request/PaymentTransactionId.md) |
| 110 | +- [PhoneNumber](docs/Model/Request/PhoneNumber.md) |
| 111 | +- [Referer](docs/Model/Request/Referer.md) |
| 112 | +- [ServiceId](docs/Model/Request/ServiceId.md) |
| 113 | +- [ServiceNumber](docs/Model/Request/ServiceNumber.md) |
| 114 | +- [Shipping](docs/Model/Request/Shipping.md) |
| 115 | +- [SmsCode](docs/Model/Request/SmsCode.md) |
| 116 | +- [SmsNumber](docs/Model/Request/SmsNumber.md) |
| 117 | +- [SmsTransactionId](docs/Model/Request/SmsTransactionId.md) |
| 118 | +- [StreamId](docs/Model/Request/StreamId.md) |
| 119 | + |
| 120 | +### Responses: |
| 121 | +- [Amount](docs/Model/Response/Amount.md) |
| 122 | +- [AmountType](docs/Model/Response/AmountType.md) |
| 123 | +- [CallbackReturnUrl](docs/Model/Response/CallbackReturnUrl.md) |
| 124 | +- [DirectBillingTransaction](docs/Model/Response/DirectBillingTransaction.md) |
| 125 | +- [DirectBillingTransactionCollection](docs/Model/Response/DirectBillingTransactionCollection.md) |
| 126 | +- [DirectBillingTransactionList](docs/Model/Response/DirectBillingTransactionList.md) |
| 127 | +- [DirectBillingTransactionNotify](docs/Model/Response/DirectBillingTransactionNotify.md) |
| 128 | +- [Operator](docs/Model/Response/Operator.md) |
| 129 | +- [Pagination](docs/Model/Response/Pagination.md) |
| 130 | +- [PaginationLinks](docs/Model/Response/PaginationLinks.md) |
| 131 | +- [PaymentChannel](docs/Model/Response/PaymentChannel.md) |
| 132 | +- [PaymentChannelCollection](docs/Model/Response/PaymentChannelCollection.md) |
| 133 | +- [PaymentCreate](docs/Model/Response/PaymentCreate.md) |
| 134 | +- [PaymentService](docs/Model/Response/PaymentService.md) |
| 135 | +- [PaymentServiceCollection](docs/Model/Response/PaymentServiceCollection.md) |
| 136 | +- [PaymentServiceTransaction](docs/Model/Response/PaymentServiceTransaction.md) |
| 137 | +- [PaymentServiceTransactionCollection](docs/Model/Response/PaymentServiceTransactionCollection.md) |
| 138 | +- [PaymentServiceTransactionStatus](docs/Model/Response/PaymentServiceTransactionStatus.md) |
| 139 | +- [PaymentServiceTransaction](docs/Model/Response/PaymentServiceTransaction.md) |
| 140 | +- [PaymentServiceTransactionAddress](docs/Model/Response/PaymentTransactionAddress.md) |
| 141 | +- [PaymentServiceTransactionAmount](docs/Model/Response/PaymentTransactionAmount.md) |
| 142 | +- [PaymentServiceTransactionCartItems](docs/Model/Response/PaymentTransactionCartItem.md) |
| 143 | +- [PaymentServiceTransactionCustomer](docs/Model/Response/PaymentTransactionCustomer.md) |
| 144 | +- [PaymentServiceTransactionRedirect](docs/Model/Response/PaymentTransactionRedirect.md) |
| 145 | +- [Service](docs/Model/Response/Service.md) |
| 146 | +- [ServiceCalculation](docs/Model/Response/ServiceCalculation.md) |
| 147 | +- [ServiceCalculationOperatorAmount](docs/Model/Response/ServiceCalculationOperatorAmount.md) |
| 148 | +- [ServiceCollection](docs/Model/Response/ServiceCollection.md) |
| 149 | +- [ServiceNumber](docs/Model/Response/ServiceNumber.md) |
| 150 | +- [ServiceStatus](docs/Model/Response/ServiceStatus.md) |
| 151 | +- [ServiceType](docs/Model/Response/ServiceType.md) |
| 152 | +- [SmsNumber](docs/Model/Response/SmsNumber.md) |
| 153 | +- [SmsNumberCollection](docs/Model/Response/SmsNumberCollection.md) |
| 154 | +- [SmsService](docs/Model/Response/SmsService.md) |
| 155 | +- [SmsServiceCheckCodeData](docs/Model/Response/SmsServiceCheckCodeData.md) |
| 156 | +- [SmsServiceCollection](docs/Model/Response/SmsServiceCollection.md) |
| 157 | +- [SmsTransaction](docs/Model/Response/SmsTransaction.md) |
| 158 | +- [SmsTransactionCollection](docs/Model/Response/SmsTransactionCollection.md) |
| 159 | + |
| 160 | +### Exceptions: |
| 161 | + |
| 162 | +- [Simpay\Exception\ExceptionFactory](docs/Exception/ExceptionFactory.md) |
| 163 | +- [Simpay\Exception\Forbidden](docs/Exception/Forbidden.md) |
| 164 | +- [Simpay\Exception\InternalServerError](docs/Exception/InternalServerError.md) |
| 165 | +- [Simpay\Exception\NotFound](docs/Exception/NotFound.md) |
| 166 | +- [Simpay\Exception\Unauthorized](docs/Exception/Unauthorized.md) |
| 167 | +- [Simpay\Exception\Unknown](docs/Exception/Unknown.md) |
| 168 | +- [Simpay\Exception\UnprocessableEntity](docs/Exception/UnprocessableEntity.md) |
| 169 | + |
| 170 | +All the exceptions have the `getErrors` method which returns an array of errors returned by the API. |
| 171 | + |
| 172 | +## Tests |
| 173 | + |
| 174 | +To run the tests, use: |
| 175 | + |
| 176 | +```bash |
| 177 | +composer install |
| 178 | +bin/phpunit |
| 179 | +``` |
60 | 180 |
|
61 | | -#### Manual install |
62 | | -Inside of `composer.json` specify the following: |
| 181 | +## Docker |
63 | 182 |
|
64 | | -``` json |
65 | | -{ |
66 | | - "require": { |
67 | | - "simpaypl/simpay": "dev-master" |
68 | | - } |
69 | | -} |
| 183 | +To build the Docker image: |
| 184 | + |
| 185 | +```bash |
| 186 | +make build |
| 187 | +``` |
| 188 | +To run the Docker image: |
| 189 | + |
| 190 | +```bash |
| 191 | +make up |
| 192 | +``` |
| 193 | + |
| 194 | +Enter the container (bash): |
| 195 | + |
| 196 | +```bash |
| 197 | +make bash |
| 198 | +``` |
| 199 | + |
| 200 | +To run the tests: |
| 201 | + |
| 202 | +```bash |
| 203 | +make test |
| 204 | +``` |
| 205 | + |
| 206 | +To run the linter: |
| 207 | + |
| 208 | +```bash |
| 209 | +make lint |
70 | 210 | ``` |
71 | 211 |
|
72 | | -## Why should I choose SimPay? |
73 | | -* *Easy and fast integration* – our API client is inuitive to use, so you can handle the integration even without much skill. |
74 | | -* *Instant earnings* – we will send you profits from online payments every day. |
75 | | -* *Safety and continuous technical support* – we guarantee proper security for all payments. And in case of problems with the integration or operation of SimPay systems, we immediately respond with support. |
| 212 | +## About this package |
76 | 213 |
|
77 | | -Do you have an issue with integration or want to learn more? Write to [email protected] |
| 214 | +- API version: `1.0.0` |
0 commit comments