Plugin Directory

Changeset 632554

Timestamp:
12/01/2012 04:20:03 AM (12 years ago)
Author:
logikal16
Message:

Stripe Donations 1.0.2

Location:
stripe-donations/trunk
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • stripe-donations/trunk/index.php

    r632536 r632554  
    44Plugin URI: https://uproot.us/
    55Description: Accept donations on your site using Stripe.
    6 Version: 1.0.1
     6Version: 1.0.
    77Author: Matt Gibbs
    88Author URI: https://uproot.us/
     
    133133        $amount = isset($atts['amount']) ? $atts['amount'] : '1000';
    134134    ?>
     135
     136
     137
     138
     139
     140
     141
    135142    <script>
    136143    (function($) {
     
    142149                    'amount': $(this).attr('data-amount')
    143150                };
     151
     152
    144153                $.post('<?php echo admin_url('admin-ajax.php'); ?>', data, function(response) {
    145                     console.log(response);
     154                    (response);
    146155                });
    147156            });
     
    153162        data-amount="<?php echo $amount; ?>"
    154163        data-label="Donate"></script>
     164
    155165    <?php
    156166        return ob_get_clean();
     
    178188        $token = isset($_POST['token']) ? $_POST['token'] : '';
    179189        $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!');
    186202    }
    187203}
  • stripe-donations/trunk/readme.txt

    r632537 r632554  
    22223. Add `[ssd]` or `[ssd amount="500"]` to your pages!
    2323
    24 Note that the donation amount is in pennies. For a $5 donation, the shortcode amount is `500`. For $25, the amount is `2500`.
     24Note that the donation amount s. For a $5 donation, the shortcode amount is `500`. For $25, the amount is `2500`.
    2525
    2626== Changelog ==
     27
     28
     29
     30
     31
    2732
    2833= 1.0.1 =
Note: See TracChangeset for help on using the changeset viewer.