Forums

[Re-Open] CURL problem

codeslayer 23 Oct, 2011
Hi,

I am have trouble using CURL action on my CFv4 (Rc 20) form.
I am using this form to send data to Liberty Reserve Shopping Cart Interface i.e https://sci.libertyreserve.com/en.

Following are the screen shots for my form.
[attachment=2]1.png[/attachment]

[attachment=1]2.png[/attachment]

[attachment=0]3.png[/attachment]

The problem is when I run the form and submit data. The browser's status bar goes on and on never ending on firefox/ However chrome gives me error.
500 Server Error

A misconfiguration on the server caused a hiccup. Check the server logs, fix the problem, then try again.
URL: http://hassanagha.com/index.php?option=com_chronoforms&chronoform=lr_test&event=submit

Please suggest me any solution.

Regards
Hassan
GreyHead 23 Oct, 2011
Hi Hassan,

In trying to fix a problem with AcyMailer I found a bug in the Joomla! 1.6/1.7 version of the action :-( It's particlaly solved but not there is still something else stopping it working correctly.

I'll post the fixed version as soon as I have it.

Bob
GreyHead 23 Oct, 2011
Hi Hassan,

Please see this post for an updated action to test.

Bob
codeslayer 23 Oct, 2011
Thank you Bob,

I just upoaded your action curl_gh on my ../administrator/components/chrooforms/form_actions/.
Even this one is not working. Upon clicking submit button, the form and the data is not transfered/redirected to Liberty reserves SCI and keeps on loading without ending.
Also, please note I am using Joomla 1.5.23 + CF4 RC 20.

Live link
http://hassanagha.com/index.php?option=com_chronoforms&chronoform=lr_test2
Although it should not ask for user name / password. I am sending you the login details by PM.

I am attaching the form. Please take a look and suggest any solution.
Please note that the links generated by the Liberty Reserve Button generator are working fine. But forms get stuck.


Best regards
Hassan

[attachment=0]test2.zip[/attachment]
codeslayer 24 Oct, 2011
And when I use Redirect URL Action + debugger. Upon submit button click, it does not redirect to SCI. Insted it satys on the page and the debugger is showing:
Data Array:

Array
(
    [lr_acc] => U7959067
    [lr_store] => hassan-agha
    [lr_amnt] => 0.01
    [lr_currency] => LRUSD
    [lr_merchant_ref] => MR-44556756
    [lr_comments] => Some Memo for Merchant
    [input_submit_8] => Submit
    [9623b8eed06361f6509d9602f5db143f] => 1
    [option] => com_chronoforms
    [chronoform] => lr_test2
    [event] => submit
    [Itemid] => 
    [redirect_url] => https://sci.libertyreserve.com/en?lr_acc=U7959067&lr_store=hassan-agha&lr_amnt=0.01&lr_currency=LRUSD&lr_merchant_ref=MR-44556756&lr_comments=Some%2BMemo%2Bfor%2BMerchant
)

Debug Data

    redirect_url
        redirect_url_target_url: https://sci.libertyreserve.com/en
        Redirect URL: https://sci.libertyreserve.com/en?lr_acc=U7959067&lr_store=hassan-agha&lr_amnt=0.01&lr_currency=LRUSD&lr_merchant_ref=MR-44556756&lr_comments=Some%2BMemo%2Bfor%2BMerchant



The URL is formed well and when I copy/paste this URL on my browser. It take me to the required page. Doesn't it should redirected by it self ???
GreyHead 24 Oct, 2011
Hi Hassan,

You need to add a ReDirect User action as well to actually do the ReDirection.

Bob
codeslayer 26 Oct, 2011
Thank you very Bob,

It worked !!.

I dont know what are pros and cons of using CURL / Redirect URL. But combinitaion of Redirect User and Redirect URL worked for me.

Thank you again🙂

Hassan
GreyHead 26 Oct, 2011
Hi Hassan,

The main differene is that cURL sends the **data without the user** and RedIrect send the **data and the user**. So, for standard PayPal you want to use ReDirect so that the user can sign in and authorise the payment. For a newsletter sing-up you prbably want to use cURL so that the sign-up take place behind the scenes.

Bob
codeslayer 26 Oct, 2011
Hi Bob,

Somehow the CURL (also CURL GH) action didn't worked for me at all. As you can see in my above posts; the pages keeps on loading and nothing happens. I am using Redirect URL (under Actions there is CURL and Redirect URL) to send the data and the user for payments to liberty Reserve Shoping Cart Inteface (SCI).

I sent you the login details of my site hassanagha.com in PM two days ago. If you could check why CURL actions failed to perform as it should have?

Tahnks and best regards
Hassan🙂
codeslayer 28 Oct, 2011
Hi Bob,

I had to re-open this thread. Because the Redirect URL is also showing the values in the address bar. I dont want them to be displayed after "https://sci.libertyreserve.com/".

Correct Example:
[attachment=1]correct.png[/attachment]

Wrong:
[attachment=0]wrong.png[/attachment]

Please guide me how can I hide the values to be sent to LR SCI without shouwing them in the address bar.

Regards
Hassan
GreyHead 28 Oct, 2011
Hi Hassan,

You can't redirect with a URL without putting the data in the URL.

You'd have to use POST instead.

Bob
codeslayer 28 Oct, 2011
Hi Bob,

My form is already set to use POST method in General settings in the Form Manager.
Is this the same POST you are refering or if there is anything else I am missing ?

And about the second part of my question. As you can see in the screen shots, where I have marked the text string i am passing through the form is being encoded. I have no idea why its being encoded. Because when I use sample shop script (PHP) provided by the Liberty Rerserves its shhowing the text string as its showing in the first screenshot. Does Chronoform automatically encodes the strings ? I am confussed.

Regards

Hassan
GreyHead 28 Oct, 2011
Hi Hassan,

You are using POST to submit the form, that's correct. But after the form is submitted you are using GET to pass the information to LibertyReserve using the URL. That has nothing to do with whether or not the form is using POST.

And yes, the values are automatically URL encoded so that they can be correctly passed in a URL with out being corrupted.

The description you have "Invoice 4GKHOD2B: adding funds to user (hassan) balance" includes the characters space, :, ) and ( none of which can be used in a URL.

Bob
codeslayer 28 Oct, 2011
Hi Bob,

I am a little confussed. :?
I am using a from with POST method to submit the form.
Then using "Redirect URL" + "Redirect User" action to submit the form to the SCI.
I have not used the GET method exclusively to sent the data to the SCI.

Form Setup:
Forms Manager > New > Code > Form type: Custom >
<table width="240" border="0" cellpadding="1">
  <tr>
    <td>Amount</td>
    <td><input maxlength="5" size="30" type="text" value="50.00" name="lr_amnt" /></td>
  </tr>
  <tr>
    <td>Currency</td>
    <td><select size="1" label_over="0" hide_label="0" class="" title="" type="select" name="lr_currency">
        	<option value="LRUSD">USD</option>
        	<option value="LREUR">EURO</option>
        </select>
    </td>
  </tr>
  <tr>
    <td colspan="2"><input type="hidden" value="U7959067" name="lr_acc" />
      <input type="hidden" value="hassan-agha" name="lr_store" />
      <input type="hidden" value="<?php 
		$numchars = rand(8,8);
		$chars = explode(',','A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,0,1,2,3,4,5,6,7,8,9');
		$random='';
		for($i=0; $i<$numchars;$i++)  {
		$random.=$chars[rand(0,count($chars)-1)];
}
$user =& JFactory::getUser();

echo "Invoice " . $random . ": adding funds to user (" . $user->username . ") balance" ?>" name="lr_comments" />
    <input type="hidden" value="MR-44556756" name="lr_merchant_ref" /></td>
  </tr>
  <tr>
    <td colspan="2"><input name="input_submit_8" class="" value="Submit" type="submit" />
     <?php $user=&JFactory::getUser();echo $user->username;?> </td>
  </tr>
</table>




Saved the Form with name "lr_addfund_mod". Then,

Form Manager > lr_addfund_mod > Edit Wizard : Advanced > Events > OnLoad : Show Html, On Submit: ReDirect URL & Redirect User

ReDirect URL Param:
lr_acc={lr_acc}
lr_store={lr_store}
lr_amnt={lr_amnt}
lr_currency={lr_currency}
lr_merchant_ref={lr_merchant_ref}
lr_comments={lr_comments}


Redirect User
https://sci.libertyreserve.com/en


Now, How and where do I use the POST method to send the form values to the SCI, so that the URL do not contain the passing out values from the form?

Regards

Hassan :? 🤨
GreyHead 28 Oct, 2011
Hi Hassan,

Please re-read my previous posts here. We are close to going round in a loop.

If you want to redirect the user AND use POST to transfer the data the only way I know to do that is to create a form in the OnSubmit event that either automatically submits, or with a single 'confirm' button that the user clicks.

Bob
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount

{item:title} {images:#}