Skip to content

Commit f2ffb4e

Browse files
authored
Merge pull request #131 from imdhemy/chore/update-ci-workflows
2 parents dc0f5cd + 564bb0b commit f2ffb4e

File tree

12 files changed

+185
-170
lines changed

12 files changed

+185
-170
lines changed

.github/pull_request_template.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Mention the related issue, either a feature request or a bug report.
1010

1111
Describe your solution to the problem.
1212

13-
**Does your code follow the PSR-2 standard?** _(Yes|No)_.
13+
**Does your code follow the PSR-12 standard?** _(Yes|No)_.
1414

1515
Answer: ...
1616

.github/workflows/ci.yml

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- '*'
6+
- '*/*'
7+
- '**'
8+
pull_request:
9+
branches:
10+
- '*'
11+
- '*/*'
12+
- '**'
13+
jobs:
14+
# PSR-12 Coding standards
15+
psr-12:
16+
name: PSR-12
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v2
21+
22+
- name: Check PSR-12
23+
uses: docker://oskarstark/php-cs-fixer-ga
24+
with:
25+
args: --config=.php-cs-fixer.dist.php --dry-run
26+
27+
# Static code analysis
28+
static_code_analysis:
29+
name: Psalm - Static code analysis
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v2
34+
35+
- name: PHP setup
36+
uses: shivammathur/setup-php@v2
37+
with:
38+
php-version: '7.4'
39+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
40+
coverage: none
41+
42+
- name: Cache composer dependencies
43+
uses: actions/cache@v1
44+
with:
45+
path: vendor
46+
key: composer-${{ hashFiles('composer.lock') }}
47+
48+
- name: Install dependencies
49+
run: composer install -n --prefer-dist
50+
51+
- name: Psalm
52+
run: composer psalm
53+
54+
# Tests
55+
tests:
56+
runs-on: ${{ matrix.os }}
57+
strategy:
58+
fail-fast: true
59+
matrix:
60+
os: [ ubuntu-latest, windows-latest, macos-latest ]
61+
php: [ 7.4, 8.0, 8.1 ]
62+
name: Tests - ${{ matrix.os }} - ${{ matrix.php }}
63+
steps:
64+
- name: Checkout
65+
uses: actions/checkout@v2
66+
with:
67+
ref: ${{ github.head_ref }}
68+
69+
- name: PHP setup
70+
uses: shivammathur/setup-php@v2
71+
with:
72+
php-version: '7.4'
73+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif,
74+
iconv, imagick,fileinfo
75+
coverage: none
76+
77+
- name: Install dependencies
78+
run: composer install
79+
80+
- name: Security advice
81+
run: composer security-advice
82+
83+
- name: Execute PHPUnit tests
84+
run: composer test

.github/workflows/code-analysis.yml

-33
This file was deleted.

.github/workflows/code-style.yml

-16
This file was deleted.

.github/workflows/tests.yml

-41
This file was deleted.

