1.1.7 • Published 3 years ago

react-native-direct-pay-card-payment v1.1.7

Weekly downloads
138
License
-
Repository
github
Last release
3 years ago

react-native-direct-pay-card-payment

Getting started

$ npm install react-native-direct-pay-card-payment --save

$ cd ios && pod install && cd ..

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-direct-pay-card-payment and add RNDirectPayCardPayment.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNDirectPayCardPayment.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.reactlibrary.RNDirectPayCardPaymentPackage; to the imports at the top of the file
  • Add new RNDirectPayCardPaymentPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-direct-pay-card-payment'
    project(':react-native-direct-pay-card-payment').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-direct-pay-card-payment/android')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-direct-pay-card-payment')

Windows

Read it! :D

  1. In Visual Studio add the RNDirectPayCardPayment.sln in node_modules/react-native-direct-pay-card-payment/windows/RNDirectPayCardPayment.sln folder to their solution, reference from their app.
  2. Open up your MainPage.cs app
  • Add using Direct.Pay.Card.Payment.RNDirectPayCardPayment; to the usings at the top of the file
  • Add new RNDirectPayCardPaymentPackage() to the List<IReactPackage> returned by the Packages method

Usage

import RNDirectPayCardPayment from 'react-native-direct-pay-card-payment';

// TODO: What to do with the module?
RNDirectPayCardPayment.addCardToUser(
                'dev', //env : dev or prod
                'e0e2c6e150775dff22e143af7ba234424', // apiKey
                'FN02385', // mid
                '8c1eeae8-07cb-4c7b-12334422e4q3', //unique id of the user
                'Jhon', // firstname of the user
                'Doe', // lastname of the user
                'jhon@mail.com', // email of the user
                '0730000001', // phone number of the user
                (_err, _r) => {
                  if (_err) {
                    console.log('code: ' + _err.code);
                    console.log('message: ' + _err.message);
                  } else {
                    //successfully added the card
                    console.log('id: ' + _r.id); // id (token) of the added card
                    console.log('mask: ' + _r.mask); // masked card number
                    console.log('reference: ' + _r.reference); // unique user id as the reference
                    console.log('brand: ' + _r.brand); // brand of the card (Visa / Mastercared)
                  }
                },
              );;
1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.1.2

3 years ago

0.0.28

3 years ago

1.0.6

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2-b

4 years ago

0.0.27

4 years ago

0.0.25

4 years ago

0.0.24

4 years ago

0.0.23

4 years ago

0.0.22

4 years ago

0.0.21

4 years ago

0.0.20

4 years ago

0.0.19

4 years ago

0.0.18

4 years ago

0.0.17

4 years ago

0.0.15

4 years ago

0.0.16

4 years ago

0.0.12

4 years ago

0.0.13

4 years ago

0.0.14

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.3

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago

1.0.0

4 years ago