1.0.2 • Published 9 months ago

upc-payment-js v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Installing

$ npm install upc-payment-js

Types and available payment parameters

https://github.com/upcecconnect/upc-payment-js/blob/main/dist/es/upc-payment-js.d.ts

Demo-shop with examples of usage

https://upcecconnect.github.io/fake-shop

Demo-shop (repo) with examples of usage

https://github.com/upcecconnect/fake-shop

Example

Once the package is installed, you can import the library using import or require approach:

import { UpcPayment } from 'upc-payment-js';

const payment = new UpcPayment({
  merchant: {
    id: '012345',
    terminalId: 'A012345',
    signature: 'Signature',
  },
  customer: {
    email: '',
    firstName: '',
    lastName: '',
    phoneCountryCode: '380',
    phoneNumber: '001234567',
  },
  iframeProps: {
    wrapperSelector: '#some-wrapper-id',
    callback: (data) => callbackHandler(data),
  },
});

payment.pay({
  currencyNumericCode: '980',
  description: 'description',
  orderId: 'orderId',
  // yymmddhhmmss
  purchaseTime: '241231235959',
  totalAmountCents: 12345,
});

OR

Using link:

<script src="https://raw.githubusercontent.com/upcecconnect/upc-payment-js/refs/heads/main/dist/iife/upc-payment-js.js"></script>

Or download and use lib directly

https://github.com/upcecconnect/upc-payment-js/blob/main/dist/iife/upc-payment-js.js

if (window.UpcPayment) {
  const payment = new UpcPayment({
    // ...
  });
  payment.pay({
    //...
  });
}

License

MIT

1.0.2

9 months ago

1.0.1

10 months ago

1.0.0

10 months ago

1.0.0-alpha.1

2 years ago