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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@iteratorsmobile/react-native-karhoo-sdk

v1.2.1

Published

React-native bindings for KarhooSDK

Downloads

14

Readme

react-native-karhoo-sdk

1. Getting started

$ npm install @iteratorsmobile/react-native--karhoo-sdk --save

or

$ yarn add @iteratorsmobile/react-native-karhoo-sdk

2. Installation

2.1. Update Podfile

add

use_modular_headers!

update

pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec', :modular_headers => false
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec', :modular_headers => false

2.2. Update project level build.gradle:

maven { url 'https://jitpack.io' }
maven {
    url "https://cardinalcommerceprod.jfrog.io/artifactory/android"
    credentials {
        username 'braintree_team_sdk'
        password 'AKCp8jQcoDy2hxSWhDAUQKXLDPDx6NYRkqrgFLRc3qDrayg6rrCbJpsKKyMwaykVL8FWusJpp'
    }
}

2.3. Update app level build.gradle:

implementation 'com.braintreepayments.api:drop-in:5.+'

2.4. Update AndroidManifest

<activity android:name="com.braintreepayments.api.BraintreeBrowserSwitchActivity"
    android:launchMode="singleTask">
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="${applicationId}.braintree" />
    </intent-filter>
</activity>

2.5 Follow Braintree docs

  1. Add to Podfile
    pod 'Braintree'
  1. Update AppDelegate.m
    // imports
    @import Braintree;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {  
    
    // other code
    
    [BTAppSwitch setReturnURLScheme:[NSString stringWithFormat:@"%@%@", [[NSBundle mainBundle] bundleIdentifier], @".payments"]];
    
    return YES;
}
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
  BOOL handled = NO;
  
  if ([url.scheme localizedCaseInsensitiveCompare:([NSString stringWithFormat:@"%@%@", [[NSBundle mainBundle] bundleIdentifier], @".payments"])] == NSOrderedSame) {
    handled = [BTAppSwitch handleOpenURL:url options:options];
  }
  
  /* 
    NOTE: if you are using RCTLinkingManager it has to be placed in last 'if', for example :
    
    else if ([RCTLinkingManager application:app openURL:url options:options]) {
    handled = YES;
  }
*/
  return handled;
}
  1. Register URL Type: 3.1 For each target in your app, in XCode go to App Target > Info > URL Types 3.2 Click '+', add URL ${bundleId}.payments, where ${bundleId} is your app bundle id

  2. Add required permission:

  • NSLocationWhenInUseUsageDescription

2.6. Link

$ react-native link @iteratorsmobile/react-native-karhoo-sdk

3. Usage

3.1 Import

import KarhooSdk from '@iteratorsmobile/react-native-karhoo-sdk';

3.2 Before using other features you have to initialize sdk:

KarhooSdk.initialize(
    identifie,
    referer,
    organisationId,
    isProduction,
): void;

3.3 Obtain payment nonce..

KarhooSdk.getPaymentNonce(
    organisationId,
    paymentData: {
        currency,
        amount,
    },
): Promise<PaymentNonce>;

3.4 ...and pass along with other booking data t book a ride

KarhooSdk.bookTrip(
    {
        firstName,
        lastName,
        email,
        mobileNumber,
        locale,
    },
    quoteId,
    paymentNonce,
): Promise<TripInfo>

3.5 Get cancellation fee data...

  • this step is not required, but user should be acquainted with cancellation fee amount before he cancels ride
KarhooSdk.cancellationFee(followCode): Promise<CancellationFeeInfo>;

3.6 ...before you cancel trip

KarhooSdk.cancelTrip(followCode): Promise<TripCancelledInfo>;