Your account is limited to posting only in the Pre-Sales Questions forum.
Support forum access is limited to members with a purchase history.

If you are working on behalf of another member, please contact us with the name of the license holder and we will upgrade your account.
   
 
Paypal Free Orders, and other questions
Posted: 01 July 2010 02:38 PM   [ Ignore ]
Wallflower
Rank
Total Posts:  11
Joined  2010-04-08

When using the PayPal Standard gateway, after the customer has paid and is returned to this order confirmation template, the first transaction ID variable

{transaction_id}
is always empty, while the second one in between the weblog:entries contains the proper transaction id.

I have noticed in the past though, is that when I had PayPal’s auto return set to “off” and I manually clicked the “return to seller’s site” link on the final page of the PayPal transaction, that it returned me to my confirmation page with the Transaction ID displayed.

I have also notice that when I apply a coupon that makes my purchase free (the cart order total = $0.00) and I click my “Pay” button to go to PayPal—it immediately redirects to my confirmation page and presents a Transaction ID—completely bypassing PayPal. So in this case, where is the Transaction ID coming from?

[ Edited: 01 July 2010 06:43 PM by Chris Newton ]
Profile
 
 
Posted: 01 July 2010 04:07 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29
Andrew - 01 July 2010 02:38 PM

I have also notice that when I apply a coupon that makes my purchase free (the cart order total = $0.00) and I click my “Pay” button to go to PayPal—it immediately redirects to my confirmation page and presents a Transaction ID—completely bypassing PayPal. So in this case, where is the Transaction ID coming from?

Most of the payment processors won’t process a ZERO dollar transaction, so CartThrob will skip over your payment gateway if it detects a cart total of 0 and process it as a free order. The free order process generates its own transaction_id, which is just the unix time at the time of the transaction.

Profile
 
 
Posted: 01 July 2010 05:55 PM   [ Ignore ]   [ # 2 ]
Wallflower
Rank
Total Posts:  11
Joined  2010-04-08

Thanks Rob. Now, at least I know how and why my free purchase transaction id works.

But I’m still not sure how to handle the case where the user is dumped back on my site after a transaction, that is apparently complete (according to PayPal’s confirmation page), but is still “processing”. I can’t tell if my sandbox is still processing or complete because the only condition that has ever worked for me in CT has been {if authorized}, the others have never worked—even if I set PayPal to Review or fail) I’m always dumped back the same way with the {transaction_id} not displaying. Though, as I have mentioned before, if have had the transaction_id display IF I don’t enable “auto return”.

So if the payment is authorized, and PayPal says it is complete, and my page shows the confirmation info in my {if authorized} condition (and I can get the transaction id from the {order_transaction_id} tag); how can I show the user a “processing” condition and tell them that the order is not complete yet, and do not give them their license number, and do not send the confirmation email?

My goal here is sell software and give a license number out on the confirmation page + email. I’m planning on using the transaction_id as the license number because I don’t know any other way to generate the number. I also have to send the transaction_id and a few other bits of the transaction off to another server in the form of http post; I read about using CT’s authorized.php file and putting in my code their, though I have no idea how yet. After that second server has processed what I have sent, it authorizes the user+software and probably sends an email too.

Is there a simpler way to sell software and a license? How are you guys doing it on your store?

I’ve not come across any real examples yet, is anyone else doing this that would like to share some insight?

BTW I am using custom status: open|Complete|Processing|Fail|Declined|closed. Could there be an issue with that? Maybe I’m not understanding out the {authorize|decline|fail} conditions work properly.

Profile
 
 
Posted: 01 July 2010 06:48 PM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10256
Joined  2008-09-29

Let’s work through these one at a time.

Authorize / decline / fail, have nothing to do with status of entries. They’re solely to do with completion of the payment, successfully, or unsuccessfully. If the payment has been authorized, declined, or completely failed, we output those conditions.

Make sense?

 Signature 

We’re moving away from the forums, though not entirely and not immediately. Lack of support lately is coincidental to that. Unfortunately we’ve had a bad month with it, but we do not forsee that we will have any continued problems with support through our portal going forward, or on forums while we’re still transitioning. We will send out a newsletter and make additional notifications through twitter and other outlets over the coming weeks.

Moving forward; things returning to normal.

Profile
 
 
Posted: 01 July 2010 06:51 PM   [ Ignore ]   [ # 4 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10256
Joined  2008-09-29

My goal here is sell software and give a license number out on the confirmation page + email. I’m planning on using the transaction_id as the license number because I don’t know any other way to generate the number.

CartThrob can actually generate unique license numbers for you, and can lock downloads to specific members.

 Signature 

We’re moving away from the forums, though not entirely and not immediately. Lack of support lately is coincidental to that. Unfortunately we’ve had a bad month with it, but we do not forsee that we will have any continued problems with support through our portal going forward, or on forums while we’re still transitioning. We will send out a newsletter and make additional notifications through twitter and other outlets over the coming weeks.

Moving forward; things returning to normal.

Profile
 
 
Posted: 01 July 2010 06:52 PM   [ Ignore ]   [ # 5 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10256
Joined  2008-09-29

I also have to send the transaction_id and a few other bits of the transaction off to another server in the form of http post; I read about using CT’s authorized.php file and putting in my code their, though I have no idea how yet. After that second server has processed what I have sent, it authorizes the user+software and probably sends an email too.

What other system do you need to tie into? Can you provide more detail?

 Signature 

We’re moving away from the forums, though not entirely and not immediately. Lack of support lately is coincidental to that. Unfortunately we’ve had a bad month with it, but we do not forsee that we will have any continued problems with support through our portal going forward, or on forums while we’re still transitioning. We will send out a newsletter and make additional notifications through twitter and other outlets over the coming weeks.

Moving forward; things returning to normal.

Profile
 
 
Posted: 01 July 2010 07:01 PM   [ Ignore ]   [ # 6 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10256
Joined  2008-09-29

But I’m still not sure how to handle the case where the user is dumped back on my site after a transaction, that is apparently complete (according to PayPal’s confirmation page), but is still “processing”. I can’t tell if my sandbox is still processing or complete because the only condition that has ever worked for me in CT has been {if authorized}, the others have never worked—even if I set PayPal to Review or fail) I’m always dumped back the same way with the {transaction_id} not displaying. Though, as I have mentioned before, if have had the transaction_id display IF I don’t enable “auto return”.

http://cartthrob.com/tutorials/configuring_paypal_standard_for_cartthrob/

I do not recommend paypal when you need to provide instant access, because it does not handle money in real time, only TRANSACTIONS. It takes information, and returns people to your site. Please review the following, directly from the Paypal manual:

IPN is an asynchronous message service, meaning that messages are not synchronized with actions on your website. Thus, listening for an IPN message does not increase the time it takes to complete a transaction on your website.

The IPN message service does not assume that all messages will be received by your listener in a timely manner. Because the internet is not 100% reliable, messages can become lost or delayed. To handle the possibility of transmission and receipt delays or failures, the IPN message service implements a retry mechanism that resends messages at various intervals until you acknowledge that the message has successfully been received. Messages may be resent for up to four days after the original message.

Whenever a customer is directed back to your site from paypal, you should assume, that paypal has only captured the information, and NOT the money. Every time a user returns, you should always tell them that their order is processing. Essentially, the way Paypal works is that they might take days to process a transaction, where a credit card company takes moments.

So that said… your question then becomes: whenever paypal’s IPN updates the order so that it’s ACTUALLY confirmed as paid, how do I update the customer. That’s a good question…. we should probably add an additional email event specifically for paypal to handle this asynchronous payment stuff.

 Signature 

We’re moving away from the forums, though not entirely and not immediately. Lack of support lately is coincidental to that. Unfortunately we’ve had a bad month with it, but we do not forsee that we will have any continued problems with support through our portal going forward, or on forums while we’re still transitioning. We will send out a newsletter and make additional notifications through twitter and other outlets over the coming weeks.

Moving forward; things returning to normal.

Profile
 
 
Posted: 01 July 2010 07:12 PM   [ Ignore ]   [ # 7 ]
Wallflower
Rank
Total Posts:  11
Joined  2010-04-08
Chris Newton - 01 July 2010 06:48 PM

Authorize / decline / fail, have nothing to do with status of entries. They’re solely to do with completion of the payment, successfully, or unsuccessfully. If the payment has been authorized, declined, or completely failed, we output those conditions.

Make sense?

Yes, I think so. I guess I’ve been a bit confused with my PayPal testing results because I have never gotten declined or failed responses back even though I have set PayPal to “Payment Review” and “Negative Test Mode” enabled. I always get returned to my confirmation page with the {authorized} condition showing.

[Man, PayPal Standard is fussy mess to deal with. I wonder if PayPal Pro is better?]

Profile
 
 
Posted: 01 July 2010 07:20 PM   [ Ignore ]   [ # 8 ]
Wallflower
Rank
Total Posts:  11
Joined  2010-04-08
Chris Newton - 01 July 2010 06:51 PM

My goal here is sell software and give a license number out on the confirmation page + email. I’m planning on using the transaction_id as the license number because I don’t know any other way to generate the number.

CartThrob can actually generate unique license numbers for you, and can lock downloads to specific members.

Oh, that’s great! I thought it should be able to, but I’ve never found any reference on how to do it. Can you point me to an article on how to do this?

Thanks Chris!

Profile
 
 
Posted: 01 July 2010 07:35 PM   [ Ignore ]   [ # 9 ]
Wallflower
Rank
Total Posts:  11
Joined  2010-04-08

I also have to send the transaction_id and a few other bits of the transaction off to another server in the form of http post; I read about using CT’s authorized.php file and putting in my code their, though I have no idea how yet. After that second server has processed what I have sent, it authorizes the user+software and probably sends an email too.

What other system do you need to tie into? Can you provide more detail?

Well all this stems back from the fact that when I started developing the site, some other developers started developing the application and it’s custom licensing scheme—including their own tables to store data that would already be captured by my store/cms.

Now it’s integration time, and basically they have told me is to POST a string to their Java app on another server.

I’d prefer to do the whole software licensing thing the way everyone else does so that we’re not reinventing the wheel and making things harder on ourselves. If CartThrob can do the license generation on my system and then have the other system connect to my DB to get what they need I’d be happier. But this would still mean notifying the other server that a transaction has occurred, and PayPal Standard is not real time.

BTW We will also be selling add-ons to the app, so I don’t think those will need a license, but rather be tied to the purchased application’s user and license.

Is there an easier way to setup a software license and add-on system? Should we switch to a different payment gateway like PayPal Pro?

Profile
 
 
Posted: 01 July 2010 07:47 PM   [ Ignore ]   [ # 10 ]
Wallflower
Rank
Total Posts:  11
Joined  2010-04-08

Whenever a customer is directed back to your site from paypal, you should assume, that paypal has only captured the information, and NOT the money. Every time a user returns, you should always tell them that their order is processing. Essentially, the way Paypal works is that they might take days to process a transaction, where a credit card company takes moments.

So that said… your question then becomes: whenever paypal’s IPN updates the order so that it’s ACTUALLY confirmed as paid, how do I update the customer. That’s a good question…. we should probably add an additional email event specifically for paypal to handle this asynchronous payment stuff.

Thank Chris. That makes perfect sense. I now know that that information was there all along, but I was probably too overwhelmed trying to learn CartThrob, PayPal, EE, and Structure for it to sink in.

So now I have two options: Change my Order Confirmation page as you have suggested, then figure a way to handle the asynchronous PayPal stuff and sending Processing and Confirmation emails to clients.

Or, completely drop PayPal standard and switch to PayPal Pro? or something better. Can anyone recommend a new gateway that is better than PayPal Standard?

Profile
 
 
Posted: 02 July 2010 12:52 AM   [ Ignore ]   [ # 11 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10256
Joined  2008-09-29

Yes, I think so. I guess I’ve been a bit confused with my PayPal testing results because I have never gotten declined or failed responses back even though I have set PayPal to “Payment Review” and “Negative Test Mode” enabled. I always get returned to my confirmation page with the {authorized} condition showing.

If the customer is returned to the confirmation page from paypal, it will always be {authorized} With paypal, our language is misleading. ALL other systems process in real time, so if they send you back to that page, authorized means authorized. With paypal, it just means that they’ve successfully taken payment details.

Man, PayPal Standard is fussy mess to deal with. I wonder if PayPal Pro is better?

Paypal is awful. Actually it’s fine, but people’s perception of it is wrong… people think of it like any other payment system, and it’s just not the same. It’s a system that does not handle CREDIT. It handles money… and it takes a while to confirm that the money really exists. That and their documentation is somewhat spotty all around.

In regards to paypal pro, If you were going to go switch to PayPal Pro, I’d recommend pretty much any other payment gateway. What country are you in? In the US, CDG Quantum is great. Authorize.net is good too, though more expensive.

LIcense Generation:  Can you point me to an article on how to do this?

Man, I don’t think we ever documented it. I’ve started documentation on it now that I know it doesn’t exist, apologies. It’s one of those features we added after the initial launch, and some of those features aren’t documented as well as I’d like. At any rate, it’s pretty simple, just a parameter tells the system that it should have a license:

{exp:cartthrob:add_to_cart_form entry_id="6139"  license_number="yes" 

Add the parameter “license number” to your add_to_cart_form tag, and a license number will be automatically generated upon successful purchase. On the backend there’s a mapping setting for license number field where the number will be stored.

We currently use UUID as our license number generation scheme. If you need / want something else, please let us know

Now it’s integration time, and basically they have told me is to POST a string to their Java app on another server.

Are you proficient with PHP? If so, you can cURL data to them, and handle the response in the post process file. This is custom stuff I’m talking about here, so you’d really need to know what you’re doing. Doesn’t sound tough to me, but if you’re not a PHP wiz, it might behoove you to have us do some custom development.

I’d prefer to do the whole software licensing thing the way everyone else does so that we’re not reinventing the wheel and making things harder on ourselves. If CartThrob can do the license generation on my system and then have the other system connect to my DB to get what they need I’d be happier. But this would still mean notifying the other server that a transaction has occurred, and PayPal Standard is not real time.

If paypal has not authorized the money, and updated your site via the IPN, the order is considered “processing” There’s a setting on the backend (see the attached graphic) where you can set this status. Basically, you can restrict access based on these statuses until paypal has confirmed payment. As I mentioned, if you want to notify someone you’ll need to use something like entry update notifications to notify your customer when the status changes.

BTW We will also be selling add-ons to the app, so I don’t think those will need a license, but rather be tied to the purchased application’s user and license.

I can think of several ways to restrict access to these add-ons if a person has not bought the main system. Just using standard EE weblog:entries tag you could disallow adding an item to cart if the customer hasn’t purchased a particular item.

Is there an easier way to setup a software license and add-on system? Should we switch to a different payment gateway like PayPal Pro?

Well, a real-time payment gateway of any kind is going to be simpler on you in terms of making sure the money is in hand before showing off the goods.

Image Attachments
Screen shot 2010-07-01 at 10.44.49 PM.png
 Signature 

We’re moving away from the forums, though not entirely and not immediately. Lack of support lately is coincidental to that. Unfortunately we’ve had a bad month with it, but we do not forsee that we will have any continued problems with support through our portal going forward, or on forums while we’re still transitioning. We will send out a newsletter and make additional notifications through twitter and other outlets over the coming weeks.

Moving forward; things returning to normal.

Profile
 
 
Posted: 03 July 2010 11:48 AM   [ Ignore ]   [ # 12 ]
Wallflower
Rank
Total Posts:  11
Joined  2010-04-08

You rock Chris! Thanks for such amazing support (Rob too!) and taking the time late at night to reply to my questions.

Yes, I think so. I guess I’ve been a bit confused with my PayPal testing results because I have never gotten declined or failed responses back even though I have set PayPal to “Payment Review” and “Negative Test Mode” enabled. I always get returned to my confirmation page with the {authorized} condition showing.

If the customer is returned to the confirmation page from paypal, it will always be {authorized} With paypal, our language is misleading. ALL other systems process in real time, so if they send you back to that page, authorized means authorized. With paypal, it just means that they’ve successfully taken payment details.

What I should do then is not only test for the {authorized} condition, but also test for {if authorized AND gateway==“paypal”}? So if, and when, I do change to another gateway I could in fact still have PayPal Standard as an option. I should then change the “confirmation” segment/page to “processing” and simply show a “Thank you, your order is being processed. When your payment has been confirmed you will receive an email from us with your order details, and an email from PayPal with your transaction details. PayPal may take up to a few days to process your order… blah, blah”.

Paypal is awful. Actually it’s fine, but people’s perception of it is wrong… people think of it like any other payment system, and it’s just not the same. It’s a system that does not handle CREDIT. It handles money… and it takes a while to confirm that the money really exists. That and their documentation is somewhat spotty all around.

Spotty is a polite understatement wink And their support for Canadian merchants isn’t the greatest either.

In regards to paypal pro, If you were going to go switch to PayPal Pro, I’d recommend pretty much any other payment gateway. What country are you in? In the US, CDG Quantum is great. Authorize.net is good too, though more expensive.

I’m in Canada. I’m told my client has a POS merchant account with Moneris. But I’m open to using any reasonably priced, quality gateway. Can you suggest some? Does CartThrob support any Canadian gateways or does a custom gateway need to be built?

{exp:cartthrob:add_to_cart_form entry_id="6139"  license_number="yes" 

Add the parameter “license number” to your add_to_cart_form tag, and a license number will be automatically generated upon successful purchase. On the backend there’s a mapping setting for license number field where the number will be stored.

This worked like a charm! Thanks!

Now it’s integration time, and basically they have told me is to POST a string to their Java app on another server.

Are you proficient with PHP? If so, you can cURL data to them, and handle the response in the post process file. This is custom stuff I’m talking about here, so you’d really need to know what you’re doing. Doesn’t sound tough to me, but if you’re not a PHP wiz, it might behoove you to have us do some custom development.

I’m not a PHP wiz, but I looked up cURL and put this together:

<?php
// cartthrob.on_authorize.php
// Add code here that you would like to be parsed upon confirmation of authorization. 

define('POSTURL''http://example.com:9090/generateLicense.do');
define('POSTVARS''transId={transaction_id}');  // POST VARIABLES TO BE SENT
 
 /* POST */ 
$ch curl_init(POSTURL);
 
curl_setopt ($chCURLOPT_POST1);
 
curl_setopt ($chCURLOPT_POSTFIELDS"POSTVARS");
 
curl_exec ($ch);
 
curl_close ($ch);

// I wouldn't have both POST and GET active at the same time, this is an example

/*  GET */ 
$ch curl_init('http://example.com:9090/generateLicense.do?transId={transaction_id}');
 
curl_exec ($ch);
 
curl_close ($ch); 
 
?> 

I know that {transaction_id} isn’t being parsed as I haven’t gotten around to figuring that out yet. Got any tips? And I know sticking this code in cartthrob.on_authorize.php isn’t the right place because, as it has been mentioned before, PayPal always returns as {authorized}, but this was the first way I tested. I figured I’d ask where in the process I should stick this code so that when the IPN is received from PayPal I can run this code? BTW I didn’t get back any responses from the other server when I used this method.

I then placed this code into two separate files, one called cpost.php and one called cget.php to test outside the cartthrob process: GET works in the respect that I get back a “success” reply from the other server. Post gives me back a “fail” message.

So now I have to figure out how to get the {transaction_id} or (license_number) into the post variable and then send it to the other server when I receive a successful IPN message from paypal. Can the Solspace Entry Notifications (mentioned below) do this?

If paypal has not authorized the money, and updated your site via the IPN, the order is considered “processing” There’s a setting on the backend (see the attached graphic) where you can set this status. Basically, you can restrict access based on these statuses until paypal has confirmed payment. As I mentioned, if you want to notify someone you’ll need to use something like entry update notifications to notify your customer when the status changes.

BTW We will also be selling add-ons to the app, so I don’t think those will need a license, but rather be tied to the purchased application’s user and license.

I can think of several ways to restrict access to these add-ons if a person has not bought the main system. Just using standard EE weblog:entries tag you could disallow adding an item to cart if the customer hasn’t purchased a particular item.

I’ve seen how to do that mentioned in an article somewhere, do you know which article that was?

Thanks again for all your help Chris!

Profile
 
 
Posted: 03 July 2010 01:47 PM   [ Ignore ]   [ # 13 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10256
Joined  2008-09-29

What I should do then is not only test for the {authorized} condition, but also test for {if authorized AND gateway==“paypal”}? So if, and when, I do change to another gateway I could in fact still have PayPal Standard as an option. I should then change the “confirmation” segment/page to “processing” and simply show a “Thank you, your order is being processed. When your payment has been confirmed you will receive an email from us with your order details, and an email from PayPal with your transaction details. PayPal may take up to a few days to process your order… blah, blah”.

You’d have to capture the gateway in the order data, and output it in a weblog entries tag… but essentially, yes, this is what you’d need to do.

I’m in Canada. I’m told my client has a POS merchant account with Moneris. But I’m open to using any reasonably priced, quality gateway. Can you suggest some? Does CartThrob support any Canadian gateways or does a custom gateway need to be built?

Moneris has been suggested several times, but we don’t have a gateway for it yet. We do custom gateways at $600 flat fee, which is an option if you want it done NOW. Eventually we’ll get around to it, but I know it’s not on the list for the near future. 

I know that {transaction_id} isn’t being parsed as I haven’t gotten around to figuring that out yet. Got any tips?

print_r($_SESSION['cartthrob']);
echo 
'<p>php order: ' $_SESSION['cartthrob']['order']['order_id''</p>';
echo 
'<p>php trans: ' $_SESSION['cartthrob']['order']['auth']['transaction_id''</p>'

But as you say, it won’t help you much, since paypal hasn’t confirmed the order yet.

And I know sticking this code in cartthrob.on_authorize.php isn’t the right place because, as it has been mentioned before, PayPal always returns as {authorized}, but this was the first way I tested. I figured I’d ask where in the process I should stick this code so that when the IPN is received from PayPal I can run this code? BTW I didn’t get back any responses from the other server when I used this method.

This sounds like a case for a custom version of the paypal gateway. Basically you change the classname wherever it’s found (about 3 places) from “Cartthrob_paypal_standard” to “Cartthrob_paypal_standard_my_version” and change the filename to “cartthrob.paypal_standard_my_version.php”. There’s a function called: paypal_incoming_payment in the paypal standard gateway, this is the IPN listener. Around line 505, there’s some code: if ($auth[‘authorized’]). You could place your code in that if statement. Also, in that function, paypal returns its transaction id, look for: “$post[‘txn_id’]”

Since you’d be adding the code here, you could take advantage of our onboard data curling and handling functions as well:

$data     $this->data_array_to_string($array);
$connect         $this->curl_transaction($server_url,$data);
$transaction     $this->split_url_string($connect);
var_dump($transaction); 

The only thing this leaves is getting the license number. You could use the order_id to pull the entries data directly from the database. It’s a bit beyond the scope of our standard support to spell all of it out for you. If it’s something beyond your capabilities, you can contact us, and we can build something custom for you.

So now I have to figure out how to get the {transaction_id} or (license_number) into the post variable and then send it to the other server when I receive a successful IPN message from paypal. Can the Solspace Entry Notifications (mentioned below) do this?

I believe it can get weblog entries data… and that’s all you’ll need to get, because both the transaction id and the license number both can be stored in the order weblog.

 Signature 

We’re moving away from the forums, though not entirely and not immediately. Lack of support lately is coincidental to that. Unfortunately we’ve had a bad month with it, but we do not forsee that we will have any continued problems with support through our portal going forward, or on forums while we’re still transitioning. We will send out a newsletter and make additional notifications through twitter and other outlets over the coming weeks.

Moving forward; things returning to normal.

Profile