## PaymentMethod event `paymentRequest.on(event: string, handler: function)`

Stripe.js automatically creates a [PaymentMethod](https://docs.stripe.com/api/payment_methods.md) after the customer is done interacting with the browser’s payment interface. To access the created `PaymentMethod`, listen for this event.

- `event` The name of the event. In this case, `paymentmethod`.
- `handler` A callback function that will be called with a [PaymentResponse](https://docs.stripe.com/js/appendix/payment_response.md) object when the event is fired. The `PaymentResponse` object will contain a `paymentMethod` field.

### Example

```javascript
paymentRequest.on('paymentmethod', (event) => {
  // Handle the payment method
  // event.paymentMethod.id
  // event.complete('success');
});
```