GithubHelp home page GithubHelp logo

apple-pay's Introduction

Travis CI Latest Stable Version Total Downloads License

Apple Pay Token Decoder

This library is used to decode tokens for Apple Pay.

It takes a payment token data and returns an ApplePayPaymentData object. ex:

class PayU\ApplePay\Decoding\ApplePayPaymentData#19 (9) {
  private $version =>
  int(1)
  private $applicationPrimaryAccountNumber =>
  string(16) "20427527000"
  private $applicationExpirationDate =>
  string(6) "190731"
  private $currencyCode =>
  string(3) "643"
  private $transactionAmount =>
  int(100000)
  private $deviceManufacturerIdentifier =>
  string(12) "050103073"
  private $paymentDataType =>
  string(8) "3DSecure"
  private $onlinePaymentCryptogram =>
  string(28) "Am+7lPDbobAGVT7hNAoABA=="
  private $eciIndicator =>
  NULL
}

Install:

Run composer require payu/apple-pay

Get AppleRootCA-G3.pem:

  1. Download AppleRootCA-G3.cer
  2. Run command: openssl x509 -inform der -in AppleRootCA-G3.cer -out AppleRootCA-G3.pem

Get Private Key:

  1. Export merchant certificate to a p12 cert
  2. Use openssl to get the private key: openssl pkcs12 -in <your_cert>.p12 -out private_key.pem -nocerts -nodes
  3. Copy content without BEGIN and END markers

Usage:

See https://github.com/PayU/apple-pay/blob/master/examples/decode_token.php

For more information about how Apple Pay tokens decoding works go to: https://developer.apple.com/library/content/documentation/PassKit/Reference/PaymentTokenJSON/PaymentTokenJSON.html

Only works on Linux hosts with openssl installed

For open pull requests please make sure the Travis build does not fail!

apple-pay's People

Contributors

trydocatch avatar willemstuursma avatar sergeyzinder avatar drealecs avatar gxgpet avatar fromsi avatar

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.