README.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<div align="center">
22
<p><img width="450" src="cover.png" alt="Laravel In-app Purchase cover"></p>
33
<p>
4-
<img alt="Packagist PHP Version Support" src="https://img.shields.io/packagist/php-v/imdhemy/laravel-purchases">
5-
<img src="https://img.shields.io/packagist/v/imdhemy/laravel-purchases.svg?style=flat-square" alt="Latest Version on Packagist">
6-
<img src="https://img.shields.io/packagist/dt/imdhemy/laravel-purchases.svg?style=flat-square" alt="Total Downloads">
7-
<img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/imdhemy/laravel-in-app-purchases">
8-
<a href="https://github.com/imdhemy/laravel-in-app-purchases/actions/workflows/code-style.yml"><img src="https://github.com/imdhemy/laravel-in-app-purchases/actions/workflows/code-style.yml/badge.svg" alt="Code Style:PSR12"></a>
9-
<a href="https://github.com/imdhemy/laravel-in-app-purchases/actions/workflows/tests.yml"><img src="https://github.com/imdhemy/laravel-in-app-purchases/actions/workflows/tests.yml/badge.svg" alt="Tests"></a>
4+
<img alt="Packagist PHP Version Support" src="https://img.shields.io/packagist/php-v/imdhemy/laravel-purchases">
5+
<a href="https://packagist.org/packages/imdhemy/laravel-purchases"><img src="https://img.shields.io/packagist/v/imdhemy/laravel-purchases.svg?style=flat-square"
6+
alt="Latest Version on Packagist"></a>
7+
<a href="https://packagist.org/packages/imdhemy/laravel-purchases/stats"><img src="https://img.shields.io/packagist/dt/imdhemy/laravel-purchases.svg?style=flat-square"
8+
alt="Total Downloads"></a>
9+
<a href="https://github.com/imdhemy/laravel-in-app-purchases/commits/"><img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/imdhemy/laravel-in-app-purchases"></a>
10+
<a href="https://github.com/imdhemy/laravel-in-app-purchases/actions/workflows/ci.yml"><img src="https://github.com/imdhemy/laravel-in-app-purchases/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
1011
</p>
1112
<p> ✅ App Store ✅ Google Play </p>
1213

composer.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@
4040
}
4141
},
4242
"scripts": {
43-
"psalm": "vendor/bin/psalm",
44-
"psalm-info": "vendor/bin/psalm --show-info=true --no-cache",
43+
"psalm": "vendor/bin/psalm --show-info=true --no-cache",
4544
"format": "vendor/bin/php-cs-fixer fix --allow-risky=yes",
4645
"check-style": "vendor/bin/php-cs-fixer fix --dry-run",
47-
"test": "vendor/bin/phpunit --testdox"
46+
"test": "vendor/bin/phpunit --testdox",
47+
"security-advice": "composer update --dry-run roave/security-advisories"
4848
},
4949
"extra": {
5050
"laravel": {

config/liap.php

+77-66
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,85 @@
11
<?php
22

3-
use Imdhemy\Purchases\Events\AppStore\Cancel;
4-
use Imdhemy\Purchases\Events\AppStore\DidChangeRenewalPref;
5-
use Imdhemy\Purchases\Events\AppStore\DidChangeRenewalStatus;
6-
use Imdhemy\Purchases\Events\AppStore\DidFailToRenew;
7-
use Imdhemy\Purchases\Events\AppStore\DidRecover;
8-
use Imdhemy\Purchases\Events\AppStore\DidRenew;
9-
use Imdhemy\Purchases\Events\AppStore\InitialBuy;
10-
use Imdhemy\Purchases\Events\AppStore\InteractiveRenewal;
11-
use Imdhemy\Purchases\Events\AppStore\PriceIncreaseConsent;
12-
use Imdhemy\Purchases\Events\AppStore\Refund;
13-
use Imdhemy\Purchases\Events\AppStore\Revoke;
14-
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionCanceled;
15-
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionDeferred;
16-
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionExpired;
17-
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionInGracePeriod;
18-
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionOnHold;
19-
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionPaused;
20-
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionPauseScheduleChanged;
21-
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionPriceChangeConfirmed;
22-
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionPurchased;
23-
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionRecovered;
24-
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionRenewed;
25-
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionRestarted;
26-
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionRevoked;
27-
283
return [
29-
'routing' => [
30-
'signed' => false,
31-
],
4+
/*
5+
|--------------------------------------------------------------------------
6+
| Routing configuration
7+
|--------------------------------------------------------------------------
8+
|
9+
| This configuration is used to determine the routing behavior of the
10+
| Server notifications handler endpoint.
11+
|
12+
| You can find more information on documentation.
13+
| @see https://imdhemy.com/laravel-iap-docs/docs/get-started/routing
14+
*/
15+
16+
'routing' => [
17+
'signed' => false,
18+
'middleware' => [],
19+
'prefix' => '',
20+
],
21+
22+
/*
23+
|--------------------------------------------------------------------------
24+
| Google Play Default Package name
25+
|--------------------------------------------------------------------------
26+
|
27+
| This value is the default package name used when the package name is not
28+
| provided while verifying the receipts.
29+
|
30+
*/
31+
'google_play_package_name' => env('GOOGLE_PLAY_PACKAGE_NAME', 'com.some.thing'),
32+
33+
/*
34+
|--------------------------------------------------------------------------
35+
| App Store Password
36+
|--------------------------------------------------------------------------
37+
|
38+
| This value is the app-specific share password generated by the app store.
39+
| @see https://imdhemy.com/laravel-iap-docs/docs/credentials/app-store
40+
|
41+
*/
42+
'appstore_password' => env('APPSTORE_PASSWORD', ''),
3243

33-
'google_play_package_name' => env('GOOGLE_PLAY_PACKAGE_NAME', 'com.some.thing'),
44+
/*
45+
|--------------------------------------------------------------------------
46+
| Event Listeners
47+
|--------------------------------------------------------------------------
48+
|
49+
| This configuration is used to determine the event listeners that will be
50+
| registered with the application.
51+
| You can find a list of all available events of the documentation
52+
|
53+
| @see https://imdhemy.com/laravel-iap-docs/docs/server-notifications/event-list
54+
| @see https://imdhemy.com/laravel-iap-docs/docs/get-started/event-listeners
55+
|
56+
*/
57+
'eventListeners' => [
58+
/*
59+
|--------------------------------------------------------------------------
60+
| App Store Events
61+
|--------------------------------------------------------------------------
62+
|
63+
| These event listeners are triggered when a new notification is received from App Store.
64+
| @see https://imdhemy.com/laravel-iap-docs/docs/server-notifications/event-list#app-store-events
65+
|
66+
*/
3467

35-
'appstore_password' => env('APPSTORE_PASSWORD', ''),
68+
/* \Imdhemy\Purchases\Events\AppStore\Cancel::class => [
69+
\App\Listeners\AppStore\Cancel::class,
70+
],*/
3671

37-
'eventListeners' => [
38-
/**
39-
* --------------------------------------------------------
40-
* Google Play Events
41-
* --------------------------------------------------------
42-
*/
43-
SubscriptionPurchased::class => [],
44-
SubscriptionRenewed::class => [],
45-
SubscriptionInGracePeriod::class => [],
46-
SubscriptionExpired::class => [],
47-
SubscriptionCanceled::class => [],
48-
SubscriptionPaused::class => [],
49-
SubscriptionRestarted::class => [],
50-
SubscriptionDeferred::class => [],
51-
SubscriptionRevoked::class => [],
52-
SubscriptionOnHold::class => [],
53-
SubscriptionRecovered::class => [],
54-
SubscriptionPauseScheduleChanged::class => [],
55-
SubscriptionPriceChangeConfirmed::class => [],
72+
/*
73+
|--------------------------------------------------------------------------
74+
| Google Play Events
75+
|--------------------------------------------------------------------------
76+
|
77+
| These event listeners are triggered when a new notification is received from Google Play
78+
| @see @see https://imdhemy.com/laravel-iap-docs/docs/server-notifications/event-list#google-play-events
79+
*/
5680

57-
/**
58-
* --------------------------------------------------------
59-
* App Store Events
60-
* --------------------------------------------------------
61-
*/
62-
Cancel::class => [],
63-
DidChangeRenewalPref::class => [],
64-
DidChangeRenewalStatus::class => [],
65-
DidFailToRenew::class => [],
66-
DidRecover::class => [],
67-
DidRenew::class => [],
68-
InitialBuy::class => [],
69-
InteractiveRenewal::class => [],
70-
PriceIncreaseConsent::class => [],
71-
Refund::class => [],
72-
Revoke::class => [],
73-
],
81+
/* \Imdhemy\Purchases\Events\GooglePlay\SubscriptionRecovered::class => [
82+
\App\Listeners\GooglePlay\SubscriptionRecovered::class,
83+
],*/
84+
],
7485
];

0 commit comments

Comments
 (0)