GithubHelp home page GithubHelp logo

php-passbook's People

Contributors

akadko avatar arsonik avatar chapsuk avatar dzamir avatar eymengunay avatar g- avatar hervehobbes avatar ioliva avatar jeroenmoonen avatar johnjohndoe avatar kix avatar krogla avatar mahemrai avatar omoon avatar pedrosancao avatar razvanphp avatar stloyd avatar swey avatar timucingelici avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-passbook's Issues

Couldn't read signature file.

Hi, I get this error, someone can help me? what could be the problem?

For the p12 certificate, I have use the production certificate of the Pass Type ID, on the read me of the project instead, it's write to use the iPhone Developer Certificate, what I have to use?

Localizations break when values/keys contain quotes

Given this:

use Passbook\Pass\Localization;
$localization = new Localization('en');
$localization->addStrings([
    'SOME_FIELD' => 'This "has" "quotes"',
]);

...the expected en.lproj/pass.strings is supposed to have this line:

"SOME_FIELD" = "This \"has \"quotes\"";

...yet the quotes are ignored and the pass.strings file gets malformed, which, in turn, makes a part of the translations invalid:

"SOME_FIELD" = "This "has "quotes"";
"SOME_OTHER_FIELD"="Test test";

If I had some of the fields after this faulty one, those would be broken too. I suggest adding an addslashes() call somewhere, for example in the Localization#getStringsFileOutput() method.

Date/Time formats

Hi !
Thanks for this great project.

One question, how can we set timeStyle and other datetime relative specifiers for a field ?

Brest regards,
Benoit

Help please

All works good , but i have 1 issue , when i creating new pkpass, my file have strange srtucture , pkpassname and path folders.
With this structure , mac can't open this passbook
Help me please.
Thanks.

Slashing on Windows for Zip issue

Hey, just wanted to let you know that i found an issue for windows.

PassFactory seems to have a problem in the zip() function at Line 362 where the slashes for UNIX are brought in the right direction. But for Windows this causes an issue.

So i added $file = str_replace('', '/', $file); directly after this line, to solve this issue.

Im not sure how to add a pull request. So this is how im letting you know.

method setMaxDistance need DateTime

In the Pass class, i can't set the max distance. I don't understand why max distance needs to be DateTime.

Thanks.

    /**
     * {@inheritdoc}
     */
    public function setMaxDistance(\DateTime $maxDistance)
    {
        $this->maxDistance = $maxDistance;
        return $this;
    }

dev-master disappeared from packagist

Since this morning dev-master disappeared from packagist.

Maybe there was a commit hook problem at 3dda48d commit or packagist was down?

$ ~/bin/composer show eo/passbook --all
name     : eo/passbook                                                                                                          
descrip. : iOS Passbook for PHP
keywords : mobile, ios, passbook, pass, wallet, coupons, tickets
versions : v1.2.1, v1.2.0, v1.1.3, v1.1.2, v1.1.1, v1.1.0, v1.0.1, v1.0.0
type     : library
license  : MIT License (MIT) (OSI approved) https://spdx.org/licenses/MIT.html#licenseText
source   : [git] https://github.com/eymengunay/php-passbook.git 7f7be28fa637fdddd122f7d9124443c46e9bf46e
dist     : [zip] https://api.github.com/repos/eymengunay/php-passbook/zipball/7f7be28fa637fdddd122f7d9124443c46e9bf46e 7f7be28fa637fdddd122f7d9124443c46e9bf46e
names    : eo/passbook

autoload
psr-0
Passbook\ => src/

requires
php >=5.3.6
ext-zip *
ext-openssl *

requires (dev)
phpunit/phpunit 3.7.*

Possible without composer?

Dumb question, might be... but is it possible just to user php-passbook without composer?
I would like to use it in my backend.
When including and testing around I keep getting the error;
Fatal error: Class 'Passbook\Type\EventTicket' not found...

Problem "Call to undefined method Image::getExtension()"

Hi,

I'm trying to use your php-passbook library but I keep having the error :

Fatal error: Call to undefined method Passbook\Pass\Image::getExtension() in /var/www/XXXPassbook/PassFactory.php on line 173

while calling "$factory->package( $pass );"

I tried using the sample code on the homepage.

Cannot add pass to wallet

Hi! thanks for the library! I face a small problem. when i create a pass i can open it from osx, android but when i try to download it from safari i cannot simple import it to ios(9) wallet. The ios promt opens and ask me to choose an app to open the file.

