All notable changes to passes
will be documented in this file.
- Replaced deprecated
spatie/data-transfer-object
withantwerpes/data-transfer-object
Replacing the package required several minor breaking changes:
In case you were manually matching and handling error messages (e.g. validation), these have now changed.
While not encouraged before, it was possible to pass an array as the only constructor argument to all classes. This is no longer possible. Use either the ::decode($array)
function or named parameters:
// Before
$pass = new Coupon([
'description' => '15% off purchases',
'organizationName' => 'ACME',
'passTypeIdentifier' => 'pass.acme.wallet',
'serialNumber' => '1464194291627',
'headerFields' => [
['key' => 'coupon-type', 'value' => '#15-percent']
],
]);
// After
$pass = new Coupon(
description: '15% off purchases',
organizationName: 'ACME',
passTypeIdentifier: 'pass.acme.wallet',
serialNumber: '1464194291627',
teamIdentifier: '123456789',
headerFields: [
new SecondaryField(key: 'coupon-type', value: "#15-percent"),
],
);
// Or alternatively
$pass = Coupon::decode([
'description' => '15% off purchases',
'organizationName' => 'ACME',
'passTypeIdentifier' => 'pass.acme.wallet',
'serialNumber' => '1464194291627',
'headerFields' => [
['key' => 'coupon-type', 'value' => '#15-percent']
],
]);
Important: The only documented example was the JWT
class, for which this behavior has also changed:
// Before
$jwt = (new JWT([
'iss' => $credentials->client_email,
'key' => $credentials->private_key,
'origins' => ['https://example.org'],
]))->addOfferObject($object)->sign();
// After
$jwt = (new JWT(
iss: $credentials->client_email,
key: $credentials->private_key,
origins: ['https://example.org'],
))->addOfferObject($object)->sign();
Casts are no longer applied when the constructor is executed, but only during the encode()
oder decode()
functions. In practice that means that:
- You can still pass
DateTime
objects to date fields, they will be casted to string when encoded and serialized, just as before. - Legacy values are only casted when decoding responses from Google, not when you supply legacy values to the constructor. This may lead to errors if you're still using legacy values in your application.
use Chiiya\Passes\Google\Enumerators\Offer\RedemptionChannel;
// Before, this used to work
$class = new OfferClass(
redemptionChannel: 'instore',
);
// Now should use valid values
$class = new OfferClass(
redemptionChannel: RedemptionChannel::INSTORE,
);
Full Changelog: https://github.com/chiiya/passes/compare/0.6.0...1.0.0
- Fix google example generic broken url by @skrskr in chiiya#32
- Use match expressions in mapLegacyValues by @kauhat in chiiya#31
- Resolve phpcsfixer warnings by @Jeroenwv in chiiya#29
- Bump actions/checkout from 3 to 4 by @dependabot in chiiya#21
- Bump stefanzweifel/git-auto-commit-action from 4 to 5 by @dependabot in chiiya#23
- Remove empty values before encoding by @Synchro in chiiya#25
- Add support for the genericType field by @Synchro in chiiya#26
- Add support for wide logo images by @Synchro in chiiya#27
- @skrskr made their first contribution in chiiya#32
- @kauhat made their first contribution in chiiya#31
- @Jeroenwv made their first contribution in chiiya#29
Full Changelog: https://github.com/chiiya/passes/compare/0.5.0...0.6.0
- Bump dependabot/fetch-metadata from 1.3.6 to 1.4.0 by @dependabot in chiiya#16
- Bump dependabot/fetch-metadata from 1.4.0 to 1.5.1 by @dependabot in chiiya#17
- Bump dependabot/fetch-metadata from 1.5.1 to 1.6.0 by @dependabot in chiiya#18
- Implement a workaround for compatibility with legacy openssl pkcs12 files by @Synchro in chiiya#19
- @Synchro made their first contribution in chiiya#19
Full Changelog: https://github.com/chiiya/passes/compare/0.4.0...0.5.0
- Add Google GenericPass functionality by @kerattila in chiiya#14
Full Changelog: https://github.com/chiiya/passes/compare/0.3.1...0.4.0
- Add GroupingInfo->groupingId as per docs by @kerattila in chiiya#11
- @kerattila made their first contribution in chiiya#11
Full Changelog: https://github.com/chiiya/passes/compare/0.3.0...0.3.1
- Fix
classReference
being encoded in Google Pass Object JWTs. - Add methods for creating skinny JWTs for Google Pass Objects (e.g.
addSkinnyOfferObject
), which will only include the object ID. See also https://developers.google.com/pay/passes/guides/introduction/typical-api-flows#skinny-jwt
Full Changelog: https://github.com/chiiya/passes/compare/0.2.6...0.3.0
- Fix missing cache initialization by @pazzernick in chiiya#5
- Use strict typing
- @pazzernick made their first contribution in chiiya#5
Full Changelog: https://github.com/chiiya/passes/compare/0.2.5...0.2.6
- Initial release