File tree Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -45,17 +45,31 @@ payform.validateCardNumber('4242 4242 4242 4242'); //=> true
45
45
payform .parseCardType (' 4242 4242 4242 4242' ); // => 'visa'
46
46
```
47
47
48
- [ Full API Doc] ( #api )
48
+ ### AMD / Require.js
49
+
50
+ ``` javascript
51
+ require .config ({
52
+ paths: { " payform" : " path/to/payform" }
53
+ });
54
+
55
+ require ([" payform" ], function (payform ) {
56
+ // Validate a credit card number
57
+ payform .validateCardNumber (' 4242 4242 4242 4242' ); // => true
58
+
59
+ // Get card type from number
60
+ payform .parseCardType (' 4242 4242 4242 4242' ); // => 'visa'
61
+ });
62
+ ```
49
63
50
64
### Direct script include / Bower
51
65
52
66
Optionally via bower (or simply via download)
53
- ```
67
+ ``` sh
54
68
bower install payform --save
55
69
```
56
70
57
71
``` html
58
- <script src =" dist/payform.js" ></script >
72
+ <script src =" path/to/payform/ dist/payform.js" ></script >
59
73
<script >
60
74
// Validate a credit card number
61
75
payform .validateCardNumber (' 4242 4242 4242 4242' ); // => true
@@ -65,9 +79,6 @@ bower install payform --save
65
79
</script >
66
80
```
67
81
68
- [ Full API Doc] ( #api )
69
-
70
-
71
82
## API
72
83
73
84
### General Formatting and Validation
Original file line number Diff line number Diff line change 10
10
if module ?
11
11
module .exports = definition ()
12
12
else if typeof define is ' function' and typeof define .amd is ' object'
13
- define (definition)
13
+ define (name, definition)
14
14
else
15
15
this [name] = definition ()
16
16
)(' payform' , ->
You can’t perform that action at this time.
0 commit comments