Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI

on:
push:
pull_request:

jobs:
tests:
name: "PHP ${{ matrix.php }}"
runs-on: ubuntu-latest
strategy:
matrix:
php: ["8.4", "8.5"]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none

- name: Install dependencies
run: composer install --prefer-dist --no-interaction

- name: Run tests
run: vendor/bin/phpunit
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Composer
/vendor/

# PHPUnit
.phpunit.cache/
.phpunit.result.cache

# Coverage & reports
/coverage/
clover.xml
coverage.xml
*.cov

# Environment & secrets
.env
.env.*
!.env.example

# IDE & editors
.idea/
.vscode/
*.swp
*.swo
*~

# OS
.DS_Store
Thumbs.db

# Logs & temp
*.log
*.tmp
*.temp
37 changes: 37 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# AGENTS.md

## Project facts

- Language: PHP
- Package type: Composer library
- Minimum runtime: PHP 8.4 (`composer.json` has `"php": "^8.4"`)
- HTTP client dependency: `guzzlehttp/guzzle ^7.0`
- Test framework: PHPUnit `^11.0`

## Before making changes

- Read `composer.json` and `README.md` first for current constraints.
- Prefer minimal, targeted edits over broad refactors.
- Keep public API behavior stable unless explicitly asked to change it.

## Key conventions and gotchas

- Service classes are exposed through `TransferWise\Factory\ServiceFactory`.
- Keep PSR-4 class/file mapping exact (`TransferWise\\...` maps to `src/...`).
- Example: `TransferWise\Service\ProfileWebhookService` must live in `src/Service/ProfileWebhookService.php`.
- `TransferWise\Client` uses `request(...)` for HTTP calls. Do not introduce `require(...)`.
- Avoid deprecated reflection patterns on PHP 8.5 (e.g. `ReflectionProperty::setAccessible()` in tests).

## Testing and verification

- Install deps: `composer install`
- Run tests: `vendor/bin/phpunit`
- CI runs tests on PHP 8.4 and 8.5 (`.github/workflows/ci.yml`).
- If you touch runtime logic, add/update unit tests in `tests/`.

## Repo hygiene

- Do not commit secrets (`.env`, tokens, credentials).
- Respect `.gitignore` (especially `vendor/`, PHPUnit cache, editor files).
- Do not edit generated dependency internals directly under `vendor/`.

32 changes: 22 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,37 @@
# Wise php
# Wise PHP

This library is written to accomodate the wise API's use in php projects
With Wise you can automate payments, connect your business tools, and create ways to manage your finances.
You can also power your cross-border and domestic payouts. For more info have a look at https://wise.com/ and https://api-docs.wise.com/
This library is written to accommodate the Wise API in PHP projects.
With Wise you can automate payments, connect business tools, and manage finances.
You can also power cross-border and domestic payouts.
For more information, see https://wise.com/ and https://api-docs.wise.com/

## Requirements

- PHP 5.6.0 and later.
- PHP 8.4 or later.
- guzzlehttp/guzzle ^7.0
- cURL

## Install

To install the package use the composer command
To install the package, run:
```
composer require transferwise/wise-php
```

## Development and tests

Install dependencies:
```bash
composer install
```

Run the test suite:
```bash
vendor/bin/phpunit
```

CI runs this suite against PHP 8.4 and 8.5 on each push and pull request.

## Sample Code

### Initialing Client
Expand Down Expand Up @@ -148,7 +164,3 @@ $client->profiles->directors();
$client->profiles->addDirector();
$client->profiles->addIdentificationDocument();
```

##### The documentation is a work in progress and will be updated with more details of to use each resource together with a guideline and examples


13 changes: 8 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
"description": "Wise PHP Library",
"type": "library",
"require": {
"guzzlehttp/guzzle": ">=6.3",
"php": ">=5.6.0"
"php": "^8.4",
"guzzlehttp/guzzle": "^7.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5"
"phpunit/phpunit": "^11.0"
},
"minimum-stability": "dev",
"prefer-stable": true,
"license": "MIT",
"authors": [
{
Expand All @@ -22,5 +20,10 @@
"psr-4": {
"TransferWise\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"TransferWise\\Tests\\": "tests/"
}
}
}
Loading