Skip to content

Conversation

@awalker-stripe
Copy link
Contributor

@awalker-stripe awalker-stripe commented Nov 12, 2022

Summary & motivation

Adds component for the payButton element.

Testing & documentation

Performed manual testing using a local React project.

@awalker-stripe awalker-stripe marked this pull request as ready for review November 14, 2022 22:53
PaymentRequestButtonElementComponent,
CartElementComponent,
} from '../types';
import {PayButtonElement} from '..';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we instead do import PayButtonElementComponent in the above import line?

Comment on lines 554 to 572
it('propagates the Element`s lineitemclick event to the current onConfirm prop', () => {
const mockHandler = jest.fn();
const mockHandler2 = jest.fn();
const {rerender} = render(
<Elements stripe={mockStripe}>
<PayButtonElement onConfirm={mockHandler} />
</Elements>
);
rerender(
<Elements stripe={mockStripe}>
<PayButtonElement onConfirm={mockHandler2} />
</Elements>
);

const confirmEventMock = Symbol('lineitemclick');
simulateConfirm(confirmEventMock);
expect(mockHandler2).toHaveBeenCalledWith(confirmEventMock);
expect(mockHandler).not.toHaveBeenCalled();
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe an accidental copy-paste?

Copy link
Contributor Author

@awalker-stripe awalker-stripe Nov 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, good catch, ty!

/**
* Triggered when a buyer authorizes a payment within a supported payment method.
*/
onConfirm: (event: stripeJs.StripePayButtonElementConfirmEvent) => any;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants