Gateways: Braintree: Credit card: Pay with new card and save for future use

This commit is contained in:
Benjamin Beganović 2021-07-09 15:59:25 +02:00
parent 20fdbc19d5
commit 617e51b7c3

View File

@ -62,4 +62,28 @@ class CreditCardTest extends DuskTestCase
->waitForText('Details of the payment', 60); ->waitForText('Details of the payment', 60);
}); });
} }
public function testPayWithNewCardAndSaveForFuture()
{
$this->browse(function (Browser $browser) {
$browser
->visitRoute('client.invoices.index')
->click('@pay-now')
->press('Pay Now')
->clickLink('Credit Card')
->waitFor('#braintree-hosted-field-number', 60)
->withinFrame('#braintree-hosted-field-number', function (Browser $browser) {
$browser->type('credit-card-number', '4111111111111111');
})
->withinFrame('#braintree-hosted-field-expirationDate', function (Browser $browser) {
$browser->type('expiration', '04/25');
})
->radio('#proxy_is_default', true)
->press('Pay Now')
->waitForText('Details of the payment', 60)
->visitRoute('client.payment_methods.index')
->clickLink('View')
->assertSee('1111');
});
}
} }