Paypal Framework

For subscriptions the method should be CreateRecurringPaymentsProfile and you still have to send trough all those CC parameters. to get a better understanding take a look at PayPal API Subscriptions which is a bit outdated but the code part of the API call is still relevant.

Paypal buttons disappear in the text editor

Elements like these (PayPal buttons), should not be inserted as page content in the editor, but in your WordPress template files. I assume you are developing your own WordPress theme! If not, you can modify an existing shipped WordPress theme such as the Twenty Eleven WordPress theme. Depending on the placement of the button, you … Read more

Redirect user if the referrer is not PayPal related

What you do is you pass an argument to the Paypal’s return URL. For example: So your return URL may look like this: $url = home_url(); $url = add_query_arg( array( ‘paypal’ => ‘8832002472223abc’ ), $url ); $paypal_ipn = array( ‘return_url’ => $url // rest of your ipn data ) In your IPN template, you can … Read more

WordPress and IPN problem

First of all, is better use get_template_directory_uri() instead of bloginfo(… <input type=”hidden” name=”notify_url” value=”<?php echo get_template_directory_uri(); ?>/ipn.php”> but you are right if you think the problem is not this one. I cannot be sure, but I bet your problem is here: include_once( $_SERVER[‘DOCUMENT_ROOT’] . ‘/wp-load.php’ ); This is a problematic way to include wp-load.php, but … Read more

Making the ‘add to cart’ button redirect to PayPal

A solution can be found in the function woocommerce_add_to_cart_action. We have to chain two filters. In the first, we check for the product ID, if it’s one of a list we add the redirect. add_action( ‘woocommerce_add_to_cart_validation’, ‘check_ids_wpse_119466’, 10, 3 ); function check_ids_wpse_119466( $true, $product_id, $quantity ) { # Not our products, bail out # Adjust … Read more

Problem with wp_insert_post

Because you mention an infinite I am guessing that you are hooked into a hook like save_post that fires for wp_insert_post() so if you hook your code into that your code will run then fire the same hook over and over. To avoid that remove the action from the top of your callback: remove_action(‘save_post’,’yourcallbackfunctionname’); $my_post … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)