|
| 1 | +# Changelog |
| 2 | +All notable changes to this library will be documented in this file. |
| 3 | + |
| 4 | +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), |
| 5 | +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
| 6 | + |
| 7 | +## [Unreleased] |
| 8 | +* Nothing New |
| 9 | + |
| 10 | + |
| 11 | +## [1.0.0] - 2020-04-06 |
| 12 | + |
| 13 | +This version of the library is a complete reimplementation from ground up. |
| 14 | +Please checkout the following sections to see what changed |
| 15 | + |
| 16 | +### Summary |
| 17 | + |
| 18 | +There is many changes to the library API, so let's get going. |
| 19 | +First we need to set the secret API key: |
| 20 | + |
| 21 | +Before |
| 22 | + |
| 23 | +```php |
| 24 | +\Moyasar\Client::setApiKey("API-KEY"); |
| 25 | +``` |
| 26 | + |
| 27 | +After |
| 28 | + |
| 29 | +```php |
| 30 | +\Moyasar\Moyasar::setApiKey('API-KEY'); |
| 31 | +``` |
| 32 | + |
| 33 | +#### Payment and Invoice Fetch |
| 34 | + |
| 35 | +In case of fetching a payment, we use `PaymentService` class. |
| 36 | + |
| 37 | +Before: |
| 38 | + |
| 39 | +```php |
| 40 | +$data = \Moyasar\Payment::fetch("760878ec-d1d3-5f72-9056-191683f55872"); |
| 41 | +$data = \Moyasar\Invoice::fetch("760878ec-d1d3-5f72-9056-191683f55872"); |
| 42 | +``` |
| 43 | + |
| 44 | +After: |
| 45 | + |
| 46 | +```php |
| 47 | +$paymentService = new \Moyasar\Providers\PaymentService(); |
| 48 | +$invoiceService = new \Moyasar\Providers\InvoiceService(); |
| 49 | + |
| 50 | +$payment = $paymentService->fetch('760878ec-d1d3-5f72-9056-191683f55872'); |
| 51 | +$invoice = $invoiceService->fetch('760878ec-d1d3-5f72-9056-191683f55872'); |
| 52 | +``` |
| 53 | + |
| 54 | +The returned result is of type `\Moyasar\Payment` and `\Moyasar\Invoice` |
| 55 | +respectively and has the ability to perform operations on that |
| 56 | +payment instance like `update`, `refund`, `capture`, and `void`, and operations |
| 57 | +on the other invoice instance like `update` and `cancel`. |
| 58 | + |
| 59 | +#### Payment and Invoice Listing |
| 60 | + |
| 61 | +Before: |
| 62 | + |
| 63 | +```php |
| 64 | +$payments = \Moyasar\Payment::all(); |
| 65 | +$invoices = \Moyasar\Invoice::all(); |
| 66 | +``` |
| 67 | + |
| 68 | +Listing payments or invoices using `list` method in both `PaymentService` and `InvoiceService` class |
| 69 | +returns a `PaginationResult` instance: |
| 70 | + |
| 71 | +```php |
| 72 | +$paymentService = new \Moyasar\Providers\PaymentService(); |
| 73 | +$invoiceService = new \Moyasar\Providers\InvoiceService(); |
| 74 | + |
| 75 | +$search = \Moyasar\Search::query(); |
| 76 | +$search = $search->createdAfter('date'); |
| 77 | +$search = $search->createdBefore('date'); |
| 78 | +$search = $search->id('id'); |
| 79 | +$search = $search->page('page-number-to-list'); |
| 80 | +$search = $search->source('payment-source-type'); |
| 81 | +$search = $search->status('status'); |
| 82 | + |
| 83 | +$paymentListing = $paymentService->all($search); |
| 84 | +$payments = $paymentListing->result; |
| 85 | + |
| 86 | +$invoiceListing = $invoiceService->all(); |
| 87 | +$invoices = $invoiceListing->result; |
| 88 | + |
| 89 | +$invoiceListing->currentPage; // Current Page |
| 90 | +$invoiceListing->nextPage; // Next Page or null |
| 91 | +$invoiceListing->previousPage; // Previous Page or null |
| 92 | +$invoiceListing->totalCount; // Total Invoices |
| 93 | +$invoiceListing->totalPages; // Total Pages |
| 94 | +``` |
| 95 | + |
| 96 | +--- |
| 97 | + |
| 98 | +### Removed |
| 99 | +* `Client` class |
| 100 | +* `HttpRequestNotFound` class |
| 101 | +* `Invoice` class (Used to perform all invoice operations) |
| 102 | +* `Payment` class (Used to perform all payment operations) |
| 103 | + |
| 104 | +### Added |
| 105 | +* `Moyasar` class that stores API keys and version information |
| 106 | +* `HttpClient` interface |
| 107 | +* `HttpClient` class, implements all HTTP transactions |
| 108 | +* `Resource` class |
| 109 | +* `OnlineResource` class that represent resources that can perform some operations |
| 110 | +* `Invoice` class, extends `OnlineResource`, used to perform operations related to a single invoice |
| 111 | +* `Payment` class, extends `OnlineResource` |
| 112 | +* `InvoiceService` service class, used to create, fetch, and list invoices |
| 113 | +* `PaymentService` service class, used to fetch, and list payments |
| 114 | +* `Search` class, used to provide search parameters to list methods in `InvoiceService` and `PaymentService` |
| 115 | +* `Source` class to represent a payment source for `Payment` |
| 116 | +* `CreditCard` class that represents `creditcard` payment method in Moyasar's API |
| 117 | +* `Sadad` class that represents `sadad` payment method in Moyasar's API |
| 118 | +* `PaginationResult` class, returned by list methods on `InvoiceService` and `PaymentService` |
| 119 | +* `BaseException` as a base for all library exceptions |
| 120 | +* `ApiException` class that represent error returned by Moyasar's API |
| 121 | +* `ValidationException` thrown when data validation fails before sending a request to the backend |
| 122 | +* `Invoice` facade for Laravel |
| 123 | +* `Payment` facade for Laravel |
| 124 | +* `LaravelServiceProvider` class, used to automatically register Moyasar's services in Laravel's service container |
| 125 | +* `GuzzleClientFactory` factory class |
| 126 | +* Unit Testing |
| 127 | +* Laravel Configuration File `config/config.php` |
| 128 | + |
| 129 | +### Changes |
| 130 | +* The library now requires PHP version `5.6.0` or higher instead of `5.5.0` |
| 131 | + |
| 132 | + |
| 133 | +## [0.5.0] - 2019-03-27 |
| 134 | +### Removed |
| 135 | +* Disabled the ability to create payments from the library. We recommend you to use [Moyasar Payment Form] |
| 136 | + |
| 137 | +### Changes |
| 138 | +* In this version, we change our library name to be only the word `moyasar`. |
| 139 | + |
| 140 | + |
| 141 | +## [v0.4.3] - 2019-01-28 |
| 142 | +### Added |
| 143 | +* Add ability in PHP wrappers to do: |
| 144 | + * Update a payment. |
| 145 | + * Update an invoice. |
| 146 | + * Cancel an invoice. |
| 147 | + |
| 148 | + |
| 149 | +## [v0.4.0] - 2016-11-02 |
| 150 | +### Changed |
| 151 | +* This version has a breaking change. We rename our main classes to be single not plural. So `Payments` class now `Payment` and `Invoices` changed to `Invoice` |
| 152 | + |
| 153 | + |
| 154 | +## [v0.3.5] - 2016-09-05 |
| 155 | +### Changed |
| 156 | +* Fixed List Method |
| 157 | + |
| 158 | + |
| 159 | +## [v0.3.0] - 2016-07-19 |
| 160 | +* First Release |
| 161 | + |
| 162 | + |
| 163 | +[Unreleased]: https://github.com/moyasar/moyasar-php/compare/1.0.0...HEAD |
| 164 | +[1.0.0]: https://github.com/moyasar/moyasar-php/releases/tag/1.0.0 |
| 165 | +[0.5.0]: https://github.com/moyasar/moyasar-php/releases/tag/0.5.0 |
| 166 | +[v0.4.3]: https://github.com/moyasar/moyasar-php/releases/tag/v0.4.3 |
| 167 | +[v0.4.0]: https://github.com/moyasar/moyasar-php/releases/tag/v0.4.0 |
| 168 | +[v0.3.5]: https://github.com/moyasar/moyasar-php/releases/tag/v0.3.5 |
| 169 | +[v0.3.0]: https://github.com/moyasar/moyasar-php/releases/tag/v0.3.0 |
| 170 | + |
| 171 | +[Moyasar Payment Form]: https://moyasar.com/docs/payments/create-payment/mpf/ |
0 commit comments