Skip to content

Commit 81b2dbe

Browse files
Merge branch 'develop'
2 parents 22e9500 + 907ceda commit 81b2dbe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1501
-427
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github: :vendor_name
1+
github: Deyjandi

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Ask a question
4-
url: https://github.com/:vendor_name/:package_name/discussions/new?category=q-a
4+
url: https://github.com/Deyjandi/laravel-viva-wallet/discussions/new?category=q-a
55
about: Ask the community for help
66
- name: Request a feature
7-
url: https://github.com/:vendor_name/:package_name/discussions/new?category=ideas
7+
url: https://github.com/Deyjandi/laravel-viva-wallet/discussions/new?category=ideas
88
about: Share ideas for new features
99
- name: Report a security issue
10-
url: https://github.com/:vendor_name/:package_name/security/policy
10+
url: https://github.com/Deyjandi/laravel-viva-wallet/security/policy
1111
about: Learn how to notify us for sensitive bugs
1212
- name: Report a bug
13-
url: https://github.com/:vendor_name/:package_name/issues/new
13+
url: https://github.com/Deyjandi/laravel-viva-wallet/issues/new
1414
about: Report a reproducable bug

.github/SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Security Policy
22

3-
If you discover any security related issues, please email author@domain.com instead of using the issue tracker.
3+
If you discover any security related issues, please email pavkfr@hotmail.com instead of using the issue tracker.

.github/workflows/phpstan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Setup PHP
1717
uses: shivammathur/setup-php@v2
1818
with:
19-
php-version: '8.0'
19+
php-version: '8.1'
2020
coverage: none
2121

2222
- name: Install composer dependencies

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
All notable changes to `:package_name` will be documented in this file.
3+
All notable changes to `laravel-viva-wallet` will be documented in this file.
44

55
## 1.0.0 - 202X-XX-XX
66

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) :vendor_name <author@domain.com>
3+
Copyright (c) Deyjandi <pavkfr@hotmail.com>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,18 @@
11

