Skip to content

Commit db5ba90

Browse files
committed
Update package description and improve variable names
1 parent 9eccc02 commit db5ba90

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

README.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99

1010
An opinionated Laravel package to handle payments, complete with blade views, routing, and everything in-between.
1111

12-
Whether you want to quickly bootstrap payment processing for your Laravel applications, or you want a way to test supported payment processors, this package's got you covered.
12+
Whether you want to quickly bootstrap payment processing for your Laravel applications, or you want a way to test supported payment processors, this package's got you!
1313

1414
> Although opinionated, this package allows you to "theme" the views. It achieves this theming by
15-
> `@extend()`ing whatever view you specify in `config('laravel-multipay.extended_layout')` (defaults to `layout.app`). This provides a smooth Plug-and-play™ experience.
15+
> `@extend()`ing whatever view you specify in `config('laravel-multipay.extended_layout')` (defaults to `layout.app`).
1616
1717
## Requirements:
1818
This package is [tested against:](https://github.com/damms005/laravel-multipay/blob/d1a15bf762ba2adabc97714f1565c6c0f0fcd58d/.github/workflows/run-tests.yml#L16-17)
@@ -37,25 +37,23 @@ _key_:
3737
> Adding a new payment handler is straight-forward. Simply add a class that extends `Damms005\LaravelMultipay\Services\PaymentHandlers\BasePaymentHandler` and implement `Damms005\LaravelMultipay\Contracts\PaymentHandlerInterface`
3838
3939
> **Note** <br />
40-
> Payment providers that you so register as described above are resolved from the [Laravel Container](https://laravel.com/docs/9.x/container) to improve the flexibility of this package and improve DX.
40+
> Payment providers that you so register as described above are resolvable from the [Laravel Container](https://laravel.com/docs/9.x/container) to improve the flexibility of this package and improve DX.
4141
4242
## Installation
4343

44-
You need to do just 3 things:
45-
46-
- Install via composer.
44+
1. Install via composer.
4745

4846
```bash
4947
composer require damms005/laravel-multipay
5048
```
5149

52-
- Publish the config file.
50+
1. Publish the config file.
5351

5452
```bash
5553
php artisan vendor:publish --tag=laravel-multipay-config
5654
```
5755

58-
- Run migrations.
56+
1. Run migrations.
5957

6058
```
6159
php artisan migrate
@@ -81,28 +79,28 @@ For [Paystack](https://paystack.com), ensure to set `paystack_secret_key` key in
8179

8280
### Needed Third-party Integrations:
8381

84-
- Flutterwave: If you want to use Flutterwave, ensure to get your API details [from the dashboard](https://dashboard.flutterwave.com/dashboard/settings/apis), and use it to set the following environmental variables:
82+
- Flutterwave: If you want to use Flutterwave, ensure to get your API details [from the dashboard](https://dashboard.flutterwave.com/dashboard/settings/apis), and use it to set the following variables in your `.env` file:
8583

8684
```
8785
FLW_PUBLIC_KEY=FLWPUBK-xxxxxxxxxxxxxxxxxxxxx-X
8886
FLW_SECRET_KEY=FLWSECK-xxxxxxxxxxxxxxxxxxxxx-X
8987
FLW_SECRET_HASH='My_lovelysite123'
9088
```
9189

92-
- Paystack: Paystack requires a secret key. Go to [the Paystack dashboard](https://dashboard.paystack.co/#/settings/developer) to obtain one, and use it to set the following environmental variable:
90+
- Paystack: Paystack requires a secret key. Go to [the Paystack dashboard](https://dashboard.paystack.co/#/settings/developer) to obtain one, and use it to set the following variable:
9391

9492
```
9593
PAYSTACK_SECRET_KEY=FLWPUBK-xxxxxxxxxxxxxxxxxxxxx-X
9694
```
9795

98-
- Remita: Ensure to set the following environmental variables:
96+
- Remita: Ensure to set the following environment variables:
9997

10098
```
10199
REMITA_MERCHANT_ID=xxxxxxxxxxxxxxxxxxxxx-X
102100
REMITA_API_KEY=xxxxxxxxxxxxxxxxxxxxx-X
103101
```
104102

105-
> For most of the above environmental variables, you should rather use the (published) config file to set the corresponding values.
103+
> For most of the above environment variables, you should rather use the (published) config file to set the corresponding values.
106104
107105
## Usage
108106

@@ -114,9 +112,9 @@ Send a `POST` request to `/payment/details/confirm` (`route('payment.show_transa
114112

115113
Check the [InitiatePaymentRequest](src/Http/Requests/InitiatePaymentRequest.php#L28) form request class to know the values you are to post to this endpoint. (tip: you can also check [test-drive/pay.blade.php](views/test-drive/pay.blade.php)).
116114

117-
This `POST` request will typically simply be made by submitting a form from your frontend.
115+
This `POST` request will typically be made by submitting a form from your frontend to the route described above.
118116

119-
> Tip: if you need to store additional/contextual data with this payment, you can include such data in the request, in a field named `metadata`. The value must be a valid JSON string.
117+
> [!NOTE] if you need to store additional/contextual data with this payment, you can include such data in the request, in a field named `metadata`. The value must be a valid JSON string.
120118
121119
#### Step 2
122120

@@ -129,9 +127,9 @@ back to `/payment/completed` (`route('payment.finished.callback_url')` provided
129127

130128
> [!NOTE] If the `Payment` has [`metadata`](#step-1) (supplied with the payment initiation request), with a key named `completion_url`, the user will be redirected to that URL instead on successful payment, with the transaction reference included as `transaction_reference` in the URL query string.
131129
132-
> [!NOTE] If the `Payment` has [`metadata`](#step-1) (supplied with the payment initiation request), with a key named `payment_processor`, you can use that to dynamically set the payment handler for that particular transaction. Valid value is any of [the providers listed above](#currently-supported-payment-handlers)
130+
> [!NOTE] If the `Payment` has [`metadata`](#step-1) (supplied with the payment initiation request), and it contains a key named `payment_processor`, it will be used to dynamically set the payment handler for that particular transaction. Valid value is any of [the providers listed above](#currently-supported-payment-handlers)
133131
134-
> [!NOTE] If the `Payment` has [`metadata`](#step-1) (supplied with the payment initiation request), with a key named `split_code`, for Paystack transactions, it will be process as [Paystack Multi-split Transaction](https://paystack.com/docs/payments/multi-split-payments).
132+
> [!NOTE] If the `Payment` has [`metadata`](#step-1) (supplied with the payment initiation request), with a key named `split_code`, for Paystack transactions, it will be processed as [Paystack Multi-split Transaction](https://paystack.com/docs/payments/multi-split-payments).
135133
136134
> [!NOTE] If there are additional steps you want to take upon successful payment, listen for `SuccessfulLaravelMultipayPaymentEvent`. It will be fired whenever a successful payment occurs, with its corresponding `Payment` model.
137135
@@ -146,12 +144,12 @@ If for any reason, your user/customer claims that the payment they made was succ
146144
$outcome = LaravelMultipay::reQueryUnsuccessfulPayment( $payment )
147145
```
148146

149-
The payment will be re-resolved and the payment will be updated in the database. If the payment is successful, the `SuccessfulLaravelMultipayPaymentEvent` event will be fired, availing you the opportunity to run any domain/application-specific procedures.
147+
The payment will be re-resolved and the payment will be updated in the database. If the payment is successful, the `SuccessfulLaravelMultipayPaymentEvent` event will be fired, so you can run any domain/application-specific procedures.
150148

151149
## Payment Notifications (WebHooks)
152150
Some payment handlers provide a means for sending details of successful notifications. Usually, you will need to provide the payment handler with a URL to which the details of such notification will be sent. Should you need this feature, the notification URL is handled by `route('payment.external-webhook-endpoint' provided by this package)`.
153151

154-
> If you use this payment notification URL feature, ensure that in your handler for `SuccessfulLaravelMultipayPaymentEvent`, check that you have not previously handled the event for that same payment.
152+
> If you use this payment notification URL feature, ensure that in the handler for `SuccessfulLaravelMultipayPaymentEvent`, you have not previously handled the event for that same payment.
155153
156154
## Testing
157155

0 commit comments

Comments
 (0)