react-datatrans-light-box
Advanced tools
Comparing version 1.0.5 to 1.0.6
{ | ||
"name": "react-datatrans-light-box", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Datatrans light box component for react apps", | ||
@@ -5,0 +5,0 @@ "main": "lib/main.js", |
@@ -1,2 +0,2 @@ | ||
[![Build Status](https://circleci.com/gh/datatrans/react-datatrans-light-box.png?circle-token=:circle-token)](https://circleci.com/gh/datatrans/react-datatrans-light-box) | ||
[![NPM version][npm-version-image]][npm-url] [![Build Status](https://circleci.com/gh/datatrans/react-datatrans-light-box.png?circle-token=:circle-token)](https://circleci.com/gh/datatrans/react-datatrans-light-box) | ||
@@ -175,3 +175,3 @@ # react-datatrans-light-box | ||
|----- |:------ |------------| | ||
|`production` | Boolean | Indicates whether requests hit Datatrans' production or development environment. Defaults to *false*.| | ||
|`production` | Boolean | Indicates whether requests hit Datatrans' production or development environment. Defaults to *false*.| | ||
|`onCancelled` | Function | Called when user has cancelled payment.| | ||
@@ -183,1 +183,3 @@ |`onLoaded` | Function | Called when payment page is loaded.| | ||
[npm-url]: https://npmjs.com/package/react-datatrans-light-box | ||
[npm-version-image]: https://img.shields.io/npm/v/react-datatrans-light-box.svg?style=flat-square |
@@ -5,3 +5,3 @@ import React, {Component} from 'react' | ||
import { | ||
filterProps, toUrlParams, parseUrl, | ||
filterProps, toUrlParams, getBaseUrl, | ||
lockScrolling, | ||
@@ -35,3 +35,3 @@ releaseLock | ||
this.url = buildUrl(urlParams, this.props.production) | ||
this.origin = parseUrl(this.url).origin | ||
this.origin = getBaseUrl(this.url) | ||
@@ -38,0 +38,0 @@ this.state = { visible: true} |
@@ -13,3 +13,2 @@ import React from 'react' | ||
frameBorder={0} | ||
allowTransparency={true} | ||
/> | ||
@@ -16,0 +15,0 @@ } |
@@ -17,2 +17,3 @@ | ||
} | ||
export const toUrlParams = props => Object.keys(props) | ||
@@ -22,7 +23,7 @@ .map(key => `${key}=${props[key]}`) | ||
export const parseUrl = url => { | ||
const a = document.createElement('a') | ||
a.href = url | ||
return a | ||
export const getBaseUrl = url => { | ||
const pathArray = url.split('/') | ||
const protocol = pathArray[0] | ||
const host = pathArray[2] | ||
return protocol + '//' + host | ||
} | ||
@@ -29,0 +30,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
984429
184
0