Jump to content

automatic downloads


markThomas

Recommended Posts

I found some suggestions of this question in the forums, but not an answer.

 

My site is not automatically delivering the paid-for digital downloads. I have to manually go into the orders and mark them completed and then the order confirmations are sent to the customer.  

I feel like I am missing something here. I have looked through the settings, the orders ...

 

What, where should I be looking for the answer/setting?

 

Thanks in advance.

 

Mark

Link to comment
Share on other sites

"I have to manually go into the orders and mark them completed and then the order confirmations are sent to the customer."

 

Please let us know, for the example order you mentioned above, if that order was still in the Pending state.

 

If that order was still Pending, then CubeCart was not told in a proper manner by the payment processor that payment was successful. When CubeCart is told the payment was successful, CubeCart moves the order to the Processing state. And if there are no tangible products, CubeCart then moves it to the Completed state.

 

It is while the order is in the Processing state that the email which contains the download link(s) is sent to the customer.

 

So, if you are moving an order straight from Pending to Completed (and you verified payment), Cubecart may or may not send the email.

 

I say may or may not because an admin setting, "Do not skip processing," must be enabled to make sure actions taken at the Processing state do, in fact, get taken should an order go straight from Pending to Completed.

Link to comment
Share on other sites

Yes, the order is left in the "Pending" state. I see the orders in the admin panel and can change their respective states there.

Once I manually set the order to "Completed", the email confirmation and the download notification emails are sent. Documents are downloaded successfully from that point on. 

 

Orders are successfully being processed through the gateway ( VirtualMerchant ), we have verification on that point. 

 

If I understand you correctly, there is something that is not being sent from the payment processor? 

Link to comment
Share on other sites

For VirtualMerchant, please let us know if the customer is taken away from your store to another site/page where payment is actually transacted. If so, then whatever notification VirtualMerchant is sending back, is either none at all, incorrect, or possibly Cubecart is not understanding it.

 

Again, if the customer is taken elsewhere to make the transaction, then you may need to look at your domain's web server access logs (if available). The notification from the external VirtualMerchant system will arrive by a URL that looks like this:

/index.php?_g=rm&type=gateway&cmd=process&module=VirtualMerchant

 

Note: if the & is actually &, then in your admin, System Error log, you should have error warnings that such-and-such failed sanitization and was removed.

Link to comment
Share on other sites

OK, now on to this one...

Yes, the customer is taken off the tmadocuments.com site to the myvirtualmerchant.com site to make their payments. 

I did find some examples of the above mentioned notification in the raw logs from the web server. Not much information in them that I can see. Is there something I should be looking for?

Sounds like VirtualMerchant is not sending something back to approve and move the digital download purchase along. ???

 

M

Link to comment
Share on other sites

If VirtualMerchant is attempting to send any response to Cubecart, and the URL is malformed, you will see messages in the PHP error log and maybe even in the admin, System Error log (but not necessarily in the web server log):

[Date/Time UTC] PHP Warning:  Security Warning: Illegal array key ";type" was detected and was removed. in /classes/sanitize.class.php on line 88
[Date/Time UTC] PHP Warning:  Security Warning: Illegal array key ";cmd" was detected and was removed. in /classes/sanitize.class.php on line 88
[Date/Time UTC] PHP Warning:  Security Warning: Illegal array key ";module" was detected and was removed. in /classes/sanitize.class.php on line 88

If you see these, then we need to fix the module.

Link to comment
Share on other sites

Following up on this:

 

Did not find any malformed PHP error log entries in all the logs I searched.

Here is a copy of the transaction receipt. The authorization is set to authorize. What else should it be passing along to CCart for the sale to automatically trigger complete?

 

 

Order Results

 

Profile Name:

    

TMA DOCUMENTS INTERNET

Transaction ID:

    

AA4A39-B909EBC8-57D7-453D-9CF1-7A07CD68A8EF

Date/Time:

    

01/23/2014 04:46:50 PM

Transaction Type:

    

SALE

Approval Message:

    

APPROVAL

Approval Code:

    

09556Z

ECI:

    

 


Credit Card Information

 

Card Number :

    

****************

Amount :

    

$20.00USD

Invoice Number :

    

140123-164506-7590

Get Token :

    

N

Link to comment
Share on other sites

"What else should it be passing along to CCart for the sale to automatically trigger complete?"

 

We do not yet know what VirtualMerchant is currently sending, if anything.

 

In the log you looked at, did you find any line that looked like:

AN.IP.ADDRESS - - [Date/Time] "POST /index.php?_g=rm&type=gateway&cmd=process&module=VirtualMerchant HTTP/1.0" 302 - "-" "Virtual Merchant Payment API"

 

