Passing custom variables to paypal IPN using API - paypal

I am using paypal API for subscription.
I Want to pass custom variable in IPN like user id so that I can save the id in database and show user only his transactions.

There are a couple of ways you could do that.
If you have an invoice ID of some sort that's already related back to your customer then you could just pass that invoice ID into the INVNUM parameter of your API request. That way it will come back in the "invoice" parameter in IPN, and then you can use your existing relationships to pull back out your customer ID and save the new transaction for that customer ID.
Alternatively, you could just use the CUSTOM parameter in your API requests which allows you to pass any string you want up to 256 characters. If that one value is all you need then you could just store it alone and pull it out of IPN using the "custom" parameter there. If you need to pass more than 1 custom value you could include them all in a string like "val1|val2|val3|etc" and parse that out of the custom parameter that IPN sends you.

Related

Paypal pass-through variable?

I have looked at the paypal documentation and this one.
It seems pass-through variables only have 3:
custom
item_number or item_number_x
invoice
I want to use custom, but it is already used by one of the plugin. (I am using joomla)
Is there any variable that I can use as pass-through variable?
I would recommend saving any data you need to the order (I'm assuming you're using VirtueMart on Joomla..??)
Then you can pass that order ID into the invoice parameter, and then pull data back out of the order that you need based on that order ID.
If you're using VirtueMart it would be the same flow. Just save all the data you need to your order/invoice record, then pull it back out when you need it based on the invoice value PayPal has.

Paypal payment response without IPN listener?

I'm adding very simple membership renewal functionality to a web site using PayPal Payments Standard buttons. We only have 300 or so members, so a simple e-comm solution like this should work fine.
I'd like to capture some sort of confirmation that I can then capture on my end so that I can insert it into the database. I've seen the IPN listener method, but it seems more complex than I really need - all I really need is to pass the confirmation code via a URL variable in the return URL, i.e. http://www.example.com/landing?transactionid=abc123. Is this possible? Also, is there a way to pass my own dynamic variable (for instance, a membership ID) into the form and have that be a part of the return string?
Thanks
An alternative is to use express checkout which is a two step process requiring pre-authorization and then charging a customer. If you are accepting echecks you will eventually need to use IPN to update the original transaction. You can pass a dynamic variable using the custom field in Paypal.
Either way one of the two methods is required to process a transaction securely - what is stopping someone from typing the URL you are suggesting?

PayPal Auto Return Values

How do I send my own transaction ID with the original post and have PayPal return that variable with Auto Return values? I have turned on Auto Return and I have the transaction ID.
Within your PayPal Standard code, add the invoice parameter and set it to your custom ID value. That value will then come back in PDT / IPN so you can use it accordingly.
If you're going to be doing any post-payment processing (ie. updating database, sending email notifications, etc.) you'll want to use IPN for that instead of PDT. Even with Auto-Return enabled there is no guarantee the user will make it back to your return URL, so then whatever code you have there wouldn't run.

Paypal Notify_url with custom param

As all we know there is a custom param that allow us to retrieve custom data when an ipn notification come from paypal.
But also, I am using a couple of params in the notify_url, and those params sometimes get lost, and when paypal send to me the ipn notification, it comes without one of those params. The strange thing is that one of the param come correctly.
So, first question is: Can I use custom params in the notify_url like:
notify_url = "www.mydomain.com/paypal/ipn/?param1=one&param2=two"
I suppose that I can do it, because it fails 1 in 20 times on my application, so I do not know if it is because it is not supported by some browsers or something like that, or maybe it is a bad habit I should quit.
And sometimes paypal send the ipn notification to:
notify_url = "www.mydomain.com/paypal/ipn/?param1=one"
Without the second param...
And if I can do it, do you have any clue about what it is happening here...
Thanks!
I always avoid sending data to IPN as URL parameters. There are various reasons it may not come through, which means there's no guarantee it'll work correctly every single time.
Instead, use the CUSTOM parameter like you said. If you need to pass more than a single value you can send it as an NVP string just like you would on your URL. Then just parse those values back out of the CUSTOM value within your IPN script.
Alternatively, you could save all of the data you're going to need in your database and then send the record ID in the CUSTOM parameter over to PayPal. Or you could use the INVNUM parameter if that makes sense for you.
Then in your IPN script you pull that data back out of the database based on that record ID. This way you're always sure you'll have it available and won't have to worry about losing URL params along the way.

How to generate unique payment URL using Paypal?

I'm trying to work out how I can generate a unique payment token that I can redirect users to so they can pay for a digital item.
I think the Button Manager SDK is what I need. However, I can not see how I can set the receiver email? For a particular item, there is a different receiver and I want to dynamically set this.
However, it seems I just have to set my credentials as the receiver. I want to use many receivers for different items rather than one sdk config file.
What I currently use is simply a HTML Paypal button but I'd rather dynamically create a unique URL to redirect a user to stop users tampering with things.
Have you considered the Express Checkout API? -- (perhaps with SOLUTIONTYPE=Sole to allow guest checkout?)
I believe it's a better tool for this job; token redirection is a core feature of EC.