Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-datatrans-light-box

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-datatrans-light-box

Datatrans light box component for react apps

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
414
decreased by-79.74%
Maintainers
1
Weekly downloads
 
Created
Source

react-datatrans-light-box

Datatrans light box mode component for React. Render this component anywhere in your DOM tree in order to show the Datatrans payment page in fullscreen mode.

React is defined as a peer dependency and expected to be made available by your project. Other than that this component is completely dependency-free.

How to install

npm i react-datatrans-light-box --save

or

yarn add react-datatrans-light-box --save

Example Usage


import React, {PropTypes, Component} from 'react'
import Lightbox from 'react-datatrans-lightbox'

export default class App extends Component {

  constructor(props) {
    super(props)
    this.state = { showsLightBox: false }
    this.start = this.start.bind(this)
  }

  start() {
    this.setState({showsLightBox: true})
  }

  render() {
    return <div>
      <div> Your React App </div>
      <button onClick={this.start}> start lightbox </button>
      {this.state.showsLightBox && <LightBox
        merchantId='1100004624'
        refno='1100004624'
        amount='1000'
        currency='CHF'
        sign='xxx'
      />}
    </div>
  }

}

Props

Mandatory

NameTypeDescription
merchantIdStringMerchant identifier provided to you by Datatrans.
refnoStringAny value by which you would like to reference the payment.
amountStringThe amount in cents you would like to charge your customer.
currencyStringThe type of currency that will be used for the payment.
signStringTransaction security parameter. Find it in Datatrans' Webadmin Tool.

Optional

NameTypeDescription
productionBooleanIndicates whether requests hit Datatrans' production or development environment. Defaults to false.
onOpenFunctionCalled when payment page has opened.
onCancelFunctionCalled when user cancels payment.
onLoadFunctionCalled when payment page is loaded.
onErrorFunctionCalled when there was an error.
and many more...Refer to this PDF to get the full list of supported parameters.

Keywords

FAQs

Package last updated on 04 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc