msdk-react-native

0.1.8 • Public • Published

Installation

npm install msdk-react-native

or

yarn install msdk-react-native

Usage

// 1. Create the EcmpPaymentInfo object

let paymentInfo: EcmpPaymentInfo = {
    projectID: 12123123,
    paymentID: "paymentId11",
    paymentAmount: 22200,
    paymentCurrency: "USD",
}

// 2. Sign the parameters contained in the EcmpPaymentInfo object

let paramsForSignature = getParamsForSignature(paymentInfo)
paymentInfo.signature = "CALCULATED_SIGNATURE_FROM_YOUR_BACKEND"

// 3. Create the EcmpPaymentOptions object that contains the required parameter actionType (enum) with the value specifying the required operation type

let paymentOptions: EcmpPaymentOptions = {
    actionType: EcmpActionType.Tokenize,
    paymentInfo: paymentInfo,
    isDarkTheme: true,
    //if need use real service- set EcmpMockModeType.disabled
    mockModeType: EcmpMockModeType.success,
    //set display mode if need
    screenDisplayModes: [EcmpScreenDisplayMode.hideDeclineFinalPage],
     //set additional fields if need
    additionalFields: [ {
      type: 'email',
      value: 'mail@mail.com'
    }]
}

// 4. Open the payment form

initializePayment(paymentOptions)

Package Sidebar

Install

npm i msdk-react-native

Weekly Downloads

127

Version

0.1.8

License

MIT

Unpacked Size

46.7 kB

Total Files

25

Last publish

Collaborators

  • igor_strider