tschoffelen / php-pkpass

💳 PHP class for creating passes for Wallet on iOS.
https://includable.com
MIT License
916 stars 187 forks source link

card not worked #94

Closed RustamKakhramanov closed 5 years ago

RustamKakhramanov commented 5 years ago

I'm trying to make my map using this repo. When creating a map, the iPhone cannot download the map, but the Mac says "could not open the map. Here is a link to the created file https://drive.google.com/open?id=1Ebrqwuu32sc6TMCyfUmB7nsUwQgkXH5F

setlocale(LC_MONETARY, 'en_US');

// Variables $id = rand(100000, 999999) . '-' . rand(100, 999) . '-' . rand(100, 999); // Every card should have a unique serialNumber $balance = '$' . rand(0, 30) . '.' . rand(10, 99); // Create random balance $name = stripslashes($_POST['name']);

// Create pass // Set the path to your Pass Certificate (.p12 file) $pass = new PKPass('ccc.p12', 'QazWsx12'); $pass->setData('{ "passTypeIdentifier": "pass.com.test.discountWallet", "formatVersion": 1, "organizationName": "Maxim Gizzatullin", "teamIdentifier": "YW3A55PBT7", "serialNumber": "' . $id . '", "backgroundColor": "rgb(240,240,240)", "logoText": "Test", "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 . '"
}
}');

// add files to the PKPass package $pass->addFile('icon.png'); $pass->addFile('icon@2x.png'); $pass->addFile('logo.png'); $pass->addFile('background.png', 'strip.png'); I expect that there will be some kind of mistake. No error.

tschoffelen commented 5 years ago

Hi there, thanks for using the library. Did you try the debugging tips listed in the README?

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.