Giter Site home page Giter Site logo

dmsvlks / adyen-react-native Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dmitry-blackwave/adyen-react-native

0.0 1.0 0.0 3.56 MB

Adyen SDK for React Native

License: MIT License

Ruby 1.60% Java 30.10% JavaScript 10.10% Objective-C 48.00% Swift 10.21%

adyen-react-native's Introduction

adyen-react-native

With Adyen SDK you can help your shoppers pay with a payment method of their choice, selected from a dynamically generated list of available payment methods. Method availability is based on shoppers’ location, transaction currency, and transaction amount.

To give you as much flexibility as possible, Adyen SDK can be integrated via this library in two ways:

  • Quick integration – Benefit from a fully optimized out-of-the-box UI with the SDK.
  • Custom integration – Design your own UI while leveraging the underlying functionality of the SDK.

Dependencies

  • Node.js
  • npm
  • Android studio, Android SDK and correct PATH/ANDROID_HOME for it.

MacOS only for creating IOS Builds

  • Xcode 9+
  • Cocoapods (for installing IOS dependencies)

Getting started

$ npm install adyen-react-native --save

Installation

$ react-native link adyen-react-native

IOS

  • Open ios directory in you project and run pod init

  • Edit Podfile with following content

  platform :ios, '10.0'
  use_frameworks!
  target 'Your Target Name' do
	  pod 'AdyenReactNative', :path => '../node_modules/adyen-react-native'
  end
		
  post_install do |installer|
    installer.pods_project.targets.each do |target|
      if target.name == 'Adyen'
        target.build_configurations.each do |config|
          config.build_settings['SWIFT_VERSION'] = '4.0'
        end
      end
    end
  end
  • Run: $ pod install

  • Open YourProject.xcworkspace/

  • Open Your target > Build Settings and add $(SRCROOT)/../node_modules/adyen-react-native/ios to the Header Search Paths and Library Search Paths sections.

  • Click run or use $ react-native run-ios

Android

react-native link react-native-adyen should install all the dependency

Quick integration

Android

Credit Card            One-Click           

IOS

                    

Getting started

The Quick integration of the SDK provides UI components for payment method selection, entering payment method details (credit card entry form, iDEAL issuer selection, etc.). To get started, use the Adyen class to start the payment:

import Adyen from adyen-react-native

Add listeners for library's events

Send sdkToken and returnUrl to your own server, which then needs to forward this data, among some other parameters, to the Adyen Checkout API. See the API Explorer for more details.

Adyen.onRequestPaymentSession((token, returnUrl) => {
    //send request to a server and get paymentSession from an Adyen's server
});
Adyen.onPaymentResult((code, payload) => {
    //confirm payment
});

Adyen.onError((code, error) => {
    //payment was cancelled or something else
});

For starting payment proccess call:

Adyen.startPayment();
- Generating StartPaymentParameters

After receiving the payment session data from your own server, use the Adyen.confirmPayment to handle the payment session response:

Adyen.confirmPayment(response.paymentSession);

Custom integration

It will be implement as soon as possible. Thx.

Samples

See also

License

This repository is open source and available under the MIT license. For more information, see the LICENSE file.

adyen-react-native's People

Contributors

dmsvlks avatar blackwave-rt avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.