moneybookers getting params from cancel_url - php

I am integrating my system with moneybookers and I have one question. Is it possible to get a transaction_id from a cancel_url? Does anybody know if cancel_url comes with any parameters like return_url (moneybookers documentation says nothing about it)? I need this because I want to show the user for which payment the problem occurred.
Thanks in advance for your help.

I would have thought not because if the user cancels, then there's no transaction.
This falls on your side, where you'll need to create an order in your database when a user clicks checkout, and then have your Moneybookers callback update the order based on the order ID.
With PayPal, you can send custom fields with a payment request which is commonly used to send the order ID on your site; I assume there's something similar with Moneybookers.

Related

Passing a custom variable from a PayPal button after a user subscribes

I am working on a subscription service for a test website of mine. I have the infrastructure in place so that when a user registers, they need to subscribe before going to their profile. How can I tell if a user has finished subscribing? I have a flag in my database that will turn to true after they subscribe, but I can't seem to figure out that last handshake.
I tried to set it up when making the button to go to "http://www.example.com/profile.php?completed=true" so that I can simply look for that completed variable, but paypal seems to ignore that. Any thoughts on how to do that?
Upon looking at a similar post on here, I could redirect to a success.php, where it can update the database flag. This is a work around, but is this the only solution? Or is there one similar to what I originally wanted to do? Thanks for your input everyone.
You should make use of Instant Payment Notification
Instant Payment Notification (IPN) is a message service that automatically notifies merchants of events related to PayPal transactions. Merchants can use it to automate back-office and administrative functions, like automatically fulfilling orders and providing customers with order status.

How can I link PayPal PDT transaction to specific order?

I see many examples of how to display transaction information to a user with PDT. I cannot find a way to associate a Paypal payment with a specified ID so that when the transaction is completed, I can update that ID in the database as paid.
How am I supposed to get an ID that I specify back from Paypal so I know what the payment is for? I cannot use the email address or name or anything else. It must be an ID that I specify.
I see some people using item_number, but I am using a Paypal encrypted button so I cannot add on form variables to post to Paypal when the user clicks the pay now button.
I see this on websites all the time, so I know there must be some way to do this. I just can't find it anywhere...
Thank you
Most often people encrypt their own buttons and use either the custom field which gets sent pack to you, or the item number field. Look into how to encrypt your own buttons with PHP.
PayPal offers a sample in their SDK which can be found here.
I stumbled upon this excellent piece that succinctly lays out how to make dynamic encrypted paypal buttons. It is just what I needed. Thanks for pointing me in the right direction!
http://www.stellarwebsolutions.com/en/articles/paypal_button_encryption_php.php

The transaction id (txn_id) in Paypal IPN is not the same as on the invoice?

I'm using PayPal on a website that I'm currently working on and everything works correctly: user is sent to paypal, pays, and comes back and IPN validation is working perfectly.
The only thing is that I noticed, using the sandbox, that the transaction number given to the buyer is not the same as the one I get in the IPN data (txn_id). I'm wondering how am I supposed to help a customer on my website if he gives me the confirmation number he got on his invoice and it's not the same as in PayPal's system? Is there something that I missed in my IPN scripting that would allow me to get that same information? I didn't see anything about that in the documentation and I'm probably not the first developer who notices that...
Thanks for any kind of help you can give me.
A seller's transaction ID is different from a buyer's transction ID, since they're two different actions (one debit, one credit).
See from
PayPal IPN unique identifier

PayPal IPN returning a shopping cart or order ID for post-processing

