Skip to content

Commit b52e315

Browse files
committed
Initial commit
0 parents  commit b52e315

File tree

468 files changed

+28830
-0
lines changed

Some content is hidden

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

468 files changed

+28830
-0
lines changed

.gitattributes

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# A list of files and folders those will be excluded from archives and the Composer package.
2+
/.editorconfig export-ignore
3+
/.gitattributes export-ignore
4+
/.github export-ignore
5+
/.php-cs-fixer.php export-ignore
6+
/.vscode export-ignore
7+
/examples export-ignore
8+
/Makefile export-ignore
9+
/phpdoc.dist.xml export-ignore
10+
/phpstan.neon.dist export-ignore
11+
/phpunit.xml export-ignore
12+
/tests export-ignore
13+
/dockerfile export-ignore

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @PaddleHQ/dx

.github/ISSUE_TEMPLATE/bug_report.yml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Bug report
2+
description: Create a bug report to help us improve
3+
labels: ["bug"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for taking the time to fill out this bug report!
9+
- type: textarea
10+
id: description
11+
attributes:
12+
label: Describe the bug
13+
description: Brief description of the bug and its impact.
14+
placeholder: A clear and concise description of what is happening.
15+
validations:
16+
required: true
17+
- type: textarea
18+
id: steps-to-reproduce
19+
attributes:
20+
label: Steps to reproduce
21+
description: Explain the steps to recreate the issue.
22+
placeholder: |
23+
1. Create entity ...
24+
2. Get entity ...
25+
3. See error ...
26+
validations:
27+
required: true
28+
- type: textarea
29+
id: expected-behavior
30+
attributes:
31+
label: Expected behavior
32+
description: A clear and concise description of what you expected to happen.
33+
validations:
34+
required: true
35+
- type: textarea
36+
id: code-snippets
37+
attributes:
38+
label: Code snippets
39+
description: If applicable, add code snippets to help explain your problem.
40+
render: PHP
41+
validations:
42+
required: false
43+
- type: input
44+
id: language-version
45+
attributes:
46+
label: PHP version
47+
placeholder: PHP 8.1
48+
validations:
49+
required: true
50+
- type: input
51+
id: sdk-version
52+
attributes:
53+
label: SDK version
54+
placeholder: paddle-php-sdk 1.20.1
55+
validations:
56+
required: true
57+
- type: input
58+
id: api-version
59+
attributes:
60+
label: API version
61+
description: See [Versioning](https://developer.paddle.com/api-reference/about/versioning) in the API Reference to find which version you're using
62+
placeholder: "Paddle Version 1"
63+
validations:
64+
required: true
65+
- type: textarea
66+
id: additional-context
67+
attributes:
68+
label: Additional context
69+
description: Add any other context about the problem here.
70+
validations:
71+
required: false

.github/ISSUE_TEMPLATE/config.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Paddle support
4+
url: https://www.paddle.com/help
5+
about: |
6+
Please only open issues here that you believe represent actual bugs or feature requests for the Paddle PHP SDK.
7+
8+
For help with the Paddle API or building your integration, contact our support team at [email protected].
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Feature request
2+
description: Suggest a new feature or idea for this SDK
3+
labels: ["feature-request"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for taking the time to fill out this feature request!
9+
- type: textarea
10+
id: description
11+
attributes:
12+
label: Please describe your feature request.
13+
description: A clear and concise description of what the problem is.
14+
placeholder: A clear and concise description of what the problem is.
15+
- type: textarea
16+
id: solution
17+
attributes:
18+
label: Describe your solution.
19+
description: A clear and concise description of what you want to happen.
20+
placeholder: A clear and concise description of what you want to happen.
21+
- type: textarea
22+
id: alternatives
23+
attributes:
24+
label: Describe alternatives you have considered.
25+
description: A clear and concise description of any other options or features you have considered.
26+
placeholder: A clear and concise description of any other options or features you have considered.
27+
- type: textarea
28+
id: context
29+
attributes:
30+
label: Additional context
31+
description: Add any other context about the feature request.
32+
placeholder: Add any other context about the feature request.

.github/dependabot.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "composer"
4+
directory: /
5+
schedule:
6+
interval: "weekly"
7+
day: "wednesday"
8+
time: "08:00"
9+
open-pull-requests-limit: 2
10+
reviewers:
11+
- "@PaddleHQ/dx"
12+
labels:
13+
- "release:patch"

.github/workflows/ci.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types:
9+
- opened
10+
- synchronize
11+
schedule:
12+
- cron: '0 10 * * *'
13+
14+
jobs:
15+
build:
16+
name: "Package stability ${{ matrix.stability }}"
17+
runs-on: ubuntu-latest
18+
19+
strategy:
20+
matrix:
21+
stability: [ 'stable', 'lowest' ]
22+
23+
steps:
24+
- name: Checkout Repo
25+
uses: actions/checkout@v2
26+
27+
- name: Build Container
28+
run: make build
29+
30+
- name: Install Dependencies
31+
run: COMPOSER_STABILITY=${{ matrix.stability }} make install
32+
33+
- name: Run Linter
34+
run: make lint
35+
36+
- name: Run Static Analysis
37+
run: make stan
38+
39+
- name: Run Tests
40+
run: make test

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/vendor
2+
/.phpunit.result.cache
3+
/.phpunit.cache
4+
/.php-cs-fixer.cache
5+
/build
6+
/composer.lock
7+
.DS_Store
8+
phpstan.neon

.php-cs-fixer.php

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use PhpCsFixer\Config;
6+
use PhpCsFixer\Finder;
7+
8+
$finder = Finder::create()
9+
->exclude('vendor')
10+
->in([getcwd()]);
11+
12+
$config = new Config();
13+
14+
return $config->setRules([
15+
'@PSR12' => true,
16+
'@Symfony' => true,
17+
'trailing_comma_in_multiline' => [
18+
'after_heredoc' => true,
19+
'elements' => ['arguments', 'arrays', 'match', 'parameters'],
20+
],
21+
'array_syntax' => ['syntax' => 'short'],
22+
'yoda_style' => [
23+
'equal' => false,
24+
'identical' => false,
25+
'less_and_greater' => false,
26+
],
27+
'declare_strict_types' => true,
28+
'visibility_required' => [
29+
'elements' => ['property', 'method'],
30+
],
31+
'no_superfluous_phpdoc_tags' => true,
32+
'php_unit_method_casing' => [
33+
'case' => 'snake_case',
34+
],
35+
'not_operator_with_successor_space' => true,
36+
'concat_space' => [
37+
'spacing' => 'one',
38+
],
39+
'self_accessor' => true,
40+
])
41+
->setRiskyAllowed(true)
42+
->setFinder($finder);

CHANGELOG.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
> **Important:** While in early access we may introduce breaking changes. Where we can, we'll tag breaking changes in this changelog and communicate ahead of time.
8+
9+
Check our main [developer changelog](https://developer.paddle.com/?utm_source=dx&utm_medium=paddle-php-sdk) for information about changes to the Paddle Billing platform, the Paddle API, and other developer tools.
10+
11+
## dev - 2024-01-10
12+
13+
### Added
14+
15+
- Added `available_payment_methods` to [transaction preview and pricing preview](https://developer.paddle.com/changelog/2023/available-payment-methods?utm_source=dx&utm_medium=paddle-node-sdk)
16+
- Added non-catalog items to [subscriptions](https://developer.paddle.com/changelog/2023/bill-custom-items-one-time-subscription-charge?utm_source=dx&utm_medium=paddle-node-sdk)
17+
- Added non catalog items to [transactions](https://developer.paddle.com/changelog/2023/add-custom-items-transaction?utm_source=dx&utm_medium=paddle-node-sdk)
18+
- Added `on_payment_failure` to [subscriptions](https://developer.paddle.com/changelog/2023/payment-failure-behavior-update-subscription?utm_source=dx&utm_medium=paddle-node-sdk)
19+
20+
### Fixed
21+
22+
- Correctly handle optional `ends_at` for discount under Subscriptions entity.
23+
- Correctly handle optional `resume_at` for scheduled change under Subscriptions entity.
24+
25+
## dev - 2024-01-05
26+
27+
### Added
28+
29+
- Added `reports->list()` to [list reports](https://developer.paddle.com/api-reference/reports/list-reports?utm_source=dx&utm_medium=paddle-php-sdk)
30+
- Added `reports->create()` to [create a new report](https://developer.paddle.com/api-reference/reports/create-report?utm_source=dx&utm_medium=paddle-php-sdk)
31+
- Added `reports->get()` to [get a report](https://developer.paddle.com/api-reference/reports/get-report?utm_source=dx&utm_medium=paddle-php-sdk)
32+
- Added `reports->getReportCsv()` to [get a CSV file for a report](https://developer.paddle.com/api-reference/reports/get-report-csv?utm_source=dx&utm_medium=paddle-php-sdk)
33+
34+
## dev - 2023-12-14
35+
36+
### Added
37+
38+
- Initial early access release. Added support for the most frequently used Paddle Billing entities and API operations. Check the [README](README.md) for more information.

CONTRIBUTING.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Contributing
2+
3+
If you've spotted a problem with this package or have a new feature request please open an issue.
4+
5+
For help with the Paddle API or building your integration, contact our support team at [[email protected]](mailto:[email protected]).

0 commit comments

Comments
 (0)