google checkout integration - codeigniter - google-checkout

I have site built in codeigniter framework.
I want to use google checkout.
I have used this code to transfer fund but I need something returned so that I can know that transfer is successful and then enter values to my database.
I am not sure how to do that.
Can anyone show me step by step how to do that?
My form :
<form action="https://sandbox.google.com/checkout/api/checkout/v2/checkoutForm/Merchant/xxxxxxx" id="BB_BuyButtonForm" method="post" name="BB_BuyButtonForm" target="_top">
<input name="item_name_1" type="hidden" value="Deposite"/>
<input name="item_description_1" type="hidden" value="Money Deposite"/>
<input name="item_quantity_1" type="hidden" value="1"/>
<input name="item_price_1" type="text" value="30.0"/>
<input name="item_currency_1" type="hidden" value="USD"/>
<input name="_charset_" type="hidden" value="utf-8"/><br />
<input alt="" src="https://sandbox.google.com/checkout/buttons/buy.gif?merchant_id=xxxxxxxx&w=117&h=48&style=white&variant=text&loc=en_US" type="image"/>
</form>

...but I need something returned so that I can know that transfer is successful and then enter values to my database...
The Google Checkout API calls that "Part 2" or "Process Checkout Orders".
Here's a tutorial using their Java lib. Note that it doesn't mean you "have" to use this (or any) specific lib, it just shows you the flow.
Other libs are here.

Related

AJAX call to PHP not working yields a blank page

We are implementing the "forget password" feature for our website.
We are usign HTML, JQquery mobile and AJAX .
we have a main file, which has the hyperlink for the forget password using the '' tag.
The password.html has form elements as below:
<form method ="post" id="forget" action="somefile.php" >
<h4>Enter your login email to change your password..</h4>
<label for="email" class="ui-hidden-accessible">Email:</label>
<input type="email" name="email" id="email" value="" placeholder="email" data-theme="a" />
<input type="submit" value="Submit" data-theme="b" />
</div>
</form>
The php file validates the email and sends the response in JSON format , which we are handling through a ajax call.
The problem is after hitting on "submit" in the password.html, we are able to retreive the data from the php file(able to see in network tab of browser) but it does not display on the frontend.
The browser is navigating to the php file (which it should not) and a blank page is being displayed.
Ps: When we directly load the password.html in the browser the behaviour is absoultely fine , but when we are navigating from the main file usign the hyperlink to password.html then this problem occurs.

GSA Cookie Auth - "Login form doesn't have both text and password inputs"

I can't seem to find out what's wrong with the login form I'm using to setup cookie authentication, the GSA throws me this error (serving log) after submitting my credentials in universal login form:
Got form; name=customlogin clientLogin; action=/content/marketing/en/login/j_security_check; type=hidden, name=resource; type=hidden, name=_charset_; type=hidden, name=j_username; type=hidden, name=j_password
Login form doesn't have both text and password inputs
Error in authentication module: Login form doesn't have both text and password inputs
Here is the form I'm using:
<form method="POST" action="/content/marketing/en/login/j_security_check" id="form_customlogin" name="customlogin clientLogin" enctype="multipart/form-data" onsubmit="return cq5forms_validate_customlogin();">
<input type="hidden" name="resource" value="/content/operations/apps/en.html" />
<input type="hidden" name="_charset_" value="UTF-8" />
<input id="username" type="hidden" name="j_username" value="anonymous-user" />
<input id="password" type="hidden" name="j_password" value="anon" />
<p>
Or go straight through as a
guest
(limited access)
</p>
</form>
Does anyone have knowledge on how a form has to be built in order for the GSA to use it? It'd be very welcome.
Thanks in advance!
EDIT: Apparently, inputfilds user/pw must have type username and password, they can't be hidden.
This was already a feature request.
The username field will have to be type="text", there is no type="username". Out of curiosity, why would you have them hidden?
Very often, when you have complicated login forms, your best bet is to create a separate login form just for the GSA that doesn't include any JavaScript or other wackiness.

Add related products in Mobile Shoppe Magento theme

I try to add more products on the product page. but it seem like the theme I have chosen called "Mobile shoppe" does not support that feature. Is it any more like andvänt this theme that can direct me how to do.
In html code it says how it can give no clue to someone who is good at magento code.
<div class="no-display">
<input type="hidden" name="product" value="1"
<input type="hidden" name="related_product" id="related-products-field"
value="">
</div>
If I try to make it visible to display only one ID.

AJAX file upload with progress bar and input types

I need to submit form which contains two inputs:
<form action="upload" method="post" accept-charset="utf-8" enctype="multipart/form-data"
id="upload">
<textarea name="file_description"></textarea><br/>
<input type="file" name="userfile" id="userfile" /><br/>
<input type="submit" name="upload_button" value="upload"/>
</form>
This question maybe duplicate of this, but I tried and get errors. Can anyone guide me with submitting form which contains file and other inputs?
You can use XHR2 and FileAPI. It's new HTML5 API with pretty good browser support by now. XHR2 allows you to send files via AJAX and FileAPI is used to get file content from input[type=file]
There are plenty articles on that subject in the web. For example: Processing XHR2 file uploads in PHP

MVC 3 File Upload

I want to use mulitple File uploaders on my Razor view form. For this I tried File upload Web helper (#FileUpload.Gethtml()) but unable to call desired controller action. Any help on this or some other way will be highly appreciated.
Thanks
Vivek
You could use a simple html form with multiple file upload inputs and set the form action to post your controlle action
For example
<div>
<h2>File Uploads Updates</h2>
<form action="/FileUpload/UploadMultiple" method="post" enctype="multipart/form-data">
<label for="file">FileAt:</label>
<input type="file" name="fileA" id="fileA" /><br />
<label for="file">FileB:</label>
<input type="file" name="FileB" id="FileB" /><br />
<input type="submit" name="submit" value="Submit" />
</form>
</div>
See Also this Hanselman post on how to do file uploads in MVC
If you're willing to use third party controls, take a look into Telerik upload control.
It is an open source one (GPL 2 ? license)

Resources