I have check the AppleWWDRCA.pem, i download the file from https connection... , i have try ios simulator is assertion failed: 15A278b 13E230: assertiond

Any idea?

Apple Developer Program

Hi!

Do I need to enroll in the Apple Developer Program to be able to create Passbook / Wallet passes?

Problem with generated zip

HI!
The pkpass file doesn't work at iphone devices. When the file is downloaded by Safary, it is showed this error: "Safari cannot download this file". I am testing with simulator of xcode and show the next logs:

Jun 23 18:06:41 iMac MobileSafari[646]: BOM could not extract archive: Couldn't read PKZip signature
Jun 23 18:06:41 --- last message repeated 1 time ---
Jun 23 18:06:41 iMac MobileSafari[646]: PassBook Pass download failed: The pass cannot be read because it isn’t valid.

I have generated the p12 file like you say at https://github.com/eymengunay/php-passbook#p12-certificate.

Finally, I can install the pkpass at Android devices.

I hope that you can help me.

Thank you!

need help

i m new in development
i install passbook library in cakephp using composer
i add the example code in passbook.php file in src/Passbook folder and include the file in my controller

< ? p h p
require '../../autoload.php';
use Passbook\Pass\Field;
use Passbook\Pass\Image;
use #Passbook\PassFactory;
use Passbook\Pass\Barcode;
use Passbook\Pass\Structure;
use Passbook\Type\EventTicket;

// Set these constants with your values

define('P12_FILE', '/cer/HTViOSPassKitP12File.p12');
define('P12_PASSWORD', '123456789');
define('WWDR_FILE', '/cer/wdrc.pem');
define('PASS_TYPE_IDENTIFIER', 'pass.com.htvi.os');
define('TEAM_IDENTIFIER', '26V2Q4KMYM');
define('ORGANIZATION_NAME', 'NEWSPAPER AGENCY COMPANY LLC');
define('OUTPUT_PATH', '/cer/coupon');
define('ICON_FILE', '/cer/book.png');

here is the passbook.php code
when i run the function it show

page isn’t working
HTTP ERROR 500

please help me

after update to v 2.0 getting passcode malformed

$logo = new Image(LOGO_FILE, 'logo');
$pass->addImage($logo);

hello, reaally need your help
i am adding a logo image as above as you suggested in example and the pass can not be read in applewallet anymore since upgraded to v.2.0
not really sure what am I doing wrong
if i skipp adding logo and just add an icon image passcode ia working just fine in v 2.0

outputpath folder packed into .pkpass

PHP 5.4.24 Cli
Using the Usage Example for testing,
signpass -v verify the signature, but pkpass cannot add into passbook(iOS7.0.4),
and I found outputpath/passsn/. in the zip file...

the unpacked tree is like this (114567890 is the pass serialNumber)

├── manifest.json
├── output
│   └── 114567890 (folder as well)
├── pass.json
└── signature

Could not find why.

Line break

I am having trouble adding a line break on the BackField. I have tried \r\n and \n but this is included in the pass as text. I saw in the Apple documentation that they were using \n. Do you handle that different?

backFields

Hi!

Is it possible to use backFields? (Add data to the back side of pass)

wrong webservice url key name

In Pass.php file Line 156, key name for webservice URL is

* @SerializedName(value="webServiceUrl")

However the correct name should be webServiceURL , URL is capitalised! It really drive me crazy for a few days:)

writing signature and Certificate Error

This error was initially reported in PassbookBundle by @Numerah. Moving it here as the bug is caused by this library.

eymengunay/PassbookBundle#3

i have generated the passbook application and when i generate passes they are working on every possible device (android ,mac) but IOS 7 iphones and above
when i check iPhone utility manager it was giving me this error: Invalid data error reading pass: The passTypeIdentifier or teamIdentifier provided may not match your certificate, or the certificate trust chain could not be verified. i have my generated certificates and i have seen green sign on the certificates and in my key chain access they are mentioned as verified certificates. there must be a mistake in writing signature or else kindly put some light on this error

Can't save pkpass on iOS 8

Hi.

I trying to run the passbook sample demo, and I don't have problems to generate the .pkpass file... but I can't open it in iOS 8.3...

A question... Have I to export the Private Key of iPhone Development Cert, or the iPhone Distribution Cert?