22
[<img src="https://github-ads.s3.eu-central-1.amazonaws.com/support-ukraine.svg?t=1" />](https://supportukrainenow.org)
33

4-
# :package_description
5-
6-
[![Latest Version on Packagist](https://img.shields.io/packagist/v/:vendor_slug/:package_slug.svg?style=flat-square)](https://packagist.org/packages/:vendor_slug/:package_slug)
7-
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/:vendor_slug/:package_slug/run-tests?label=tests)](https://github.com/:vendor_slug/:package_slug/actions?query=workflow%3Arun-tests+branch%3Amain)
8-
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/:vendor_slug/:package_slug/Check%20&%20fix%20styling?label=code%20style)](https://github.com/:vendor_slug/:package_slug/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain)
9-
[![Total Downloads](https://img.shields.io/packagist/dt/:vendor_slug/:package_slug.svg?style=flat-square)](https://packagist.org/packages/:vendor_slug/:package_slug)
10-
<!--delete-->
11-
---
12-
This repo can be used to scaffold a Laravel package. Follow these steps to get started:
13-
14-
1. Press the "Use template" button at the top of this repo to create a new repo with the contents of this skeleton.
15-
2. Run "php ./configure.php" to run a script that will replace all placeholders throughout all the files.
16-
3. Have fun creating your package.
17-
4. If you need help creating a package, consider picking up our <a href="https://laravelpackage.training">Laravel Package Training</a> video course.
18-
---
19-
<!--/delete-->
4+
# Implementation of viva wallet's API for laravel projects
5+
6+
[![Latest Version on Packagist](https://img.shields.io/packagist/v/deyjandi/laravel-viva-wallet.svg?style=flat-square)](https://packagist.org/packages/deyjandi/laravel-viva-wallet)
7+
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/deyjandi/laravel-viva-wallet/run-tests?label=tests)](https://github.com/deyjandi/laravel-viva-wallet/actions?query=workflow%3Arun-tests+branch%3Amain)
8+
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/deyjandi/laravel-viva-wallet/Check%20&%20fix%20styling?label=code%20style)](https://github.com/deyjandi/laravel-viva-wallet/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain)
9+
[![Total Downloads](https://img.shields.io/packagist/dt/deyjandi/laravel-viva-wallet.svg?style=flat-square)](https://packagist.org/packages/deyjandi/laravel-viva-wallet)
10+
2011
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
2112

2213
## Support us
2314

24-
[<img src="https://github-ads.s3.eu-central-1.amazonaws.com/:package_name.jpg?t=1" width="419px" />](https://spatie.be/github-ad-click/:package_name)
15+
[<img src="https://github-ads.s3.eu-central-1.amazonaws.com/laravel-viva-wallet.jpg?t=1" width="419px" />](https://spatie.be/github-ad-click/laravel-viva-wallet)
2516

2617
We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).
2718

@@ -32,20 +23,20 @@ We highly appreciate you sending us a postcard from your hometown, mentioning wh
3223
You can install the package via composer:
3324

3425
```bash
35-
composer require :vendor_slug/:package_slug
26+
composer require deyjandi/laravel-viva-wallet
3627
```
3728

3829
You can publish and run the migrations with:
3930

4031
```bash
41-
php artisan vendor:publish --tag=":package_slug-migrations"
32+
php artisan vendor:publish --tag="laravel-viva-wallet-migrations"
4233
php artisan migrate
4334
```
4435

4536
You can publish the config file with:
4637

4738
```bash
48-
php artisan vendor:publish --tag=":package_slug-config"
39+
php artisan vendor:publish --tag="laravel-viva-wallet-config"
4940
```
5041

5142
This is the contents of the published config file:
@@ -58,14 +49,14 @@ return [
5849
Optionally, you can publish the views using
5950

6051
```bash
61-
php artisan vendor:publish --tag=":package_slug-views"
52+
php artisan vendor:publish --tag="laravel-viva-wallet-views"
6253
```
6354

6455
## Usage
6556

6657
```php
67-
$variable = new VendorName\Skeleton();
68-
echo $variable->echoPhrase('Hello, VendorName!');
58+
$vivaWallet = new Deyjandi\VivaWallet();
59+
echo $vivaWallet->echoPhrase('Hello, Deyjandi!');
6960
```
7061

7162
## Testing
@@ -88,7 +79,7 @@ Please review [our security policy](../../security/policy) on how to report secu
8879

8980
## Credits
9081

91-
- [:author_name](https://github.com/:author_username)
82+
- [Pavlos Kafritsas](https://github.com/Deyjandi)
9283
- [All Contributors](../../contributors)
9384

9485
## License

composer.json

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
11
{
2-
"name": ":vendor_slug/:package_slug",
3-
"description": ":package_description",
2+
"name": "deyjandi/laravel-viva-wallet",
3+
"description": "Implementation of Viva Wallet's API for laravel projects",
44
"keywords": [
5-
":vendor_name",
5+
"Deyjandi",
66
"laravel",
7-
":package_slug"
7+
"laravel-viva-wallet",
8+
"viva wallet",
9+
"viva-wallet",
10+
"VivaWallet"
811
],
9-
"homepage": "https://github.com/:vendor_slug/:package_slug",
12+
"homepage": "https://github.com/deyjandi/laravel-viva-wallet",
1013
"license": "MIT",
1114
"authors": [
1215
{
13-
"name": ":author_name",
14-
"email": "author@domain.com",
16+
"name": "Pavlos Kafritsas",
17+
"email": "pavkfr@hotmail.com",
1518
"role": "Developer"
1619
}
1720
],
1821
"require": {
19-
"php": "^8.0",
20-
"spatie/laravel-package-tools": "^1.9.2",
21-
"illuminate/contracts": "^9.0"
22+
"php": "^8.1.0",
23+
"guzzlehttp/guzzle": "^7.4",
24+
"illuminate/contracts": "^9.0",
25+
"spatie/laravel-package-tools": "^1.9.2"
2226
},
2327
"require-dev": {
2428
"nunomaduro/collision": "^6.0",
@@ -34,13 +38,13 @@
3438
},
3539
"autoload": {
3640
"psr-4": {
37-
"VendorName\\Skeleton\\": "src",
38-
"VendorName\\Skeleton\\Database\\Factories\\": "database/factories"
41+
"Deyjandi\\VivaWallet\\": "src",
42+
"Deyjandi\\VivaWallet\\Database\\Factories\\": "database/factories"
3943
}
4044
},
4145
"autoload-dev": {
4246
"psr-4": {
43-
"VendorName\\Skeleton\\Tests\\": "tests"
47+
"Deyjandi\\VivaWallet\\Tests\\": "tests"
4448
}
4549
},
4650
"scripts": {
@@ -49,15 +53,19 @@
4953
"test-coverage": "vendor/bin/pest --coverage"
5054
},
5155
"config": {
52-
"sort-packages": true
56+
"sort-packages": true,
57+
"allow-plugins": {
58+
"pestphp/pest-plugin": true,
59+
"phpstan/extension-installer": true
60+
}
5361
},
5462
"extra": {
5563
"laravel": {
5664
"providers": [
57-
"VendorName\\Skeleton\\SkeletonServiceProvider"
65+
"Deyjandi\\VivaWallet\\VivaWalletServiceProvider"
5866
],
5967
"aliases": {
60-
"Skeleton": "VendorName\\Skeleton\\Facades\\Skeleton"
68+
"VivaWallet": "Deyjandi\\VivaWallet\\Facades\\VivaWallet"
6169
}
6270
}
6371
},

config/skeleton.php

Lines changed: 0 additions & 5 deletions
This file was deleted.

config/viva-wallet.php

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
<?php
2+
3+
use Deyjandi\VivaWallet\Enums\VivaWalletPaymentMethod;
4+
5+
return [
6+
7+
/*
8+
|--------------------------------------------------------------------------
9+
| Viva Wallet Environment
10+
|--------------------------------------------------------------------------
11+
|
12+
| This value determines the target environment for every HTTP request.
13+
|
14+
| Available values: "demo" / "live".
15+
*/
16+
'env' => env('VIVA_WALLET_ENV', 'live'),
17+
18+
/*
19+
|--------------------------------------------------------------------------
20+
| Merchant ID
21+
|--------------------------------------------------------------------------
22+
|
23+
| Your merchant id value which is generated upon account creation.
24+
|
25+
| @see https://developer.vivawallet.com/getting-started/find-your-merchant-id-and-api-key/
26+
*/
27+
'merchant_id' => env('VIVA_WALLET_MERCHANT_ID'),
28+
29+
/*
30+
|--------------------------------------------------------------------------
31+
| API Key
32+
|--------------------------------------------------------------------------
33+
|
34+
| Your api key value.
35+
|
36+
| @see https://developer.vivawallet.com/getting-started/find-your-merchant-id-and-api-key/
37+
*/
38+
'api_key' => env('VIVA_WALLET_API_KEY'),
39+
40+
/*
41+
|--------------------------------------------------------------------------
42+
| Client ID
43+
|--------------------------------------------------------------------------
44+
|
45+
| Your client id value.
46+
|
47+
| @see https://developer.vivawallet.com/getting-started/find-your-client-credentials/
48+
*/
49+
'client_id' => env('VIVA_WALLET_CLIENT_ID'),
50+
51+
/*
52+
|--------------------------------------------------------------------------
53+
| Client Secret
54+
|--------------------------------------------------------------------------
55+
|
56+
| Your client secret value.
57+
|
58+
| @see https://developer.vivawallet.com/getting-started/find-your-client-credentials/
59+
*/
60+
'client_secret' => env('VIVA_WALLET_CLIENT_SECRET'),
61+
62+
/*
63+
|--------------------------------------------------------------------------
64+
| Webhook Verification Key
65+
|--------------------------------------------------------------------------
66+
|
67+
| Your webhook verification key value.
68+
|
69+
| You can request a webhook verification key by using this command:
70+
| `php artisan viva-wallet:request webhook-key`
71+
|
72+
| This command stores the webhook verification key in to the ".env" file.
73+
|
74+
| @see https://developer.vivawallet.com/webhooks-for-payments/setup-webhooks/#generate-a-webhook-verification-key
75+
*/
76+
'webhook_key' => env('VIVA_WALLET_WEBHOOK_KEY'),
77+
78+
/*
79+
|--------------------------------------------------------------------------
80+
| Guzzle Http Client Default Options
81+
|--------------------------------------------------------------------------
82+
|
83+
| Here you can specify the default options for the guzzle http client.
84+
|
85+
| This value will affect every HTTP request the package makes.
86+
|
87+
| @see https://docs.guzzlephp.org/en/stable/quickstart.html#creating-a-client
88+
*/
89+
'http_client' => [
90+
91+
'headers' => [
92+
'Accept' => 'application/json',
93+
],
94+
95+
],
96+
97+
/*
98+
|--------------------------------------------------------------------------
99+
| Create Payment Order Default Options
100+
|--------------------------------------------------------------------------
101+
|
102+
| Here you can specify the default options for every
103+
| \Deyjandi\VivaWallet\Facades\VivaWallet::createPaymentOrder() request.
104+
|
105+
| @see https://developer.vivawallet.com/apis-for-payments/payment-api/#tag/Payments
106+
| @see https://developer.vivawallet.com/smart-checkout/smart-checkout-implementation/
107+
*/
108+
'payment' => [
109+
110+
'preauth' => (bool) env('VIVA_WALLET_PAYMENT_PREAUTH', false),
111+
112+
'timeout' => (int) env('VIVA_WALLET_PAYMENT_TIMEOUT', 1800),
113+
114+
'disable_cash' => (bool) env('VIVA_WALLET_PAYMENT_DISABLE_CASH', true),
115+
116+
'disable_wallet' => (bool) env('VIVA_WALLET_DISABLE_WALLET', true),
117+
118+
'source_code' => env('VIVA_WALLET_PAYMENT_SOURCE_CODE'),
119+
120+
'brand_color' => env('VIVA_WALLET_PAYMENT_BRAND_COLOR', '06abc1'),
121+
122+
'preselected_method' => env('VIVA_WALLET_PAYMENT_PRESELECTED_METHOD', VivaWalletPaymentMethod::CreditCard)
123+
124+
],
125+
];

0 commit comments

Comments
 (0)