Getting Error
Error: Invalid certificate file. Make sure you have a P12 certificate that also contains a private key, and you have specified the correct password!
Certificate was created as told. Exported both (certificate and its private key) but still getting the same error
Steps to Reproduce the Problem
Code in Laravel.
<?php
namespace App\Http\Controllers;
use PKPass\PKPass;
require('../vendor/autoload.php');
use Illuminate\Http\Request;
Expected Behavior
Should accept certificate
Actual Behavior
Getting Error Error: Invalid certificate file. Make sure you have a P12 certificate that also contains a private key, and you have specified the correct password! Certificate was created as told. Exported both (certificate and its private key) but still getting the same error
Steps to Reproduce the Problem
Code in Laravel. <?php
namespace App\Http\Controllers; use PKPass\PKPass;
require('../vendor/autoload.php'); use Illuminate\Http\Request;
class ControllerApplePay extends Controller { public function ApplePay(){ // Replace the parameters below with the path to your .p12 certificate and the certificate password! $pass = new PKPass('../Certificates.p12', '*****'); dd($pass); // Pass content $data = [ 'description' => 'Demo pass', 'formatVersion' => 1, 'organizationName' => 'Flight Express', 'passTypeIdentifier' => 'pass.org.****.applepay', 'serialNumber' => '**', 'teamIdentifier' => '****', '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', ], 'backgroundColor' => 'rgb(32,110,247)', 'logoText' => 'Flight info', 'relevantDate' => date('Y-m-d\TH:i:sP') ]; $pass->setData($data);
} }