Skip to content

Commit

Permalink
rEVISÃO
Browse files Browse the repository at this point in the history
  • Loading branch information
drylian committed Jul 8, 2023
1 parent c41147a commit 23562c3
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use MercadoPago\Preference;
use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\DB;
use Illuminate\Http\RedirectResponse;
use Pterodactyl\Exceptions\DisplayException;
use Pterodactyl\Http\Controllers\Api\Client\ClientApiController;
Expand Down Expand Up @@ -50,17 +49,12 @@ public function purchase(MercadoPagoRequest $request): JsonResponse

$token = $this->generateToken();

DB::table('mpago')->insert([
'internal_status' => 'Criado',
'internal_token' => $token,
]);

SDK::setAccessToken(config('gateways.mpago.access_token'));

$preference = new Preference();
$preference->back_urls = [
'success' => route('api:client:store.mercadopago.callback'),
'failure' => config('app.url') . '/store/credits',
'failure' => route('api:client:store.mercadopago.callback'),
'pending' => route('api:client:store.mercadopago.callback'),
];
$preference->notification_url = config('app.url') . '/mercadopago/listen';
Expand Down

0 comments on commit 23562c3

Please sign in to comment.