Skip to content

Commit

Permalink
Update Docs and response method
Browse files Browse the repository at this point in the history
  • Loading branch information
joselfonseca committed Sep 2, 2015
1 parent 0a9e024 commit 23ef255
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 8 deletions.
40 changes: 38 additions & 2 deletions docs/webcheckout.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Migration

Please copy the migration from the migrations folder in this package to your app and run `php artisan:migrate`

# Web Checkout Class

This class will alow you to generate the signature and will hold all the informtion needed to build a form for the web checkout endpoint in PayU Latam.
This class will alow you to generate the signature and will hold all the information needed to build a form for the web checkout endpoint in PayU Latam.

## Env file

Expand Down Expand Up @@ -34,4 +38,36 @@ This class will alow you to generate the signature and will hold all the informt
$webCheckout->init('[email protected]', 'Description', 'Reference', 35000, 0, 0)->process();
$form = new PayuLatamForm($webCheckout);
echo $form->getForm();
```
```
Don't forget to add this endpoint to the except property in the VerifyCsfrToken Middleware

```
'payu/confirmation'
```

Something like this

```php

namespace App\Http\Middleware;

use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;

class VerifyCsrfToken extends BaseVerifier
{
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
'payu/confirmation'
];
}

```

#Events

The package fires 2 events in the confirmation post request `AnvarCO\PayuLatam\Events\ConfirmationArrived` once the post arrives and `AnvarCO\PayuLatam\Events\ConfirmationSaved` once the confirmation information has been added to the database.

6 changes: 0 additions & 6 deletions src/Http/Controllers/PayuLatamController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ class PayuLatamController extends Controller

public function response(Request $request)
{
/**Log::info('New post request from PayU');
event(new ConfirmationArrived($request));
$confirmation = PayUConfirmation::create($this->formatData($request->all()));
Log::info('Confirmation created: '.$confirmation->id);
event(new ConfirmationSaved($confirmation));
Log::info('Event fired');**/
return view('payulatam::response');
}

Expand Down

0 comments on commit 23ef255

Please sign in to comment.