0.3.28 • Published 3 months ago

react-native-paymob v0.3.28

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

react-native-paymob

react native paymob sdk

Installation

yarn add https://github.com/a-eid/react-native-paymob

IOS

IOS installation is almost automatic, the one thing you need to do is to create an empty Swift file in your project.

Screen Shot 2021-06-23 at 4 55 15 PM

Screen Shot 2021-06-23 at 4 55 27 PM

file name does not matter ( I think )

Screen Shot 2021-06-23 at 4 55 34 PM

choose create bridging header.

Screen Shot 2021-06-23 at 4 55 38 PM

there should be a swift file and a bridging header in your project.

Screen Shot 2021-06-23 at 4 56 33 PM

Android

1- in AndroidManifest.xml

  • add xmlns:tools="http://schemas.android.com/tools" to manifest tag
  • make sure to have these 2 attributes in the application tag android:supportsRtl="false" tools:replace="android:supportsRtl, android:allowBackup"
  • make sure to have the following values in android/app/res/values/colors.xml ( create the file if you don't have it already )
      <resources>
         <color name="white">#FFF</color>
         <color name="colorPrimary">#6200EE</color>
         <color name="colorPrimaryDark">#03DAC5</color>
         <color name="colorAccent">#03DAC5</color>
         <color name="ThemeColor"> 	#FF0000 </color>
       </resources>
## Usage

```js
import { Paymob, useDidDismissPaymob } from 'react-native-paymob';

useDidDismissPaymob(
	// make sure to not use destruction here  to get proper typing.
	// & use React.useCallback
  React.useCallback((data) => {
    console.log(data);
  }, [])
);


// some event handler
   Paymob.presentPayVC({
      billingData: {
        apartment: 'NA',
        email: 'NA',
        floor: 'NA',
        first_namae: 'NA',
        street: 'NA',
        building: 'NA',
        phone_number: 'NA',
        shipping_method: 'NA',
        postal_code: 'NA',
        city: 'NA',
        country: 'NA',
        last_name: 'NA',
        state: 'NA',
      },
      paymentKey: "your payment key",
      saveCardDefault: false,
      showSaveCard: false,
      showAlerts: false,
      isEnglish: true,
      showScanCardButton: false,
    });

Note

the library was created to cover our use case only, but we are open to adding more features if we have the time.

Contributing

All Pull Requests are welcome See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

0.3.28

3 months ago

0.3.27

3 months ago

0.3.26

3 months ago

0.3.25

3 months ago

0.3.24

3 months ago

0.3.23

3 months ago

0.3.22

3 months ago

0.3.21

3 months ago

0.3.17

4 months ago

0.3.14

4 months ago

0.3.13

4 months ago

0.3.19

4 months ago

0.3.18

4 months ago

0.3.9

2 years ago

0.3.12

2 years ago

0.2.11

2 years ago

0.3.11

2 years ago

0.3.10

2 years ago

0.3.6

2 years ago

0.3.5

2 years ago

0.3.8

2 years ago

0.3.7

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.3

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.10

2 years ago

0.2.4

2 years ago

0.2.2

2 years ago

0.1.47

2 years ago