Skip to content

Instantly share code, notes, and snippets.

@BryanHeath
Last active July 4, 2017 20:02
Show Gist options
  • Save BryanHeath/1547d8194b5f521cd16512d4a5d88d61 to your computer and use it in GitHub Desktop.
Save BryanHeath/1547d8194b5f521cd16512d4a5d88d61 to your computer and use it in GitHub Desktop.
/** @test */
public function stripe_v3_example()
{
    $this->browse(function (Browser $browser) {
        $browser->visit('/testv3')
                ->waitFor('iframe[name=__privateStripeFrame3]')
                ->assertSee('Name')
                ->keys('input[name="cardholder-name"]', 'Test User')
                ->keys('input[placeholder="(123) 456-7890"]', '555 555 5555')
                ->keys('input[name="address-zip"]', '55555');

        $browser->driver->switchTo()->frame('__privateStripeFrame3');

        $browser->keys('input[name="cardnumber"]', '4242 4242 4242 4242')
                ->keys('input[name="exp-date"]', '11 20')
                ->keys('input[name="cvc"]', '11 20');
 
        $browser->driver->switchTo()->defaultContent();

        $browser->press('Pay $25')
                ->waitForText('Success! Your Stripe token is');
        
    });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment