Skip to main content

useSelectedPaymentOptions
hook

Returns payment options selected by the buyer.

Anchor to useSelectedPaymentOptions
useSelectedPaymentOptions()

[]
Was this section helpful?

Selected payment options

React

import React from 'react';
import {
render,
Banner,
useSelectedPaymentOptions,
} from '@shopify/checkout-ui-extensions-react';

render('Checkout::Dynamic::Render', () => (
<Extension />
));

function Extension() {
const options = useSelectedPaymentOptions();

if (
options.some(
(option) => option.type === 'creditCard',
)
) {
return (
<Banner>
All credit card transactions are secure
</Banner>
);
}

return null;
}