Download wp-calypso/client/my-sites/purchases/utils.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 462 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/my-sites/purchases/utils.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/my-sites/purchases/utils.js
-
curl -L -o utils.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/my-sites/purchases/utils.js
462 Bytes
| import { isPaidWithCreditCard } from 'calypso/lib/purchases'; | |
| import { getAddPaymentMethodUrlFor, getChangePaymentMethodUrlFor } from './paths'; | |
| export function getChangeOrAddPaymentMethodUrlFor( siteSlug, purchase ) { | |
| if ( isPaidWithCreditCard( purchase ) ) { | |
| const { | |
| payment: { creditCard }, | |
| } = purchase; | |
| return getChangePaymentMethodUrlFor( siteSlug, purchase.id, creditCard.id ); | |
| } | |
| return getAddPaymentMethodUrlFor( siteSlug, purchase.id ); | |
| } | |