1.1.29 • Published 11 months ago

@noda-ui/pay v1.1.29

Weekly downloads
-
License
-
Repository
-
Last release
11 months ago

@noda-ui/pay

Installation

npm i @noda-ui/pay
#or
yarn add @noda-ui/pay

Usage

<body>
  <noda-web-pay id="payment"></noda-web-pay>
</body>
import "@noda-ui/pay/lib/index.js";
import "@noda-ui/pay/lib/styles/styles.css";

const payment$ = document.querySelector("#payment");

payment$.payment = {
  env: "DEVELOPMENT", // "STAGING", "PRODUCTION"
  apiKey: "{{api key}}",
  paymentId: "{{payment id}}",
  amount: 0.5,
  currency: "gbp", // Payment currency in ISO_4217 format.
  customerId: "{{cutomer id}}",
  returnUrl: "{{return url}}",
  webhookUrl: "{{webhook url}}",
  shopId: "{{shop id}}",
  description: "{{payment description}}",
  country: "{{country}}",
  email: "{{email}}",
  iin: 00000000,
  additionalData: {}
};

payment$.settings = {
  isPhoneNumberFieldVisible: false,
  isCloseButtonVisible: true,
  isNodaInfoShown: true
}

payment$.addEventListener("close", (event) => {
  console.log("clicked to close icon: ", e); // Close icon click event
});

payment$.addEventListener("paid", (event) => {
  console.log("event after pay: ", event.detail); // Payment result event
});

Usage with TypeScript

declare module "@noda-ui/pay";

Payment interface

FieldTypeDescription
env *requiredstringApp environments, for develop and production. Currently accepted: {PRODUCTION, STAGING, DEVELOPMENT}
apiKey *requiredstringMerchant's api key, issued by Noda
paymentId *requiredstringOrder identificator in merchant's system
amount *requirednumberPayment amount
currency *requiredstringPayment currency in ISO_4217 format.
customerIdstringEnd-customer Id in merchant's system. That parameter can be used to find a best button appearance for the particular customer.
webhookUrlstringURL where the Noda will send hooks about the payment status changes
returnUrl *requiredstringAfter the payment completed, customer will be redirected into this Url
shopIdstringMerchant's shop identificator, issued by Noda. If you have more than one online shop, this parameter helps to analyse the payments afterwards
descriptionstringShort order description for the customer
country *requiredstringISO 3166-1 alpha-2 country code
emailstringEnd-customer e-mail. That parameter can be used to find a best button appearance for the particular customer.
iinnumberIIN (first six digits) of the end-customers credit card used earlier at the merchant's checkout. This parameter helps to define end-customer Bank and propose to pay with that bank.
additionalDataobjectAdditional payment information in key:value format

Settings interface

FieldTypeDescription
isPhoneNumberFieldVisiblebooleanWhether to show the phone input field when creating a map
isCloseButtonVisiblebooleanWhether to show a window close button in the top right corner of the screen
isNodaInfoShownbooleanWhether to show information about Noda

Output events

EventTypeDescription
closevoidtriggered by clicking on the closing icon
paidPayment Resulttriggered after receiving a payment response

Security

Remember to use valid api token for apiKey field.

How to obtain the keys?

Sandbox: use 24d0034-5a83-47d5-afa0-cca47298c516 for non PRODUCTION environment. Live: use 808e683e-9383-4717-8148-02e74b63b1f8 for testing purposes.

Please consider, that this is a real payment routing which is set up to charity organisations complete the onboarding at ui.noda.live/hub to get your production keys

Payment UX

Please switch the "Purchase scenarios" at ui.noda.live/pay-sandbox in order to overview the different behavior.

If you've used some additional parameters (for example - IP, IIN, CustomerID and so on) previosly, for the same purchase, we highly recommend pass the same additional parameters, in order to keep the consistent UX for the customers.

Package Payment Result

ParameterTypeDescripton
idstringpayment id
urlstring{{set}}
qrCodestring{{set}}
threeDsDataThree Ds Datathree ds data object
statusstringNew Processing Failed Awaiting confirmation Done Settled Incomplete Settlement

Package Payment Result interface

You can receive payment result with the following options:

  • url {{set}} description (example):

  • qrCode {{set}} description (example):

  • threeDsData {{set}} description (example):

{
  paReq: {{set}},
  acsUrl: {{set}},
  termUrl: {{set}},
  md: {{set}}
}
  • status
    • New - {{set}}
    • Processing - {{set}}
    • Failed - {{set}}
    • Awaiting confirmation - {{set}}
    • Done - {{set}}
    • Settled - {{set}}
    • Incomplete Settlement - {{set}}

Alternative Payment Result

Please see the detailed description at docs.noda.live.

Webpack 5 Issues

During the integration process, you might face multiple issues with webpack 5. This issue is caused due to the fact that some packages have certain dependencies, which are not present within the browser environment by webpack 5. Hence, you require certain node polyfills to be added to your project, while overriding the configurations to enable their usage. When that is done, your project should run without any issues.

An alternative solution to the problem is to install @microsoft/signalr package in your project.

1.1.29

11 months ago

1.1.20-beta

1 year ago

1.1.20-gamma

1 year ago

1.1.26-beta

1 year ago

1.1.13-alpfa

1 year ago

1.1.27

1 year ago

1.1.9

1 year ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.16

1 year ago

1.1.15

1 year ago

1.1.14

1 year ago

1.1.13

1 year ago

1.1.19

1 year ago

1.1.18

1 year ago

1.1.17

1 year ago

1.1.20

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

1.0.3

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

0.2.30-demo

2 years ago

0.2.27

2 years ago

0.2.26

2 years ago

0.2.25

2 years ago

0.2.24

2 years ago

0.2.23

2 years ago

0.2.22

2 years ago

0.2.21

2 years ago

0.2.30

2 years ago

0.2.29

2 years ago

0.2.28

2 years ago

0.2.20

2 years ago

0.2.19

2 years ago

0.2.18

2 years ago

0.2.17

2 years ago

0.2.16

2 years ago

0.2.15

2 years ago

0.2.13

2 years ago

0.2.12

2 years ago

0.2.11

2 years ago

0.2.10

2 years ago

0.2.0

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.9

2 years ago

0.2.8

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.1.13

2 years ago

0.1.12

2 years ago

0.1.11

2 years ago

0.1.10

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago