Add this to your child theme / plugin functions.php. I think this should do the trick. Let me know
function your_meta_callback( $post ) {
echo Paypal_payment_accept();
}
add_meta_box( 'your_meta', __( 'Meta Box Title', 'your-textdomain' ), 'your_meta_callback', 'your-posttype-name', 'side' );
For more information see WordPress Codex on add_meta_box().
Update:
Ok I have looked into this. If we nest any form into the post editor form, we will run into problems as there will be two submits and other things. So the best approach would be to use a modal (native jQuery popup of WordPress). So based on your source code from the comment I would change it to be the following:
function wpt_article_pay() {
global $pagenow,$typenow;
//Enqueue the required script to use a modal
add_thickbox();
//Check if you are on the correct page
if (!in_array( $pagenow, array( 'post.php', 'post-new.php' ) ))
return;
/* Add a link to open the modal (uses the inlineID) to open the code we
later add in the footer */
echo '<a href="#TB_inline?height=155&width=300&inlineId=your-paypal-modal" class="thickbox">PayPal</a>';
}
//Enqueue the inline form to be displayed in the modal.
function enqueue-your-paypal-modal(){
global $pagenow,$typenow;
if (!in_array( $pagenow, array( 'post.php', 'post-new.php' )))
return;
?>
<div id="your-paypal-modal" style="display:none">
<?php echo paypal_payment_accept(); ?>
</div>
<?php
}
add_filter('admin_footer','enqueue-your-paypal-modal');
This will ensure that you have a working paypal button, but it WONT have the correct return URL defined as you can only define one in the Plugin settings. As well you can’t define that it should open in a new window. I don’t know if you feel comfortable enough to do this, but I would suggest to look into the button API of paypal and maybe create the button yourself: https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/ProfileAndTools/#id08A9E900IEX