Wednesday 20 July 2016

Authorize.net #ruby #help #payment #gatway

http://www.johnconde.net/blog/tutorial-integrate-the-authorize-net-cim-api-with-php/
 http://www.rubydoc.info/gems/authorize-net/1.5.2/index
http://www.rubydoc.info/gems/authorize-net/1.5.2

http://developer.authorize.net/hello_world/
http://www.johnconde.net/blog/all-about-authorize-nets-silent-post/

http://funonrails.com/2011/12/authorize-net-sim-payment-integration-with-rails/


https://github.com/AuthorizeNet/sample-code-ruby

http://www.authorize.net/content/dam/authorize/documents/SIM_guide.pdf

https://developer.authorize.net/api/

https://developer.authorize.net/api/reference/index.html#payment-transactions

http://www.authorize.net/videos/




http://railscasts.com/episodes/145-integrating-active-merchant

https://blog.joshsoftware.com/2012/01/16/authorize-net-aim-payment-integration-with-rails/

http://funonrails.com/2011/12/authorize-net-sim-payment-integration-with-rails/ 

Authorize.net #ruby #help #payment #gatway

Monday 18 July 2016

Laravel Form

1. composer  require illuminate/html
     ref : https://github.com/illuminate/html

     Steps : ->Go to Config/app.php
             ->Add HTML service provider in service provider list
                 Illuminate/Html/HtmlServiceProvider
             -> Add Html Facade in alias section 
                  'Html' => 'Illuminate/Html/Facades/HtmlFacad'
                  'Form' => 'Illuminate/Html/Facades/FormFacad'


Form Design :

{!! Form::open() !!}

    <div class="form-group">
      {!!  Form::label('name', 'Name')  !!}
     {!!  Form::text('name', null,['class' => 'form-control'])  !!}
   </div>


    <div class="form-group">
      {!!  Form::label('body', 'Body')  !!}
     {!!  Form::textarea('body' , null,['class' => 'form-contro'l])  !!}
   </div>



    <div class="form-group">
      {!!  Form::label('published_at', 'Published On')  !!}
     {!!  Form::input('date','published_at' , null,['class' => 'form-contro'l])  !!}
     
                                          OR
{!!  Form::input('date','published_at' , Carbon\Carbon::now()->format('Y-m-d'),['class' => 'form-contro'l])  !!}
                                            OR


{!!  Form::input('date','published_at' , date('Y-m-d'),['class' => 'form-contro'l])  !!}
   
</div>



    <div class="form-group">
     {!!  Form::submit('Add') , null,['class' => ' btn btn-primary form-control']) !!}   </div>

{!!Form::close() !!}




In Model  : for full date with time
public function setPublishedAtAttribute($date){
   // this give current time
   $this->attributes['published_at'] =  Carbon::createFormFormat('Y-m-d',$date);

                                    OR
  // This gives 00 hr,min,sec
$this->attributes['published_at'] =  Carbon::parse ($date);
}



                 

Thursday 7 July 2016

PHP Laravel MySql Functions

0. App\Article::all()->toArray();
1. App\Article::find(1);
2. App\Article::find(1)->toArray();
3. App\Article::where('user_id','1')->get();  It gives Collection
4. App\Article::where('user_id','1')->first(); It gives Single record
5. $fillable method in model to allow create Query on [tinker] terminal
6. Update Attribute of table :
             $article = App\Article::find(2);
             $article->field_name = 'field value';
             $article->save();
                                            OR
             $article = App\Article::find(2);
             $article->update(['field_one'=>'Update again']);

            


PHP Laravel Artisan Commands :

0. php artisan  To show artisan help list
  
1.php artisan server   To  Start Server

2. php artisan tinkar  Laravel Terminal To execute laravel code and check.

3. Carbon\Carbon::now()  This is carbon library for laravel to time display

4.php artisan make:model Article   To create model