Plugin Directory

Changeset 623742


Ignore:
Timestamp:
11/11/2012 05:42:46 PM (13 years ago)
Author:
hccoder
Message:

Added return URL and cancel URL support to shortcodes.

Location:
paypal-express-checkout/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • paypal-express-checkout/trunk/classes/paypalapi.php

    r620951 r623742  
    11<?php
     2session_start();
     3
    24/**
    35 * PayPal API
     
    4345        $fields['PAYMENTREQUEST_0_DESC'] = $_POST['PAYMENTREQUEST_0_DESC'];
    4446     
     47      if ( isset($_POST['RETURN_URL']) )
     48        $_SESSION['RETURN_URL'] = $_POST['RETURN_URL'];
     49     
     50      if ( isset($_POST['CANCEL_URL']) )
     51        $fields['CANCELURL'] = $_POST['CANCEL_URL'];
     52     
    4553      if ( isset($_POST['PAYMENTREQUEST_0_QTY']) ) {
    4654        $fields['PAYMENTREQUEST_0_QTY0'] = $_POST['PAYMENTREQUEST_0_QTY'];
  • paypal-express-checkout/trunk/form-handler.php

    r620429 r623742  
    11<?php
     2session_start();
    23/**
    34 * Form posting handler
     
    89if ( isset($_GET['func']) && $_GET['func'] == 'confirm' && isset($_GET['token']) && isset($_GET['PayerID']) ) {
    910  HCCoder_PayPalAPI::ConfirmExpressCheckout();
     11 
     12  if ( isset( $_SESSION['RETURN_URL'] ) ) {
     13    $url = $_SESSION['RETURN_URL'];
     14    unset($_SESSION['RETURN_URL']);
     15    header('Location: '.$url);
     16    exit;
     17  }
     18 
    1019  if ( is_numeric(get_option('paypal_success_page')) && get_option('paypal_success_page') > 0 )
    1120    header('Location: '.get_permalink(get_option('paypal_success_page')));
  • paypal-express-checkout/trunk/readme.txt

    r621748 r623742  
    55Requires at least: 3.0.0
    66Tested up to: 3.4.2
    7 Stable tag: 2.1.0
     7Stable tag: 2.1.1
    88
    99Easily add PayPal express checkout possibility to your WordPres powered blog. You can configure all options on WP Admin interface.
     
    2828* specifiy shipping amount
    2929* specifiy item quantity
     30* return URL
     31* cancel URL
     32
     33= System requirements =
     34* PHP session support
     35* PHP cURL library
    3036
    3137== Installation ==
     
    5662== Changelog ==
    5763
     64= 2.1.1 =
     65* Now you can define return and cancel URL in shortcode
     66* Tested with WordPress 3.5 Beta 2 and works fine
     67
    5868= 2.1.0 =
    5969* Error handling extended
  • paypal-express-checkout/trunk/views/adminshortcode.php

    r620951 r623742  
    3838      [paypal amount=10 currency=USD description="Buying item SKU: QUANTITY = 4" qty=4]
    3939    </p>
     40   
     41    <h3>Example #5</h3>
     42    <p><i>Add custom return and cancel URL to your buttons.</i></p>
     43    <p>
     44      [paypal amount=10 currency=USD return_url="http://hccoder.info/" cancel_url="http://www.google.com"]
     45    </p>
    4046  <?php } ?>
    4147</div><!-- .wrap -->
  • paypal-express-checkout/trunk/views/frontendshortcode.php

    r620951 r623742  
    2222  <?php } ?>
    2323 
     24  <?php if ( isset($atts['return_url']) ) { ?>
     25    <input type="hidden" name="RETURN_URL" value="<?php echo $atts['return_url']; ?>" />
     26  <?php } ?>
     27 
     28  <?php if ( isset($atts['cancel_url']) ) { ?>
     29    <input type="hidden" name="CANCEL_URL" value="<?php echo $atts['cancel_url']; ?>" />
     30  <?php } ?>
     31 
    2432  <input type="hidden" name="func" value="start" />
    2533  <input type="submit" value="Pay with PayPal" />
Note: See TracChangeset for help on using the changeset viewer.