@rebilly/framepay 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +16 -13
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -45,21 +45,24 @@ It returns a promise that resolves with the FramePay instance.
45
45
  import { loadFramepay } from '@rebilly/framepay';
46
46
 
47
47
  try {
48
- // Load FramePay
49
48
  const framepay = await loadFramepay();
50
- } catch (err) {
51
- console.error('Failed to load Framepay: ', err);
52
- }
53
49
 
54
- // Use FramePay as normal.
55
- // For complete examples, see: https://www.rebilly.com/docs/dev-docs/basic-setup
56
- framepay.initialize({
57
- publishableKey: 'pk_sandbox_123',
58
- // ...
59
- });
60
- framepay.on('ready', function () {
61
- const card = framepay.card.mount('#mounting-point');
62
- });
50
+ // Use FramePay as normal.
51
+ // For complete examples, see: https://www.rebilly.com/docs/dev-docs/basic-setup
52
+ framepay.initialize({
53
+ publishableKey: 'your-publishable-key',
54
+ // Additional configuration parameters
55
+ });
56
+ framepay.on('error', function (error) {
57
+ console.error('FramePay error:', error);
58
+ });
59
+ framepay.on('ready', function () {
60
+ // Your page should have a DOM element with the id "card-element"
61
+ framepay.card.mount('#card-element');
62
+ });
63
+ } catch (error) {
64
+ console.error('Failed to load Framepay: ', error);
65
+ }
63
66
  ```
64
67
 
65
68
  ### TypeScript Support
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebilly/framepay",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "A wrapper to load Rebilly's FramePay library and provide TypeScript types",
5
5
  "type": "module",
6
6
  "license": "MIT",