2checkout payment method.

1.Initially let see by hard coded HTML form with laravel  (please don’t  use this method in production until changing them  to MVC )

 

-please create a sandbox account and make the relevant configuration such as return URL  based on the 2co documentation.

 

route.php

Route::get(‘co’, ‘HomeController@Twoco’);

Route::get(‘returnco’, ‘HomeController@return_co’);

 

 

view file -cart_test.blade.php

<form method=”post” action=”https://sandbox.2checkout.com/checkout/purchase&#8221; name=”process”>
<input type=”hidden” name=”sid” value=”901310973″ />
<!– 901269012 –>
<input type=”hidden” name=”mode” value=”2CO” />

<input type=”hidden” name=”total” value=”679.71″ />

<input type=”hidden” name=”merchant_order_id” value=”622″ />

<input type=”hidden” name=”cart_order_id” value=”622″ />

<input type=”hidden” name=”card_holder_name” value=”azeem jai” />

<input type=”hidden” name=”street_address” value=”No-90″ />

<input type=”hidden” name=”city” value=”New york” />

<input type=”hidden” name=”state” value=”NY” />

<input type=”hidden” name=”zip” value=”10031″ />

<input type=”hidden” name=”country” value=”US” />

<input type=”hidden” name=”email” value=”jazeem.lk@gmail.com” /><!– 901310973–>

<input type=”hidden” name=”phone” value=”” />

<input type=”hidden” name=”ship_name” value=”azeem jai” />

<input type=”hidden” name=”ship_street_address” value=”No-90″ />

<input type=”hidden” name=”ship_city” value=”New york” />

<input type=”hidden” name=”ship_state” value=”NY” />

<input type=”hidden” name=”ship_zip” value=”10031″ />

<input type=”hidden” name=”ship_country” value=”US” />

<input type=”hidden” name=”fixed” value=”Y” />

<input type=”hidden” name=”id_type” value=”1″ />

<input type=”hidden” name=”payment_method_id” value=”16″ />

<input type=”hidden” name=”demo” value=”N” />

<input type=”hidden” name=”dispatch” value=”payment_notification” />

<input type=”hidden” name=”payment” value=”2checkout” />

<input type=”hidden” name=”order_id” value=”6221″ />
<ul>
<li><label>Product -01 –> $220.00</label></li>
<li><label>Product -02 –> $158.00 </label></li>
<li><label>Shipping and hadling –> $71.71 </label></li>
</ul>
<input type=”hidden” name=”li_1_type” value=”product” ><input type=”hidden” name=”li_1_name” value=”Product-01″ />
<input type=”hidden” name=” li_1_product_id” value=”89″ />
<input type=”hidden” name=”li_1__description” value=”Product-01″ />
<input type=”hidden” name=”li_1_price” value=”220.00″ />
<input type=”hidden” name=”li_1_tangible” value=”Y” />
<input type=”hidden” name=”li_2_type” value=”product” ><input type=”hidden” name=”li_2_name” value=”Product-04″ />
<input type=”hidden” name=” li_2_product_id” value=”93″ />
<input type=”hidden” name=”li_2__description” value=”Product-02″ />
<input type=”hidden” name=”li_2_price” value=”158.00″ />
<input type=”hidden” name=”li_2_tangible” value=”Y” />
<input type=”hidden” name=”li_3_type” value=”shipping” >
<input type=”hidden” name=”li_3_name” value=”Shipping and handling” >
<input type=”hidden” name=”li_3_price” value=”71.71″ >
<input type=”hidden” name=”li_4_type” value=”tax” >
<input type=”hidden” name=”li_4_name” value=”Tax” >
<input type=”hidden” name=”li_4_price” value=”10″ >

<input type=”button” value=”2checkout” onclick=”submit();” >
</form>

function submit(){
document.process.submit();
};

 

add the following function into the Homecontroller 

function Twoco() {

return View::make(‘cart_test’);
}

 

please write a function for return URL and capture the values of returning string

 

 

 

 

2.MVC formated

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s