<?php

namespace App\Providers;

use Illuminate\Support\Facades\Http;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        Http::macro('nowPayment', function () {
            return Http::withHeaders([
                'Accept' => 'text/plain',
                'x-api-key' => config('services.nowpayment.api_key'),
                'Content-Type' => 'application/json',
            ])->baseUrl('https://api.nowpayments.io/v1');
        });
    }
}
