Skip to content

Commit

Permalink
Merge 2054423 into 188324a
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrudner committed May 15, 2020
2 parents 188324a + 2054423 commit 5fbe7b1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 3 deletions.
6 changes: 5 additions & 1 deletion docs/1-components/RecurlyProvider.stories.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Subtitle } from '@storybook/addon-docs/blocks';
import { Subtitle, Props } from '@storybook/addon-docs/blocks';
import { propsSlotFor } from '../shared/prop-types';
import { RecurlyProvider } from '../../lib';

<Meta title="Components/RecurlyProvider" parameters={{ sortOrder: 0 }} />

Expand All @@ -22,4 +24,6 @@ import { RecurlyProvider } from '@recurly/react-recurly';
```
**Note:** Replace `MY_PUBLIC_KEY` with yours, found [here][app-api-access].

<Props slot={propsSlotFor(RecurlyProvider)} />

[app-api-access]: https://app.recurly.com/go/developer/api_access
35 changes: 33 additions & 2 deletions lib/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,46 @@ const { Provider } = RecurlyContext;
* `react-recurly` component you will use. It is responsible for creating a `Recurly.js`
* instance for any descendant components to interact with.
*
* This component accepts your `publicKey` as a prop.
* This component accepts your `publicKey` and other configuration options for Recurly-js as props.
*/
export default class RecurlyProvider extends React.Component {
static propTypes = {
/**
* Your Recurly public key. See
* [API Access](https://app.recurly.com/go/developer/api_access).
*/
publicKey: PropTypes.string
publicKey: PropTypes.string,
/**
* Enables data transmission over XHR+CORS
*/
cors: PropTypes.bool,
/**
* Sets a default currency
*/
currency: PropTypes.string,
/**
* Adds additional field requirements for tokenization. ex: ['cvv']
*/
required: PropTypes.arrayOf(PropTypes.string),
/**
* API request timeout in ms
*/
timeout: PropTypes.number,
/**
* Fraud configuration. See the
* [Recurly-js docs on fraud configuration](https://developers.recurly.com/reference/recurly-js/index.html#fraud)
*/
fraud: PropTypes.shape({
kount: PropTypes.shape({
dataCollector: PropTypes.boolean
}),
braintree: PropTypes.shape({
deviceData: PropTypes.string
}),
litle: PropTypes.shape({
sessionId: PropTypes.string
})
})
};

static defaultProps = {
Expand Down

0 comments on commit 5fbe7b1

Please sign in to comment.