npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-telebirr-payment

v1.0.0

Published

telebirr inAppSDK payment module

Readme

React Native Telebirr Payment

A react native telebirr inAppSDK payment module which is mainly intended for applications which require telebirr inapp payment.

Installation

npm install react-native-telebirr-payment

Demo

Usage/Examples

import TelebirrPayment from 'react-native-telebirr-payment';

// ...

export default function App() {
  const [resultCode, setResultCode] = useState(null);
  const [resultMessage, setresultMessage] = useState(null);
  const handlePayment = async () => {
    try {
      const appId = '**************';// your own telebirr provided appId
      const shortCode = '****'; // your own telebirr provided shortcode
      const receiveCode =  'TELEBIRR$BUYGOODS$5510$0.05$10527506c5822051eae86ffbeba60036387009$120m'; // the receiveCode is the response you get from /payment/v1/merchant/inapp/createOrder

      const result = await TelebirrPayment.startPay(
        appId,
        shortCode,
        receiveCode
      );
      const { code, message } = result;
      setResultCode(code);
      setresultMessage(message);
      if (result) {
        if (code === -3) {
          console.log('User canceled the payment.', message);
        } else if (code === 0) {
          console.log('Successful Payment.');
        } else if (code === -10) {
          console.log('Telebirr Payment is not installed.', message);
        } else {
          console.log(`Error Code: ${code}, Message: ${message}`);
        }
      } else {
        console.log('Unexpected log format:', result);
      }
    } catch (error) {
      console.error('Payment initiation failed:', error);
    }
  };

  return (
    <SafeAreaView style={styles.container}>
      <View style={styles.subcontainer}>
        <Text style={styles.textStyle}>
          Welcome to React Native Telebirr Payment
        </Text>
        <View style={styles.payment}>
          <TouchableOpacity style={styles.buttonStyle} onPress={handlePayment}>
            <Text style={styles.textStyle}>Pay</Text>
          </TouchableOpacity>
        </View>
        <View style={styles.payment}>
          <Text style={styles.textStyle}>code: {resultCode}</Text>
          <Text style={styles.textStyle}>message: {resultMessage}</Text>
        </View>
      </View>
    </SafeAreaView>
  );
}

API Reference

| Parameter | Type | Required | Description | Default | | :------------------ | :-------------- | :------- | :------------------------------------------------------------------------------- | :-------------------------- | | appId | string | true | a telebirr provided appId for the merchant | | | shortCode | string | true | a telebirr provided shortCode for the merchant | | | receiveCode | string | true | a concatenated response data from /payment/v1/merchant/inapp/createOrder, "TELEBIRR$BUYGOODS$merch_code$total_amount $prepay_id$timeout_express" | |

Result Return Codes

| Code | Description | | :------------------ | :------------------------------------------------------------------------------- | | -2 | Parameter error. (all the three parameters should be passed other wise will give this error) |
| -3 | Cancellation of payment ( when the user is taken to the telebirr superapp and the user cancels the payment |
| -10 | The Payment is not installed. (if the telebirr superapp apk is not installed (testbed or production apk) |

UAT Usage

for android UAT(test) you have to change the android archive (aar) inside node_modules\react-native-telebirr-payment\android\build.gradle from 'libs/EthiopiaPaySdkModule-prod-release.aar' to 'libs/EthiopiaPaySdkModule-uat-release.aar' this will launch the telebirr testbed app and make the transction

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library