Passing custom field to PayPal
-
I’ve looked through the code and don’t see a way to pass a custom field to PayPal. It would be useful (well, to me anyway) if we were able to take advantage of the Paypal API ‘custom’ field for pass through variables in the IPN. For example, if we add:
if(isset($atts['currency']) && !empty($atts['currency'])) { $currency = $atts['currency']; $button_code .= '<input type="hidden" name="currency_code" value="'.$currency.'">'; }
to the function
wp_paypal_get_buy_now_button($atts)
function, and update the shortcode as[wp_paypal button="buynow" name="myname" amount="myamount" no_shipping=1 quantity="myquantity" custom="myinvoiceid" return="myurl"]
then Paypal returns the custom field in the IPN. This is great as it allows one to tie an IPN response to a specific transaction/database record for backend processing e.g. sending confirmation emails to customers with download links, updating transaction status records, etc.
I’ve seen a few other questions regarding things like automatic email confirmations to purchasers and the response that it wasn’t currently available. Now that you are making the IPN response available via a hook, providing a custom field would be very handy.
Thanks for listening to my feature request. If there’s another way to do this already and I’m just looking over it, please let me know! Cheers
- The topic ‘Passing custom field to PayPal’ is closed to new replies.