You might also check the configuration of your account at the VirtualMerchant website. See if there is a setting that deals with payment notifications.

 

If there is no joy there, are you prepared to install a tracker utility that may help?

Link to comment
Share on other sites

  • 4 weeks later...

OK, still trying to make this automatic payment / release of digital downloads happen. 

There are no malformed urls. 

Virtual Merchant is a "accepted" payment processor. There is a module in place. My conversations here suggests that there is a missing piece of communications between VM and CCart. VM says it is a unique URL. CCart suggests that the return message is missing. The problem is that nobody knows what that is supposed to be.

 

VM has a configuration page that has a field for an acceptance URL. Has anyone successfully connected these two entities and made things work? I cannot find any online resources for this situation and my entire project hinges on an answer. 

Link to comment
Share on other sites

You said this:

"The authorization is set to authorize."

 

CubeCart's control panel offers a choice of "Sale" or "Authorize Only".

 

The receipt you included shows a "Sale" took place.

 

Assuming VM did contact CubeCart at:

$GLOBALS['storeURL'].'/index.php?_g=rm&type=gateway&cmd=process&module=VirtualMerchant'

$GLOBALS['storeURL'].'/index.php?_g=rm&type=gateway&cmd=process&module=VirtualMerchant'

and included this information in the POST:

'ssl_invoice_number'
'ssl_txn_id'

'ssl_amount'

'ssl_result_message'

 

where 'ssl_result_message' must be "APPROVED" for the order to be set to Processing.

 

There are three instances in the VM modules' gateway.class.php file where the red code is found. Make it look like the green code.

 

Also assuming the name of the gateway module's folder name is still VirtualMerchant (same capitalization).

 

Regardless whether the order was APPROVED or otherwise, there should be a record in the admin Transaction Logs. If none, then VM could not have properly contacted CubeCart.

 

There is one more thing I want you to do: on line 47 in the gateway.class.php file, there is this:

'ssl_company' => $orderSum['companyName'],

 

I do not know if a company name is required by VM, so let's assume not. Place // in front of that line.

Link to comment
Share on other sites

Thanks in advance, as always. Now I know what I am looking at code wise. 

Yes there is a transaction log for the attempted digital downloads. The notes say payment unsuccessful or pending. I know that the card purchases are approved, so it is not for lack of a proper card. The sale is pending. 

 

Question: Does the transaction log get created after the client submits the order for payment OR is it created when the payment processor sends a response back to CC?

 

I am sending this message back to my VM person:

VM should be sending a response to  $GLOBALS['storeURL'].'/index.php?_g=rm&type=gateway&cmd=process&module=VirtualMerchant. 

And the 'ssl_result_message']=="APPROVED". 

 

(I have removed the &amp: from the code and commented the line indicated above.)

 

Is there any way to test the response of the payment gateway? I know there is a test mode, will that make the round trip between CC and VM?

Link to comment
Share on other sites

"Does the transaction log get created after the client submits the order for payment OR is it created when the payment processor sends a response back to CC?"

 

Let's take a look at the module's gateway.class.php file. The two important functions in this file are: fixedVariables() and process().

 

fixedVariables() gathers up all the data about the purchase and gives it to the CubeCart function that sends it to the payment processor.

 

process() is where the results from the payment processor are analyzed. Just before leaving this function, logTransaction() is called to record the transaction data into the database.

 

So, in order for the logging to happen, CubeCart must have properly received the "instant payment notification" from VM. A search through all of CubeCart's files shows there is no other point in the checkout process where an order's transactional data gets logged. Therefore, the log entry must be that from the process() function.

 

That leaves the question of: what is the phrase being sent back by VM for 'ssl_result_message'.

 

If you are willing, let's make an experiment. In the gateway.class.php file, line 97 is this:

$order->logTransaction($transData);

On a new blank line above line 97, add this:

$transData['notes'] .= PHP_EOL . "RX Msg is: " . $_REQUEST['ssl_result_message'];

This will append to the existing transaction notes the actual message VM sent.

 

We can then see why the code in this file is dropping to the "other than APPROVED" if/else/ block.

Link to comment
Share on other sites

Ok, according to the VM Developer's API, the response phrase for an approved transaction is APPROVAL.

 

Please make this edit to the gateway.class.php file, line 88:

Was:
if($_REQUEST['ssl_result_message']=="APPROVED"){
Now:
if($_REQUEST['ssl_result_message']=="APPROVAL"){
Link to comment
Share on other sites

Mr. Smither - hats off and a rowdy thank you for your efforts on this. 

I believe that a combination of the correct URL and the "approval" change saved the day. 

We are tracking the responses in the transaction notes and can see the responses just fine. 

 

We are close to closing this thread. Give me some time to finalize without problems. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...