And the TEAM, is the TEAM of Distribution, or the Development?

Now, I'm using the .P12 of the Private Key of the iPhone Distribution Cert, and the same for the TEAM ID (Distribution Cert).

Anybody can help me?

Thanks!

Problems with mkdir()

Hi!

I am getting the following error:

ErrorException in PassFactory.php line 159:
mkdir(): Permission denied

I have checked that the owner of the folder is the same as executes PHP.

How to fix this?

Associated Store Identifiers

I have not managed to use correctly the 'associatedStoreIdentifiers' attribute of the Pass class with current version of the code.
I used this line of code:
$pass->addAssociatedStoreIdentifier(585027354);
The number 85027354 is the adam id of Google Maps.
Thing is that this attribute is not in the list of properties in the toArray() function of the same class, so when the pkpass is created, the associatedStoreIdentifers aren't in the JSON of the pass.

I added two lines in the toArray() function to make it work: after the foreach, i added:
if(count($this->associatedStoreIdentifiers) != 0)
$array['associatedStoreIdentifiers'] = $this->associatedStoreIdentifiers;
And now it works perfectly, i see the GoogleMaps link at the back of the pass.

Not sure if i'm doing it wrong or if there is an issue.

Image format

AFAIK only PNG images are allowed in pkpass files.

I was using this library and I tried to add JPG images but were not showed up. The library should throw an exception if non PNG image is added. Do you agree ? I've already a draft for this I can send a PR

Project Depends on Third Party Libraries

PassFactory has dependencies that rely on functionality that is not required for the project. Not everybody uses Symphony for their framework, or composure, for their projects. Composure not a big deal, but if third party libraries are going to referenced, they should be included in the project. Same goes for references to JMS\Serializer.

Coupon type passes must show secondary and auxiliary fields in one row?

in any other type it is ok to show secondary and auxiliary fields in different rows but in coupon type 2 secondary and 2 auxiliary must be allowed which i implemented already. but they are showing in different rows just like every other type of pass. they must list in one row like this
secondaryauxiliary

remove from lockScreen using relevantDate

Hi,
If I add a relevantDate for an event ticket, I can see it at the relevantDate in the lock screen, but remain there and doesn't go away, the only way to remove it from the lock screen is to remove the passbook from the Wallet or uncheck the lock screen option for that passbook. Anyone knows if there is an expiry date and remove it automatically?

Open Passbook on Android app

Hi,
I can add the Passbook on iOS, but when I'm trying to add it on an Android App like Pass2U the Passbook is black I can see only the barcode, instead if I open it on another Android app like PassWallet give me an error that can't open it. There a fix? someone know this problem?

Problem with standard example

Hello to all,

I followed the instruction (composer, example, ...)
But when i test my script with phpunit always i get stucked with this error.

`PHP Fatal error: Uncaught Error: Class 'Passbook\Type\EventTicket' not found in /var/www/html/webapp/passbook.php:25
Stack trace:
#0 /usr/share/php/PHPUnit/Util/Fileloader.php(56): include_once()
#1 /usr/share/php/PHPUnit/Util/Fileloader.php(38): PHPUnit_Util_Fileloader::load('/var/www/html/w...')
#2 /usr/share/php/PHPUnit/Runner/StandardTestSuiteLoader.php(39): PHPUnit_Util_Fileloader::checkAndLoad('/var/www/html/w...')
#3 /usr/share/php/PHPUnit/Runner/BaseTestRunner.php(124): PHPUnit_Runner_StandardTestSuiteLoader->load('passbook', '/var/www/html/w...')
#4 /usr/share/php/PHPUnit/Runner/BaseTestRunner.php(65): PHPUnit_Runner_BaseTestRunner->loadSuiteClass('passbook', '/var/www/html/w...')
#5 /usr/share/php/PHPUnit/TextUI/Command.php(128): PHPUnit_Runner_BaseTestRunner->getTest('passbook', '/var/www/html/w...', Array)
#6 /usr/share/php/PHPUnit/TextUI/Command.php(106): PHPUnit_TextUI_Command->run(Array, true)
#7 /usr/bin/phpunit(29): PHPUnit_TextUI_Command::main()
#8 {main}

thrown in /var/www/html/webapp/passbook.php on line 25
`

my folder structure is

  • passbook.php
  • src
    --- Passbook
    ------ ...
  • vendor

