Skip to content

Commit fd3957a

Browse files
committed
Update README.md
1 parent 89ebb5b commit fd3957a

1 file changed

Lines changed: 22 additions & 30 deletions

File tree

README.md

Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -84,36 +84,28 @@ Creating editable fields is easy! Just add `-editable` to the name of your varia
8484
## Hosted Button Support
8585
We now support hosted buttons! Add `data-hosted_button_id` to your script with your button ID, e.g. `data-hosted_button_id=<HOSTED_BUTTON_ID>`.
8686

87-
## Custom dropdown fields
88-
You can also create custom dropdown fields for your form.
89-
90-
`data-optionNname`
91-
'data-optionNselectX`
92-
`data-optionNpriceX`
93-
94-
`data-optionNrequired="true"`
95-
`data-optionNpattern="alphaNumericRegex|alphaRegex|numericRegex"`
96-
97-
**Dropdown field**
98-
99-
Ex:
100-
data-option0name="Color"
101-
data-option0select0="Red"
102-
data-option0select1="Blue"
103-
data-option0select2="Green"
104-
data-option0price0="10.00"
105-
data-option0price1="8.00"
106-
data-option0price2="12.00"
107-
108-
data-option1name="Size"
109-
data-option1select0="Small"
110-
data-option1select1="Medium"
111-
data-option1select2="Large"
112-
113-
data-option2name="Coupon Number"
114-
data-option2select0=""
115-
data-option2required="true"
116-
data-option2pattern="alphaNumericRegex"
87+
## Custom fields
88+
You can also add custom text fields and dropdowns to your form.
89+
90+
For a text field:
91+
```javascript
92+
data-option0name="Coupon Number"
93+
data-option0required="true"
94+
```
95+
96+
For a dropdown:
97+
```javascript
98+
data-option0name="Size"
99+
data-option0select0="Small"
100+
data-option0select1="Medium"
101+
data-option0select2="Large"
102+
data-option0price0="8.00"
103+
data-option0price1="10.00"
104+
data-option0price2="12.00"
105+
```
106+
107+
## Form validation
108+
We can also handle form validation for you. To make a field required, add `data-optionNrequired="true"`. We support patterns, too. Add `data-optionNpattern`, e.g. `data-optionNpattern="alphaNumericRegex"`. Supported validators are: `alphaNumericRegex`, `alphaRegex`, and `numericRegex`.
117109

118110
## Callback notification
119111
On completion of a transaction you can get a payment notification ([IPN](https://www.x.com/developers/paypal/documentation-tools/ipn/integration-guide/IPNIntro)) on a callback URL you specify using the `data-callback` attribute. An [IPN simulator](https://developer.paypal.com/webapps/developer/applications/ipn_simulator) is available on the sandbox.

0 commit comments

Comments
 (0)