Пример #1
0
    $pass->setJSON('{ 
	"passTypeIdentifier": "pass.com.apple.test",
	"formatVersion": 1,
	"organizationName": "Flight Express",
	"serialNumber": "123456",
	"teamIdentifier": "AGK5BZEN3E",
	"backgroundColor": "rgb(107,156,196)",
	"logoText": "Flight info",
	"description": "Demo pass",
	"boardingPass": {
        "primaryFields": [
            {
            	"key" : "origin",
            	"label" : "' . $origin_label . '",
            	"value" : "' . $origin . '"
            },
            {
            	"key" : "destination",
            	"label" : "' . $destination_label . '",
            	"value" : "' . $destination . '"
            }
        ],
        "secondaryFields": [
            {
                "key": "gate",
                "label": "Gate",
                "value": "' . $gate . '"
            },
            {
                "key": "date",
                "label": "Departure date",
                "value": "' . $date . '"
            }

        ],
        "backFields": [
            {
                "key": "passenger-name",
                "label": "Passenger",
                "value": "' . $passenger . '"
            }
        ],
        "transitType" : "PKTransitTypeAir"
    },
    "barcode": {
        "format": "PKBarcodeFormatQR",
        "message": "Flight-Gate' . $gate . '-' . $date . '-' . $passenger . '-' . $destination . '",
        "messageEncoding": "iso-8859-1"
    }
    }');
Пример #2
0
$pass->setJSON('{ 
    "passTypeIdentifier": "pass.com.apple.test",
    "formatVersion": 1,
    "organizationName": "Flight Express",
    "serialNumber": "123456",
    "teamIdentifier": "AGK5BZEN3E",
    "backgroundColor": "rgb(107,156,196)",
    "logoText": "Flight info",
    "boardingPass": {
        "primaryFields": [
            {
                "key" : "origin",
            	"label" : "San Francisco",
            	"value" : "SFO"
            },
            {
            	"key" : "destination",
            	"label" : "London",
            	"value" : "LHR"
            }
        ],
        "secondaryFields": [
            {
                "key": "gate",
                "label": "Gate",
                "value": "F12"
            },
            {
                "key": "date",
                "label": "Departure date",
                "value": "07/11/2012 10:22"
            }

        ],
        "backFields": [
            {
                "key": "passenger-name",
                "label": "Passenger",
                "value": "John Appleseed"
            }
        ],
        "transitType" : "PKTransitTypeAir"
    },
    "barcode": {
        "format": "PKBarcodeFormatQR",
        "message": "Flight-GateF12-ID6643679AH7B",
        "messageEncoding": "iso-8859-1"
    }
}');
Пример #3
0
    $pass->setJSON('{
	"passTypeIdentifier": "pass.com.apple.test",
	"formatVersion": 1,
	"organizationName": "Starbucks",
	"teamIdentifier": "AGK5BZEN3E",
	"serialNumber": "' . $id . '",
    "backgroundColor": "rgb(240,240,240)",
	"logoText": "Starbucks",
	"description": "Demo pass",
	"storeCard": {
        "secondaryFields": [
            {
                "key": "balance",
                "label": "BALANCE",
                "value": "' . $balance . '"
            },
            {
                "key": "name",
                "label": "NICKNAME",
                "value": "' . $name . '"
            }

        ],
        "backFields": [
            {
                "key": "id",
                "label": "Card Number",
                "value": "' . $id . '"
            }
        ]
    },
    "barcode": {
        "format": "PKBarcodeFormatPDF417",
        "message": "' . $id . '",
        "messageEncoding": "iso-8859-1",
        "altText": "' . $id . '"
    }
    }');