Skip to content

SeteMares/walletpass-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WalletPass-php

WALLET PASS API enables you to issue mobile wallet passes for Apple Wallet, Google Pay and integrate them into your app or cloud system.

Prerequisites

Your passes for Apple Wallet must be cryptographically signed with a certificate from your Apple Developer Account. To obtain your pass signing certificate follow the following:

  1. Access your Apple Developer account.
  2. In Certificates, Identifiers & Profiles, select Identifiers.
  3. Under Identifiers, select Pass Type IDs.
  4. Select the pass type identifier, then click Edit. If there is a certificate listed under Production Certificates, click the Download button next to it. If there are no certificates listed, click the Create Certificate button, then follow the instructions to create a pass signing certificate.
  5. You can get CSR from /certificates/csr endpoint.
  6. Upload obtained certificate to /certificates/upload endpoint.
  • API version: 1.0

Requirements

PHP 7.2 and later

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/setemares/walletpass-php.git"
    }
  ],
  "require": {
    "setemares/walletpass-php": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

require_once('/path/to/walletpass-php/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once __DIR__ . '/vendor/autoload.php';
use WalletPassJP\Configuration;
use WalletPassJP\Client;

$key = 'YOUR_API_KEY';
$config = (new Configuration())->setEndpoint('https://walletpass.jp/api/v1');

$apiInstance = new Client(
    $key,
    // config is optional
    $config,
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);

$asset_id = 'asset id';

try {
    $result = $apiInstance->assets()->show($asset_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AssetsApi->show: ', $e->getMessage(), PHP_EOL;
}

$limit = 15; // int | Records imit
$page = 1; // int | Page number
$tags = []; // string[] | Filter by tags

try {
    $result = $apiInstance->assets()->list($limit, $page, $tags);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AssetsApi->list: ', $e->getMessage(), PHP_EOL;
}

$asset_id = 'asset id'; // Asset ID
$body = new \WalletPassJP\Model\Body1(); // \WalletPassJP\Model\Body1 |

try {
    $apiInstance->assets()->update($asset_id, $body);
} catch (Exception $e) {
    echo 'Exception when calling AssetsApi->update: ', $e->getMessage(), PHP_EOL;
}
?>

Documentation for API Endpoints

All URIs are relative to https://walletpass.jp/api/v1

Class Method HTTP request Description
AssetsApi deleteAsset DELETE /assets/{asset} Delete Asset
AssetsApi getAssetByID GET /assets/{asset} Get Asset by ID
AssetsApi listAssets GET /assets Get all assets
AssetsApi updateAsset PATCH /assets/{asset} Update Asset
AssetsApi uploadAsset POST /assets Upload an asset
ProjectsApi createProject POST /projects Create new Project
ProjectsApi deleteProject DELETE /projects/{project} Delete Project
ProjectsApi getProjectByID GET /projects/{project} Get Project
ProjectsApi listProjects GET /projects Get a list of created Projects
ProjectsApi updateProject PATCH /projects/{project} Update Project
CertificatesApi deleteCertificate DELETE /certificates/{certificate} Delete certificate
CertificatesApi getCSR GET /certificates/csr Get CSR
CertificatesApi getCertificateByID GET /certificates/{certificate} Get certificate by ID
CertificatesApi listCertificates GET /certificates Get all certificates
CertificatesApi updateCertificate PATCH /certificates/{certificate} Update Certificate
CertificatesApi uploadCertificate POST /certificates/upload Upload Certificate
CertificatesApi uploadP12Certificate POST /certificates Upload new certificate
MessagesApi createMessage POST /messages Create a Message
MessagesApi listMessages GET /messages Get all messages
PassesApi createPass POST /templates/{template}/passes Create pass
PassesApi deletePass DELETE /passes/{pass} Delete pass
PassesApi getPassApple GET /passes/{pass}/pkpass Get pass in pkpass format
PassesApi getPassByExtID GET /passes/external/{externalID} Get pass by external ID
PassesApi getPassByID GET /passes/{pass} Get pass
PassesApi getPassGoogle GET /passes/{pass}/gpay Get pass Google Play installation link
PassesApi getPassLink GET /passes/{pass}/link Get pass download link
PassesApi listTemplatePasses GET /templates/{template}/passes Get all template passes
PassesApi updatePass PATCH /passes/{pass} Update pass
TagsApi deleteTag DELETE /tags/{tag} Delete tag
TagsApi getTagModels GET /tags/{tag} Get associated models
TagsApi listTags GET /tags Your GET endpoint
TemplatesApi copyTemplate POST /templates/{template} Copy template
TemplatesApi createPass POST /templates/{template}/passes Create pass
TemplatesApi createTemplate POST /templates Create template
TemplatesApi deleteTemplate DELETE /templates/{template} Delete template
TemplatesApi getTemplateByID GET /templates/{template} Get template
TemplatesApi getTemplateFields GET /templates/{template}/fields Get all template fields
TemplatesApi listTemplatePasses GET /templates/{template}/passes Get all template passes
TemplatesApi listTemplates GET /templates Get all templates
TemplatesApi updateTemplate PATCH /templates/{template} Update template

Documentation For Models

Documentation For Authorization

Bearer

  • Type: HTTP bearer authentication

Author

contact@walletpass.jp

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages