All notable changes to this library will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Nothing New
Update guzzlehttp/psr7 to resolve CVE-2022-24775.
Add new payment source parameters and Apple Pay source.
Upgraded GuzzleHttp version in composer.json
1.0.0 - 2020-04-06
This version of the library is a complete reimplementation from ground up. Please checkout the following sections to see what changed
There is many changes to the library API, so let's get going. First we need to set the secret API key:
Before
\Moyasar\Client::setApiKey("API-KEY");
After
\Moyasar\Moyasar::setApiKey('API-KEY');
In case of fetching a payment, we use PaymentService
class.
Before:
$data = \Moyasar\Payment::fetch("760878ec-d1d3-5f72-9056-191683f55872");
$data = \Moyasar\Invoice::fetch("760878ec-d1d3-5f72-9056-191683f55872");
After:
$paymentService = new \Moyasar\Providers\PaymentService();
$invoiceService = new \Moyasar\Providers\InvoiceService();
$payment = $paymentService->fetch('760878ec-d1d3-5f72-9056-191683f55872');
$invoice = $invoiceService->fetch('760878ec-d1d3-5f72-9056-191683f55872');
The returned result is of type \Moyasar\Payment
and \Moyasar\Invoice
respectively and has the ability to perform operations on that
payment instance like update
, refund
, capture
, and void
, and operations
on the other invoice instance like update
and cancel
.
Before:
$payments = \Moyasar\Payment::all();
$invoices = \Moyasar\Invoice::all();
Listing payments or invoices using list
method in both PaymentService
and InvoiceService
class
returns a PaginationResult
instance:
$paymentService = new \Moyasar\Providers\PaymentService();
$invoiceService = new \Moyasar\Providers\InvoiceService();
$search = \Moyasar\Search::query();
$search = $search->createdAfter('date');
$search = $search->createdBefore('date');
$search = $search->id('id');
$search = $search->page('page-number-to-list');
$search = $search->source('payment-source-type');
$search = $search->status('status');
$paymentListing = $paymentService->all($search);
$payments = $paymentListing->result;
$invoiceListing = $invoiceService->all();
$invoices = $invoiceListing->result;
$invoiceListing->currentPage; // Current Page
$invoiceListing->nextPage; // Next Page or null
$invoiceListing->previousPage; // Previous Page or null
$invoiceListing->totalCount; // Total Invoices
$invoiceListing->totalPages; // Total Pages
Client
classHttpRequestNotFound
classInvoice
class (Used to perform all invoice operations)Payment
class (Used to perform all payment operations)
Moyasar
class that stores API keys and version informationHttpClient
interfaceHttpClient
class, implements all HTTP transactionsResource
classOnlineResource
class that represent resources that can perform some operationsInvoice
class, extendsOnlineResource
, used to perform operations related to a single invoicePayment
class, extendsOnlineResource
InvoiceService
service class, used to create, fetch, and list invoicesPaymentService
service class, used to fetch, and list paymentsSearch
class, used to provide search parameters to list methods inInvoiceService
andPaymentService
Source
class to represent a payment source forPayment
CreditCard
class that representscreditcard
payment method in Moyasar's APISadad
class that representssadad
payment method in Moyasar's APIPaginationResult
class, returned by list methods onInvoiceService
andPaymentService
BaseException
as a base for all library exceptionsApiException
class that represent error returned by Moyasar's APIValidationException
thrown when data validation fails before sending a request to the backendInvoice
facade for LaravelPayment
facade for LaravelLaravelServiceProvider
class, used to automatically register Moyasar's services in Laravel's service containerGuzzleClientFactory
factory class- Unit Testing
- Laravel Configuration File
config/config.php
- The library now requires PHP version
5.6.0
or higher instead of5.5.0
0.5.0 - 2019-03-27
- Disabled the ability to create payments from the library. We recommend you to use Moyasar Payment Form
- In this version, we change our library name to be only the word
moyasar
.
v0.4.3 - 2019-01-28
- Add ability in PHP wrappers to do:
- Update a payment.
- Update an invoice.
- Cancel an invoice.
v0.4.0 - 2016-11-02
- This version has a breaking change. We rename our main classes to be single not plural. So
Payments
class nowPayment
andInvoices
changed toInvoice
v0.3.5 - 2016-09-05
- Fixed List Method
v0.3.0 - 2016-07-19
- First Release