Skip to content

Commit 474a791

Browse files
committed
more payform readme updates
1 parent 9183281 commit 474a791

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

README.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,31 @@ payform.validateCardNumber('4242 4242 4242 4242'); //=> true
4545
payform.parseCardType('4242 4242 4242 4242'); //=> 'visa'
4646
```
4747

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+
```
4963

5064
### Direct script include / Bower
5165

5266
Optionally via bower (or simply via download)
53-
```
67+
```sh
5468
bower install payform --save
5569
```
5670

5771
```html
58-
<script src="dist/payform.js"></script>
72+
<script src="path/to/payform/dist/payform.js"></script>
5973
<script>
6074
// Validate a credit card number
6175
payform.validateCardNumber('4242 4242 4242 4242'); //=> true
@@ -65,9 +79,6 @@ bower install payform --save
6579
</script>
6680
```
6781

68-
[Full API Doc](#api)
69-
70-
7182
## API
7283

7384
### General Formatting and Validation

src/payform.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
if module?
1111
module.exports = definition()
1212
else if typeof define is 'function' and typeof define.amd is 'object'
13-
define(definition)
13+
define(name, definition)
1414
else
1515
this[name] = definition()
1616
)('payform', ->

0 commit comments

Comments
 (0)