const dropin = await Purse.createDropinCheckout({
session: clientSession.widget.data,
hooks: {
async onRefreshSession() {
const newSession = await fetch('/api/payment-session', { method: 'POST' })
.then(res => res.json());
await dropin.setSession(newSession.widget.data);
},
},
});