Gateways: Stripe: Remove credit card

This commit is contained in:
Benjamin Beganović 2021-07-07 13:21:13 +02:00
parent e436551254
commit 51dbae59d4
2 changed files with 14 additions and 1 deletions

View File

@ -36,7 +36,7 @@
<form action="{{ route('client.payment_methods.destroy', [$payment_method->hashed_id, 'method' => $payment_method->gateway_type->id]) }}" method="post">
@csrf
@method('DELETE')
<button type="submit" class="button button-danger button-block" data-cy="confirm-payment-removal">
<button type="submit" class="button button-danger button-block" dusk="confirm-payment-removal">
{{ ctrans('texts.remove') }}
</button>
</form>

View File

@ -99,4 +99,17 @@ class CreditCardTest extends DuskTestCase
->waitForText('Details of the payment');
});
}
public function testRemoveCreditCard()
{
$this->browse(function (Browser $browser) {
$browser
->visitRoute('client.payment_methods.index')
->clickLink('View')
->press('Remove Payment Method')
->waitForText('Confirmation')
->click('@confirm-payment-removal')
->assertSee('Payment method has been successfully removed.');
});
}
}