i think there are problem with composer or autoload, but i can't figure how to solve it! Any suggestion?
Thank you!

Folder structure in pass

Hi there, the zipped pass contains the full folder structure.
Taking the Line 208 (" $zip->addFile($passDir);" ) out in PassFactory.php makes it better. Do I do sth wrong?

Thanks for the work! Rly great Framework!

Possible problem with NumberField generation using CurrencyCode

We have noticed that generating a StoreCard using NumberField to inform the amount does not show anything if you set the curredncy code (NumberField::setCurrencyCode())

In order to solving this issue we had to override this function forcing an integer casting return:

/**
* @return int
*/
public function getValue()
{
return (int)parent::getValue();
}

Relevance Information: Displaying Passes on the Lock Screen

I need to be able to add relevant locations to the passbook file. How do you propose I go about doing this?
This is what the JSON will look like

{
    ...
    "description" : "Example pass showing relevance information",

    "locations" : [

        {"latitude" : 37.3229, "longitude" : -122.0323},

        {"latitude" : 37.3286, "longitude" : -122.0143},

        {

            "altitude" : 10.0,

            "latitude" : 37.331,

            "longitude" : -122.029,

            "relevantText" : "Store nearby on 3rd and Main."

        }

    ],

    "relevantDate" : "2014-12-05T09:00-08:00"

}

how to set transit type of Boarding Pass ?

i Tried like hell to find how to set transit for boarding pass . i am almost done with my complete pass generation of any type i.e. Coupon ,Generic,Store Card,Boarding Pass, Event Ticket. almost set every property of every coupon. i saw this code in Boarding pass type

protected $transitType;

/**

  • @var string
    */
    const TYPE_AIR = 'PKTransitTypeAir';

/**

  • @var string
    */
    const TYPE_BOAT = 'PKTransitTypeBoat';

/**

  • @var string
    */
    const TYPE_BUS = 'PKTransitTypeBus';

/**

  • @var string
    */
    const TYPE_GENERIC = 'PKTransitTypeGeneric';

/**

  • @var string
    */
    const TYPE_TRAIN = 'PKTransitTypeTrain';

/**

  • Class constructor
    *
  • @param string $serialNumber
  • @param string $description
  • @param string $transitType
    */
    public function __construct($serialNumber, $description, $transitType = self::TYPE_GENERIC)
    {
    // Required for boarding passes; otherwise not allowed
    $this->transitType = $transitType;
    // Call parent
    parent::__construct($serialNumber, $description);
    }

public function toArray()
{
$array = parent::toArray();
$array['transitType'] = $this->transitType;

return $array;

}
and i tried to set the pass configurations like every other

$pass = new BoardingPass("12345", "Template Name",'PKTransitTypeAir');

i also tried this

$pass = new BoardingPass("12345",'PKTransitTypeAir', "Template Name");

but no transit appear in my generated pass.

Support for 3x images

Apple docs say that all PNG assets in a pass can now include 3x versions alongside the 2x.

It would be good if the library could support adding these assets to the pass (maybe replace isRetina in the Image class with a density property which equals 1, 2 or 3)

Couldn't write signature file

i was facing this error from the beginning of my development and it generates the folder instead of .pkpass file and didnt sign the pass. initially it looked like openssl problem. after 3 months i finally found the solution its the PHP_EOL content which is causing problem in windows. kindly remove it as there is no need of this in signature but decoration . i remove this end of line content and it is working perfectly fine on my windows. but when i will update my project packages it will overwrite automatically. kindly resolve this or tell us any alternative in windows.

it lies
https://github.com/eymengunay/php-passbook/blob/master/src/Passbook/PassFactory.php

in line 201 and 202

Composer namespace

Hello,
as you've added composer support in 0dc19c2, you defined the autoload as

"autoload": {
        "psr-0": { "PHP-Passbook\\": "src/" }
}

According to the documentation, I believe that would register everything under src into PHP-Passbook namespace (http://getcomposer.org/doc/01-basic-usage.md#autoloading). However, that is neither a valid namespace name nor actually the namespace declared in Passbook.php.

Could you please either change the namespace in both the manifest and the library or autoload using

"autoload": {
    "files": ["src/Passbook.php"]
}

Thanks

ps or just decide what you like more, I'll send the pull request

Usage example

Would be great with a usage example to create, say a Ticket. From generation to outputting to user.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.