1.0.0-alpha.1 • Published 1 year ago

upc-payment-js v1.0.0-alpha.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Installing

$ npm install upc-payment-js

Example

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

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

const payment = new UpcPayment({
  commonProps: {
    merchantId: '012345',
    terminalId: 'A012345',
    signature: 'signature',
    currency: 980,
    paymentUrl: 'https://ecconnect.com.ua/',
    locale: 'en',
    mode: UpcPaymentMode.ModalIframe,
  },
  iframeProps: {
    onSuccessPayment: () => {},
    onFailurePayment: () => {},
    onGoBackToSiteButtonClick: () => {},
    onPayMoreButtonClick: () => {},
  },
});

payment.pay({
  orderId: 'orderId',
  description: 'description',
  purchaseTime: 1678436363678,
  totalAmount: 1000,
})

OR

Using link:

<script src="https://ecconnect.com.ua/pub/utils/upc-payment-sdk/upc-payment-js.js"></script>
if (window.UpcPayment) {
  const payment = new UpcPayment({
    commonProps: {
      merchantId: '012345',
      terminalId: 'A012345',
      signature: 'signature',
      currency: 980,
      paymentUrl: 'https://ecconnect.com.ua/',
      locale: 'en',
      mode: 'ModalIframe',
    },
    iframeProps: {
      onSuccessPayment: () => {},
      onFailurePayment: () => {},
      onGoBackToSiteButtonClick: () => {},
      onPayMoreButtonClick: () => {},
    },
  });

  payment.pay({
    orderId: 'orderId',
    description: 'description',
    purchaseTime: 1678436363678,
    totalAmount: 1000,
  })
}

License

MIT

1.0.0-alpha.1

1 year ago