You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-25Lines changed: 14 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -106,34 +106,23 @@ All of PayPal's [HTML button variables](https://developer.paypal.com/webapps/dev
106
106
*`data-style` The style of the button. Can be set to `primary` (default) and `secondary`.
107
107
*`data-locale` The desired locale of the PayPal site.
108
108
*`data-callback` The IPN notify URL to be called on completion of the transaction.
109
-
*`data-env` The PayPal environment to checkout in, e.g. `sandbox` (defaults to 'www').
109
+
*`data-host` The PayPal host to checkout in, e.g. `www.sandbox.paypal.com` (defaults to 'www.paypal.com').
110
110
*`data-type` The type of button to render. `button` for a plain button (default), `form` to create a button with a PayPal Payments Standard HTML form, or `qr` to create a PayPal Payments Standard compatible QR code.
111
111
112
112
113
-
### Editable fields
114
-
Creating editable fields is easy! Just add `-editable` to the name of your variable, e.g. `data-quantity-editable`, and an input field will magically appear for your users.
113
+
### Editable inputs
114
+
Creating editable inputs is easy. Just add `-editable` to the name of your variable, e.g. `data-quantity-editable`, and an input field will magically appear for your users.
115
115
116
116
117
-
### Custom fields
118
-
You can also add custom text fields and dropdowns to your form.
117
+
### Options fields
118
+
Allow the user to choose from multiple options with the following sytax:
On completion of a transaction you can get a payment notification ([IPN](https://developer.paypal.com/docs/classic/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.
139
128
@@ -142,22 +131,22 @@ On completion of a transaction you can get a payment notification ([IPN](https:/
142
131
143
132
### Localization
144
133
* Changing the default language of a button can be done by setting the variable `data-lc` with the correct locale code, e.g. es_ES.
145
-
* Changing the default input labels of editable buttons can be done by overriding the default configuration, e.g. PAYPAL.apps.ButtonFactory.config.labels.
134
+
* Changing the default input labels of editable buttons can be done by overriding the default configuration, e.g. `paypal.button.config.labels`.
146
135
147
136
148
137
### JavaScript API
149
138
There's even a fancy JavaScript API if you'd like to pragmatically create your buttons.
150
139
151
-
**PAYPAL.apps.ButtonFactory.config**
152
-
This can be overridden to change the default behavior of the buttons.
Creates and returns an HTML element that contains the button code.
156
142
> **business** - A string containing either the business ID or the business email
157
143
> **data** - A JavaScript object containing the button variables
158
-
> **type** - The buttontype, e.g. "buynow", "cart", "qr"
144
+
> **config** - A configuration object for the button. Possible settings are `button`, `type`, `style`, `size`, and `host`
159
145
> **parentNode** - An HTML element to add the newly created button to (Optional)
160
146
147
+
**paypal.button.process(node)**
148
+
Parses `node` and automatically runs `paypal.button.create` on any `<script>` element it finds matching the right criteria. This is called automatically on `document.body`.
149
+
161
150
162
151
## Browser support
163
152
The JavaScript buttons have been tested and work in all modern browsers including:
0 commit comments