Skip to content

v1.0.0-alpha.2

Pre-release
Pre-release

Choose a tag to compare

@loevgaard loevgaard released this 06 Aug 07:57
· 25 commits to 1.x since this release
12a4a7e

What's new

Client-wide default for the synchronized operation flag (#1)

The payment operation methods (authorize / capture / refund / cancel) now take ?bool $synchronized = null. When null (the default) they fall back to a new synchronized flag on the Client constructor, so integrations that always want to wait for the completed transaction set it once instead of repeating it on every call — a non-null per-call argument still overrides the default:

$client = new Client('YOUR_API_KEY', synchronized: true);

$client->payments()->capture($id, new CaptureRequest(1000)); // waits (client default)
$client->payments()->refund($id, new RefundRequest(250), synchronized: false); // per-call override

The default is exposed as ClientInterface::isSynchronized(). Behavior is unchanged for existing code.

BC note

ClientInterface gained the isSynchronized() method — custom implementations or decorators of that interface must add it. Code using Client directly is unaffected.

Full changelog: v1.0.0-alpha.1...v1.0.0-alpha.2