Hello everyone. I'm trying to figure out if it would be possible to have a code that would check for the Payer Status and if it's verified accept the order, and if not throw an error message and not charge the paypal account, maybe on the checkout_success page?
I use a combination of codes to display different messages/hide checkout button depending on my store's needs. This below is the code currently on the page:
PHP Code:
<?php
if (!IS_ADMIN_FLAG) {
global $order, $db;
if (($order->info['total'] < MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN) && (substr_count($_SESSION['shipping']['id'], 'freeoptions') !=0)) {
echo '<div style="border: 3px solid #777777; padding: 10px 0;"><p style="text-align: center;"><strong>Your order no longer qualifies for Free Shipping.</strong></p>
<p style="text-align: center;"><strong>The total for your order is below the minimum qualifying for Free Shipping.</strong></p>
<p style="text-align: center;"><strong>Please head back to the - <a href="index.php?main_page=shopping_cart">SHOPPING BAG</a> - to increase the quantity of products in your bag, add more products or select
a different shipping option.</strong></p>';
echo'<span id="opc-order-confirm"></span>';
} else {
?>
<?php
if ($_SESSION['payment'] == 'paypalwpp') {
// do something
echo '<div class="buttonRow">' . TITLE_CONTINUE_CHECKOUT_PROCEDURE . '</div>';
} else {
// do not do something
} ?>
<div class="buttonRow"><?php echo TEXT_CONTINUE_CHECKOUT_PROCEDURE; ?></div>
<div class="buttonRow confirm-order"><?php echo zen_image_submit(BUTTON_IMAGE_CONFIRM_ORDER, BUTTON_CONTINUE_CHECKOUT_CONFIRMATION_ALT, 'name="btn_submit" id="btn_submit"') ;?></div>
<?php } } ?>
The first block hides the checkout button and displays a message if the order total is below the free shipping threshold. The second displays a message if paypal is selected as a method of payment, instructing them we do not accept paypal payments if account is unverified, which has been an issue.
I thought I could add a code to the paypal portion to establish if the paypal account is verified or not, but that wouldn't work, since the login to the customer's paypal account isn't established until they actually click the checkout button.
So I thought perhaps a piece of code in the checkout_success might work instead(?) but then the issue is the paypal account at that point is already charged and not much we can do.
So far what we've been doing is cancelling the orders from unverified accounts, which is a pain.
I guess my question is, is it possible for orders paid with paypal, to get pre-verified before reaching paypal and charging the account, and if the user's account is unverified, throw an error message and not charge the paypal account?
Thank you for the help.
Bookmarks