Changeset 632554
- Timestamp:
- 12/01/2012 04:20:03 AM (12 years ago)
- Location:
- stripe-donations/trunk
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
stripe-donations/trunk/index.php
r632536 r632554 4 4 Plugin URI: https://uproot.us/ 5 5 Description: Accept donations on your site using Stripe. 6 Version: 1.0. 16 Version: 1.0. 7 7 Author: Matt Gibbs 8 8 Author URI: https://uproot.us/ … … 133 133 $amount = isset($atts['amount']) ? $atts['amount'] : '1000'; 134 134 ?> 135 136 137 138 139 140 141 135 142 <script> 136 143 (function($) { … … 142 149 'amount': $(this).attr('data-amount') 143 150 }; 151 152 144 153 $.post('<?php echo admin_url('admin-ajax.php'); ?>', data, function(response) { 145 console.log(response);154 (response); 146 155 }); 147 156 }); … … 153 162 data-amount="<?php echo $amount; ?>" 154 163 data-label="Donate"></script> 164 155 165 <?php 156 166 return ob_get_clean(); … … 178 188 $token = isset($_POST['token']) ? $_POST['token'] : ''; 179 189 $amount = isset($_POST['amount']) ? $_POST['amount'] : 0; 180 $charge = Stripe_Charge::create(array( 181 'card' => $token, 182 'amount' => $amount, 183 'currency' => 'usd', 184 )); 185 exit; 190 try { 191 $charge = Stripe_Charge::create(array( 192 'card' => $token, 193 'amount' => $amount, 194 'currency' => 'usd', 195 )); 196 } 197 catch (Stripe_Error $e) { 198 die($e->getMessage()); 199 } 200 201 die('Your payment has been sent. Thank you for your donation!'); 186 202 } 187 203 } -
stripe-donations/trunk/readme.txt
r632537 r632554 22 22 3. Add `[ssd]` or `[ssd amount="500"]` to your pages! 23 23 24 Note that the donation amount is in pennies. For a $5 donation, the shortcode amount is `500`. For $25, the amount is `2500`.24 Note that the donation amount s. For a $5 donation, the shortcode amount is `500`. For $25, the amount is `2500`. 25 25 26 26 == Changelog == 27 28 29 30 31 27 32 28 33 = 1.0.1 =
Note: See TracChangeset
for help on using the changeset viewer.