/apple-pay-js

Primary LanguageJavaScriptMIT LicenseMIT

MIT License


Logo

Payze Apple Pay JS SDK

About The Project

Payze is the best software platform for running an internet business. We handle money movement flow for our customers by giving them tools they need.

Getting Started

Installation

  1. Install payze package in your project
    npm install @payze/payze-apple-pay

Basic Usage

  1. Import payze-apple-pay SDK
    import { PayzeApplePay } from "@payze/payze-apple-pay";
  2. Initialize payze
    const applePay = PayzeApplePay(merchantIdentifier, { amount, currencyCode, label }, callback);
  3. Include following html
     <div class="apple-pay-button apple-pay-button-black" 
           id="apple-pay-button" 
           (click)="clickEvent()">
    
     </div>
  4. Initialize Payment (In order to get transactionId you need to make request from API ('Just Pay' or 'Single Payment and Split')
    clickEvent() {
     this.applePay.makeApplePay('transactionId');
    }

Customization

// Payze Apple Pay SDK accepts 2 arguments: merchant Identifier and configuration
// both are required
// Example usage: 
const payze = PayzeApplePay('merchant.io.payze', {
  amount: 10, // required
  currencyCode: 'GEL', // default (not required)
  label: 'Payze' // default (not required)
}, applePayResultStatus);

applePayResultStatus(result) {
   console.log(result);
   //status: 0 success
   //status: 1 failed
}

License

Distributed under the MIT License. See LICENSE.txt for more information.