Support » Plugin: WordPress Auction Plugin » PayPal sandbox integration

  • Resolved jwest100

    (@jwest100)


    Hi,
    Thanks for a great plugin!

    In order to test auction payments through the PayPal sandbox, I need to add “sandbox” into the button code the plugin generates for the payment button.

    Example:
    -LIVE PayPal link to payment page would be https://www.PayPal.com + account to be paid email address + auction data etc.

    -SANDBOX PayPal link to payment page would be https://www.sandbox.paypal.com + sandbox account to be paid email address + auction data etc.

    Can you tell me where in the code (file name and line number) I can temporarily edit in the two changes necessary to use my sandbox account?

    BTW–This would be a great thing to add in the auction settings forms to make it easy to test PayPal payments before going live. All you would need is a radio button pair to select “live” or “sandbox” and a text box for the sandbox facilitator email address that PayPal generates. Then substitute those form values in your code accordingly.

    As it is now, I’ll have to hard code the values into your code to make it work. Which is why it would be very helpful if you could tell me where that part of your code exists 🙂

    Can ya help a brother out? 🙂

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author owencutajar

    (@owencutajar)

    Hey there,

    There’s only one place you need to change, inside wp_auctions.php, inside a function called check_auction_end. The code you’re looking for is:

    switch ($payment_method) {
    case “paypal”:
    $payment = “\n\nYou can pay for the auction by clicking on the link below:”;
    $payment .= “\n\nhttps://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=”.urlencode($paypal).”&item_name=”.urlencode($rows->name).”&amount=”.urlencode($rows->winning_price).”&shipping=”.urlencode($shipping_price).”&no_shipping=0&no_note=1&currency_code=”.$currencycode.”&lc=GB&bn=PP%2dBuyNowBF&charset=UTF%2d8″;
    break;

    Good idea re the sandbox option. Hasn’t been requested before, but we’ll add it on to our wish list for the next update

    Regards

    Owen

    jwest100

    (@jwest100)

    Thanks much Owen! You saved me a ton of time checking through files. Have a wonderful holiday season 🙂

    Plugin Author Weborithm

    (@weborithm)

    @jwest100 Hope it works out for you, please do leave a review for us when you get some time. Thanks!

    https://wordpress.org/support/plugin/wp-auctions/reviews/#new-post

    I also need to know where to use get_the_id() from the post where the auction is inserted. Any ideas??

    Plugin Author owencutajar

    (@owencutajar)

    Hi there,

    Not sure what you’re referring to. The get_the_id() function returns the post/page the auction is embedded in (unless you’re using the popup version). This will not give you any auction details. We use a separate ID for that.

    Regards

    Owen

    The id of the post the auction is in IS what I want 🙂 where in your code can I grab that?

    I need to grab the postid of the auction post because I pass it to the PayPal button as an item number. PayPal then passes it back to me upon completion of payment. With that I locate the post, hide the auction, and display “sold”.

    Plugin Author owencutajar

    (@owencutajar)

    The link you need is prepared just before the Paypal line I pointed you at before:

    // prepare link
    if (strlen($rows->staticpage) > 0) {
    $link = $rows->staticpage.”?auction_id=”.$auction_id;
    } else {
    $link = get_option(‘siteurl’).”?auction_to_show=”.$auction_id;
    }

    $link contains the URL where the auction is being shown. The code there caters both for in-page auctions (where a page is set as part of the auction definition) and for the popup style auction (where the widget is used to display the auctions).

    get_the_id() doesn’t make sense in this context on it’s own, as one particular page/post can be used to display any auction in the system.

    Hope this makes sense,

    Owen

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘PayPal sandbox integration’ is closed to new replies.