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

wirecard-react-native

v2.0.6

Published

Wirecard Mobile SDK Credit Card and Google Pay React-Native implementation

Downloads

435

Readme

wirecard-react-native

A React-Native wrapper for the Wirecard SDK's Android: com.wirecard.ecom:card 4.3.0 Ios: recomended paymentSDK/All 4.2.2 (podfile versions are chosen in the parent project Podfile)

react-native versions supported:

0.61.1 0.62.2

payment methods supported

  • Credit Card
  • Google Pay

Getting started

  • follow react-native instructions to setup a new project if you dont have one http://reactnative.dev/docs/environment-setup
  • $ npm install wirecard-react-native --save
  • time saving note `if your fresh react-native install fails when first running, try this:
    • run npm install

    • android / build.gradle -> add configurations.all{ resolutionStrategy { force "com.facebook.soloader:soloader:0.8.2" } }

    • android / app / build.gradle -> add packagingOptions { pickFirst 'lib/x86_64/libjsc.so' pickFirst 'lib/arm64-v8a/libjsc.so' }

    • run react-native start

    • run react-native run-android `

iOS

  1. Add this to you podfile pod 'wirecard-react-native', :path=>'../node_modules/wirecard-react-native/ios'

Android

  1. Open up android/app/src/main/java/[...]/MainApplication.java
  • Add import com.rnwirecard.RNWirecardPackage; to the imports at the top of the file
  1. Append the following lines to android/settings.gradle:
    include ':wirecard-react-native'
    project(':wirecard-react-native').projectDir = new File(rootProject.projectDir, 	'../node_modules/wirecard-react-native/android')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      implementation project(':wirecard-react-native')
  3. also change
    defaultConfig {
    	minSdk 19
    	multiDexEnabled true
    }
  4. Insert in android/build.gradle allprojects{ repositories { maven { url "https://dl.bintray.com/wirecard/ecom-android" } } }

Usage

import ReactNativeWirecard,{
	IRNWirecardCcPayment,
  PAYMENT_METHODS,
	IOS_ENVIRONMENTS,
	ANDROID_ENVIRONMENTS,CURRENCYS,
	TRANSACTION_TYPES} from 'wirecard-react-native';

export default class PaymentManager {
	constructor(){
		const environment = Platform.OS === 'ios' 
		? 
		IOS_ENVIRONMENTS.GERMANY_TEST 
		:
		ANDROID_ENVIRONMENTS.GERMANY_TEST;

		ReactNativeWirecard.initiateClient(this.onInitSuccess.bind(this),this.onInitFail.bind(this), environment);
	}

	onInitSuccess(){
		console.log('client was initiated successfully');
	}
	onInitFail(){
		console.log('client failed to initiate');
	}
  makePayment(){
		const mockPayment: IRNWirecardCcPayment = {
			amount: '1.99',
			currency: CURRENCYS.EURO,
			// transactionType:TRANSACTION_TYPES.PURCHASE, // only purchase supported for now
			paymentMethod: PAYMENT_METHODS.CARD.paymentMethod,
			signature:'baCkEndGeneRat3D5iGN4TuR3.==',
			requestID:'my-internal-id',
			merchantID: 'wirecard-assigned-id',
			notificationUrl:'https://my-backend.com/api/my-notifications-endpoint',
			setAttempt3d: false,
    		setRecurring: false,
    		setRequireManualCardBrandSelection: false,
   			setAnimatedCardPayment: true
		}
		// you can add a token to IRNWirecardCcPayment if you have it token: '2y3423423saa2';
		// this should trigger the Wirecard UI;
		ReactNativeWirecard.pay(
			this.onPaymentSuccess.bind(this),
			this.onPaymentFailure.bind(this),
			mockPayment);
	}

  onPaymentSuccess(
		error:any,
		tokenId:any,
		transactionState:any,
		transactionId: any,
		requestId: any
		){
			console.log(`transaction${transactionId} done succesfully!`);
	}
	onPaymentFailed(
		error:any,
		tokenId:any,
		transactionState:any,
		transactionId: any,
		requestId: any
	){
		console.log(`transaction failed :( ${error}`);
	}
}

IRNWirecardCcPayment

amount: string; paymentMethod: string; currency: string; requestID: string; merchantID: string; signature: string; token?: string; maskedAccountNumber?: string; notificationUrl?: string;

IRNWirecardCCPaymentResponse

error: string; // is empty on success tokenId: string; transactionState: string; transactionId: string; requestId: string;