admin管理员组文章数量:1357391
I'm using library chiiya/passes to generate membership cards for my project. The github page has an example to create a generic object but, maybe I'm wrong, some information is missing.
$object = new GenericObject(
cardTitle: LocalizedString::make('en', '::cardTitle::'),
header: LocalizedString::make('en', '::header::'),
subheader: LocalizedString::make('en', '::subheader::'),
logo: Image::make('.png'),
hexBackgroundColor: '#333',
notifications: new Notifications(
upcomingNotification: new UpcomingNotification(
enableNotification: true
),
),
classId: '1234567890123456789.generic-object',
id: '1234567890123456789.'.Str::uuid()->toString(),
heroImage: Image::make('.png'),
state: State::ACTIVE,
barcode: new Barcode(
type: BarcodeType::QR_CODE,
value: '1464194291627',
renderEncoding: BarcodeRenderEncoding::UTF_8,
),
validTimeInterval: new TimeInterval(
start: new DateTime(date: now()),
end: new DateTime(date: now()->addMonth())
),
textModulesData: [
new TextModuleData(
header: 'label-1',
body: 'value-1',
id: 'key-1',
),
new TextModuleData(
header: 'label-2',
body: 'value-2',
id: 'key-2',
)
],
groupingInfo: new GroupingInfo(
groupingId: 'group1'
)
);
$jwt = (new JWT(
iss: $credentials->client_email,
key: $credentials->private_key,
origins: [''],
))->addGenericObject($object)->sign();
Once the object has been created and signed using the credentials, how is it sent to Google so the pass is created and how do I offer the user the "Add to Google Wallet" button. I've seen somewhere that I need an id of the object but I haven't been able to find how to do that.
I've already created the generic class in the Google Wallet website.
Is there someone who has used this library, or similars, able to give me a hint?
Thanks
本文标签: phpGoogle Wallet How to create generic pass objectStack Overflow
版权声明:本文标题:php - Google Wallet: How to create generic pass object - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744078487a2587189.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论