| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -55,9 +55,9 @@ Subscribe buttons let you set up payment subscriptions. | |||
| 55 | 55 | <script src="paypal-button.min.js?merchant=YOUR_MERCHANT_ID" | |
| 56 | 56 | data-button="subscribe" | |
| 57 | 57 | data-name="My product" | |
| 58 | - data-a3="1.00" | ||
| 59 | - data-p3="1" | ||
| 60 | - data-t3="M" | ||
| 58 | + data-amount="1.00" | ||
| 59 | + data-recurrence="1" | ||
| 60 | + data-period="M" | ||
| 61 | 61 | ></script> | |
| 62 | 62 | ``` | |
| 63 | 63 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,7 +17,9 @@ PAYPAL.apps = PAYPAL.apps || {}; | |||
| 17 | 17 | prettyParams = { | |
| 18 | 18 | name: 'item_name', | |
| 19 | 19 | number: 'item_number', | |
| 20 | - lang: 'lc' | ||
| 20 | + lang: 'lc', | ||
| 21 | + recurrence: 'p3', | ||
| 22 | + period: 't3' | ||
| 21 | 23 | }, | |
| 22 | 24 | buttonImgs = { | |
| 23 | 25 | buynow: '//www.paypalobjects.com/{locale}/i/btn/btn_buynow_{size}.gif', | |
@@ -83,6 +85,12 @@ PAYPAL.apps = PAYPAL.apps || {}; | |||
| 83 | 85 | // Subscribe buttons | |
| 84 | 86 | } else if (type === 'subscribe') { | |
| 85 | 87 | data.add('cmd', '_xclick-subscriptions'); | |
| 88 | + | ||
| 89 | + // TODO: "amount" cannot be used in prettyParams since it's overloaded | ||
| 90 | + // Find a better way to do this | ||
| 91 | + if (data.items.amount && !data.items.a3) { | ||
| 92 | + data.add('a3', data.items.amount.value); | ||
| 93 | + } | ||
| 86 | 94 | // Buy Now buttons | |
| 87 | 95 | } else { | |
| 88 | 96 | data.add('cmd', '_xclick'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -113,11 +113,10 @@ <h2>Subscribe (Small)</h2> | |||
| 113 | 113 | <script src="../src/paypal-button.js?merchant=6XF3MPZBZV6HU" | |
| 114 | 114 | data-button="subscribe" | |
| 115 | 115 | data-name="Subscribe!" | |
| 116 | - data-amount="1.00" | ||
| 117 | 116 | data-size="small" | |
| 118 | - data-a3="1.00" | ||
| 119 | - data-p3="1" | ||
| 120 | - data-t3="M" | ||
| 117 | + data-amount="1.00" | ||
| 118 | + data-recurrence="1" | ||
| 119 | + data-period="M" | ||
| 121 | 120 | ></script> | |
| 122 | 121 | </div> | |
| 123 | 122 | ||
@@ -127,7 +126,8 @@ <h2>Subscribe (Large)</h2> | |||
| 127 | 126 | data-button="subscribe" | |
| 128 | 127 | data-name="Subscribe!" | |
| 129 | 128 | data-amount="1.00" | |
| 130 | - data-size="large" | ||
| 129 | + data-recurrence="1" | ||
| 130 | + data-period="M" | ||
| 131 | 131 | ></script> | |
| 132 | 132 | </div> | |
| 133 | 133 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments