Skip to content

Commit 946a161

Browse files
authored
Merge pull request #42 from shabayekdes/develop
Develop
2 parents 6a8bfc8 + d7d6cbf commit 946a161

29 files changed

+1220
-752
lines changed

.github/workflows/tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: tests
22

33
on:
44
push:
5+
branches:
6+
- main
7+
- develop
58
pull_request:
69
schedule:
710
- cron: '0 0 * * *'
@@ -32,5 +35,6 @@ jobs:
3235
- name: Install dependencies
3336
run: |
3437
composer update --prefer-dist --no-interaction --no-progress
38+
3539
- name: Execute tests
3640
run: vendor/bin/phpunit --verbose

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22

33
## [Unreleased](https://github.com/shabayekdes/laravel-payment/compare/main...develop)
44

5+
## [v0.8.0 (2022-04-13)](https://github.com/shabayekdes/laravel-payment/compare/v0.7.1...v0.8.0)
6+
7+
### Added
8+
- Added new payment gateway Mastercard ([#43](https://github.com/shabayekdes/laravel-payment/pull/43)).
9+
- Added payment method models and migration.
10+
- Added new method checkout form to methods.
11+
- Added test cases for mastercard method.
12+
13+
### Changed
14+
- Changed the way we handle the payment gateways from database instead config ([#41](https://github.com/shabayekdes/laravel-payment/pull/41))
15+
- Changed the payment manager to get method from database.
16+
17+
### Enhanced
18+
- Enhanced test cases
19+
520
## [v0.7.1 (2022-02-05)](https://github.com/shabayekdes/laravel-payment/compare/v0.7.0...v0.7.1)
621

722
### Added

README.md

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Laravel Payment Methods
2+
23
[![Github Status](https://github.com/shabayekdes/laravel-payment/actions/workflows/tests.yml/badge.svg)](https://github.com/shabayekdes/laravel-payment/actions) [![Styleci Status](https://github.styleci.io/repos/421966331/shield?style=flat&branch=develop)](https://github.styleci.io/repos/421966331) [![Packagist version](https://img.shields.io/packagist/v/shabayek/laravel-payment)](https://packagist.org/packages/shabayek/laravel-payment) [![mit](https://img.shields.io/apm/l/laravel)](https://packagist.org/packages/shabayek/laravel-payment) ![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/shabayek/laravel-payment) ![Packagist Downloads](https://img.shields.io/packagist/dt/shabayek/laravel-payment)
34

45
This is a Laravel Package for Payment Gateway Integration. It has a clear and consistent API, is fully unit tested, and even comes with an example application to get you started.
@@ -23,7 +24,7 @@ php artisan vendor:publish --provider="Shabayek\Payment\PaymentServiceProvider"
2324

2425
```php
2526
$method_id = 1; // payment method id from the config file
26-
$payment = Payment::store($method_id);
27+
$payment = Payment::via($method_id);
2728
```
2829

2930
- Implement customer details contracts on user model by adding **Billable** trait
@@ -39,14 +40,16 @@ class User extends Authenticatable
3940

4041
}
4142
```
43+
4244
- Following columns is default for billable user
43-
- **first_name**
44-
- **last_name**
45-
- **email**
46-
- **phone**
45+
- **first_name**
46+
- **last_name**
47+
- **email**
48+
- **phone**
4749

4850
if you want to change the column name you can do add public methods on your model with convention name CamelCase like **firstName** + **Column**
4951
FirstNameColumn
52+
5053
```php
5154
/**
5255
* Get the first name.
@@ -59,8 +62,8 @@ FirstNameColumn
5962
}
6063
```
6164

62-
- Implement address details with relation to address model
63-
> The default relation is **address** if you want change the relation name you can do add public methods on your user model
65+
- Implement address details with relation to address model
66+
> The default relation is **address** if you want change the relation name you can do add public methods on your user model
6467
6568
```php
6669
/**
@@ -107,6 +110,12 @@ $payment->customer($user);
107110
$payment->addItem($name, $price, $quantity, $description);
108111
```
109112

113+
- Set transaction id will send to gateway
114+
115+
```php
116+
$payment->transaction($transaction_id);
117+
```
118+
110119
- Check the payment is online to get pay url
111120

112121
```php
@@ -115,7 +124,14 @@ if ($payment->isOnline()) {
115124
}
116125
```
117126

118-
-Print the errors messages
127+
- The MasterCard method adds a new way to get the checkout form
128+
> pass the transaction model will update successIndicator and return view with checkout form
129+
130+
```php
131+
$payment->checkoutForm(Transaction $transaction);
132+
```
133+
134+
- Print the errors messages
119135

120136
```php
121137
$payment->getErrors();
@@ -136,14 +152,28 @@ $payment = $payment->pay($request);
136152
```
137153

138154
- Check the payment status
155+
139156
```php
140157
$method_id = 1; // payment method id from the config file
141158
$payment_order_id = 111; // payment order id
142-
$payment_status = Payment::store($method_id)->verify($payment_order_id);
159+
$payment_status = Payment::via($method_id)->verify($payment_order_id);
143160
```
144161

145162
## Change log
163+
146164
Please see [CHANGELOG](https://github.com/shabayekdes/laravel-payment/blob/main/CHANGELOG.md) for more information on what has been changed recently.
165+
166+
167+
## Contributing
168+
169+
Please see [CONTRIBUTING](https://github.com/shabayekdes/laravel-payment/blob/main/CONTRIBUTING.md) for details.
170+
171+
172+
## Security Vulnerabilities
173+
174+
If you've found a bug regarding security please mail [[email protected]](mailto:[email protected]) instead of using the issue tracker.
175+
176+
147177
## License
148178

149179
The Laravel payment methods package is open-sourced software licensed under the [MIT license](https://github.com/shabayekdes/laravel-payment/blob/main/LICENSE).

0 commit comments

Comments
 (0)