mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-11 05:32:39 +01:00
65 lines
1.7 KiB
PHP
65 lines
1.7 KiB
PHP
|
<?php
|
||
|
/**
|
||
|
* Invoice Ninja (https://invoiceninja.com).
|
||
|
*
|
||
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||
|
*
|
||
|
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||
|
*
|
||
|
* @license https://opensource.org/licenses/AAL
|
||
|
*/
|
||
|
namespace Tests\Feature;
|
||
|
|
||
|
use App\Models\CompanyGateway;
|
||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||
|
use Illuminate\Routing\Middleware\ThrottleRequests;
|
||
|
use Tests\MockAccountData;
|
||
|
use Tests\TestCase;
|
||
|
|
||
|
/**
|
||
|
* @test
|
||
|
* @covers App\Http\Controllers\ApplePayDomainController
|
||
|
*/
|
||
|
class ApplePayDomainMerchantUrlTest extends TestCase
|
||
|
{
|
||
|
use DatabaseTransactions;
|
||
|
use MockAccountData;
|
||
|
|
||
|
public function setUp() :void
|
||
|
{
|
||
|
parent::setUp();
|
||
|
|
||
|
$this->makeTestData();
|
||
|
|
||
|
$this->withoutMiddleware(
|
||
|
ThrottleRequests::class
|
||
|
);
|
||
|
}
|
||
|
|
||
|
public function testMerchantFieldGet()
|
||
|
{
|
||
|
$config = new \stdClass;
|
||
|
$config->publishableKey = "pk_test";
|
||
|
$config->apiKey = "sk_test";
|
||
|
$config->appleMerchantId = "merchant_id";
|
||
|
|
||
|
$cg = new CompanyGateway;
|
||
|
$cg->company_id = $this->company->id;
|
||
|
$cg->user_id = $this->user->id;
|
||
|
$cg->gateway_key = 'd14dd26a37cecc30fdd65700bfb55b23';
|
||
|
$cg->require_cvv = true;
|
||
|
$cg->require_billing_address = true;
|
||
|
$cg->require_shipping_address = true;
|
||
|
$cg->update_details = true;
|
||
|
$cg->config = encrypt(json_encode($config));
|
||
|
$cg->fees_and_limits = '';
|
||
|
$cg->save();
|
||
|
|
||
|
$response = $this->withHeaders([])->get('.well-known/apple-developer-merchantid-domain-association');
|
||
|
|
||
|
$arr = $response->getContent();
|
||
|
$response->assertStatus(200);
|
||
|
$this->assertEquals("merchant_id", $arr);
|
||
|
}
|
||
|
}
|