I have successfully posted my custom shopping cart to PayPal -- it processes the order just beautifully, and when the payment is received, it posts data back to the URL I specified in the config. The code is based on the library found here: http://www.phpfour.com/blog/2009/02/php-payment-gateway-library-for-paypal-authorizenet-and-2checkout/
So I'm successfully verifying the IPN by posting data back to PayPal -- that is all great. Here's my dilemma -- how do I know what order the IPN is confirming?
I am not making use of PayPals shopping cart, I have my own. It has it's own cart ID in my database, and when I receive an IPN for that cart, I'd like to "close" the cart and save it as an order to be looked up at a later date.
I've tried passing an additional custom field along with the redirect to PayPal that populates the cart, but that value isn't returned back to me in the IPN. The documentation on x.com is just plain lacking so I've found no help there.
Does anyone have any experience with PayPal and IPN? Doesn't necessarily have to be with PHP -- I can interpret code -- but if you have a way to send a value to PayPal with an order and then have that value returned with the IPN, that is AWESOME!
If this isn't possible with PayPal's API (which I would find hard to believe) -- any other suggestions on how to handle this?
I do not know if this is a good idea or not, but here are a couple different options:
A: Use the first set of on1 / os1 for the item 1 and add the order id to that.
B: In the custom field, I am not sure what you have in there, but you can make it something like orderidhere41|otheritems here and then just parse this out by exploding at the | to get them separated.
Paypal does limit this, and I do not know why, but both of those should work. Doing it as an on / os will put it on the paypal receipt for the user, so that is my preferred method.
If someone else has a better solution, I would be interested in it as well!
EDIT:
Clarifying on1 os1. These are "options" generally used for Size / color etc. See IPN PDT Paypal variables under option_name1 option_selection(sp) for more information on them. The name of course is the title which would be "Order ID" the os would be the actual id.
EDIT:
Looking through that documentation $my2CO->addField('cart_order_id', rand(1, 100)); is where I would put my own cart order id. That should be the correct field. Sorry for the confusion :)
EDIT:
In the end there is a custom field for the paypal IPN, called "custom" adding data to this will pass through, this will transfer the orderid for you to and from. It must be called custom on both sides.
(this may be different for the other API's).
My experience has been with the Express checkout via C#, but the process should be the same even in PHP. If you're using the Name-Value Pair (NVP) interface right before you redirect the user to PayPal you hit the PayPal site to retrieve the redirection URL. As part of their response they pass back a token to you. You save this token along with your order. When the IPN postback occurs you get this same token back which lets you look up the original order.
The process flow looks like this ("You" being your site):
User fills cart, clicks button/link to check out
Request is sent to your site
Your site receives request, sends data to PayPal
You get an initial response from PayPal which contains a token
You save this token along with this user's shopping cart.
You redirect the user to the link returned by PayPal
User is redirected to PayPal and enters payment info
Payment info is validated by PayPal
User is redirected back to your site
PayPal sends IPN response back to your site
You grab the token included in the response
You look up the token you previously saved to find the shopping cart (they are the same value)
You close out the initial order/shopping cart.
You might want to try out the PHP SDK - scroll down to the Name-Value Pair Interface.
I very much doubt this will help the original poster, but PayPal have either added, or finally documented the option "invoice" which allows you to post the OrderID, and have it posted back via the IPN.
I am currently using this and it seems to work as expected.
For further info see the Website Payments Standard Integration Guide (PDF): Appendix A, Table A.4
You can create and post a custom pass-through variable that's 255 characters long that could hold any data. More info on page 44 in the official Paypal IPN Guide.

how can i use Paypal for premium section of my site and deal with premium vs normal users?

I want to achieve something like this
http://depositfiles.com/en/gold/payment.php
I have normal users signed up. I want them to upgrade to premium user. Once a person pays, how do I know which user he was signed in ? How do i force the user to login first before being able to click the paypal button and make payment ? Otherwise, I would receive money, but wouldn't know which user to mark as "PAID" in my database.
when you click on the paypal button, it redirects you to the paypal page where you can login and pay.
I also want to accept Visa and Mastercards, is it doable through paypal using the same method ?
Paypal's information can be found here:
Part 1
You can create a subscribe button for each type of subscription you want and use the HTML variables in Part 2 to enable you to know what type of product and what user is included in the invoice.
This needs a lot more details than you currently provide. What language have you written your website in? Static HTML? Ruby? PHP? How does PayPal's payment system work?
normally the way it will work is that your site will pass information to paypal (http://paypal.sourceforge.net/ is one toolkit that seems to be made for php, thought I've never used it so I can't really promise its not abandonware).
once the paypal transaction is completed successfully, control is passed back to your site. you can then set the user's flag in your database as a premium user.
as far as I can tell, you tell paypal to handle payments for you, and the user picks a funding source in paypal. if you want to have visa/mastercard separately handled from paypal you'll need another payment gateway to handle it, like mirapay or something else.

Categories