m1x0n/easy-pnr-api-php

EasyPNR Decoder 的 PHP API 客户端(https://www.easypnr.com)

1.1.0 2019-10-06 12:16 UTC

This package is auto-updated.

Last update: 2024-09-06 23:57:04 UTC


README

PHP API Client for EasyPNR Decoder: https://www.easypnr.com

安装

composer require m1x0n/easy-pnr-api-php

用法

<?php

// Usage example

require_once __DIR__ . '/../vendor/autoload.php';

// Please make sure that you obtained correct API key
$apiKey = 'YOUR API KEY HERE';

// Prepare your PNR data. See encoded.txt for more information
$pnrSample = file_get_contents(__DIR__ . '/../tests/fixtures/encoded.txt');

// You can create client in two ways
// 1. Via constructor:
$client = new EasyPNR\Client($apiKey);

// 2. Via factory method:
$client = EasyPNR\Client::withApiKey($apiKey);

// This should respond with pong and timestamp string
$pingResponse = $client->ping();

// This should respond with decoded array structure
// See decoded.json fixture for more information
$decoded = $client->decode($pnrSample);

文档

您可以在以下位置找到最新文档: http://docs.easypnr.com/api/v3/

关于乘客姓名记录(PNR)的更多信息,请参阅 wiki