* import { useSavedPayments } from '@magento/peregrine/lib/talons/SavedPaymentsPage/useSavedPaymentsPage';
*/
-export const useSavedPaymentsPage = props => {
- const {
- queries: { getSavedPaymentsQuery }
- } = props;
+export const useSavedPaymentsPage = (props = {}) => {
+ const operations = mergeOperations(defaultOperations, props.operations);
+ const { getSavedPaymentsQuery } = operations;
const [
,
@@ -68,14 +70,9 @@ export const useSavedPaymentsPage = props => {
setPageLoading(loading);
}, [loading, setPageLoading]);
- const handleAddPayment = useCallback(() => {
- // TODO in PWA-637
- }, []);
-
const savedPayments = normalizeTokens(savedPaymentsData);
return {
- handleAddPayment,
isLoading: loading,
savedPayments
};
@@ -90,7 +87,7 @@ export const useSavedPaymentsPage = props => {
*
* @property {GraphQLAST} getSavedPaymentsQuery Query for getting saved payments. See https://devdocs.magento.com/guides/v2.4/graphql/queries/customer-payment-tokens.html
*
- * @see [savedPaymentsPage.gql.js]{@link https://github.com/magento/pwa-studio/blob/develop/packages/venia-ui/lib/components/SavedPaymentsPage/savedPaymentsPage.gql.js}
+ * @see [savedPaymentsPage.gql.js]{@link https://github.com/magento/pwa-studio/blob/develop/packages/peregrine/lib/talons/SavedPaymentsPage/savedPaymentsPage.gql.js}
* for queries used in Venia
*/
diff --git a/packages/venia-ui/i18n/en_US.json b/packages/venia-ui/i18n/en_US.json
index c782dbeb7e..cc86197d28 100644
--- a/packages/venia-ui/i18n/en_US.json
+++ b/packages/venia-ui/i18n/en_US.json
@@ -51,8 +51,8 @@
"categoryLeaf.allLabel": "All {name}",
"categoryList.errorFetch": "Data Fetch Error: ",
"categoryList.noResults": "No child categories found.",
- "checkoutPage.additionalText": "You will also receive an email with the details and we will let you know when your order has shipped.",
"checkoutPage.accountSuccessfullyCreated": "Account successfully created.",
+ "checkoutPage.additionalText": "You will also receive an email with the details and we will let you know when your order has shipped.",
"checkoutPage.billingAddressSame": "Billing address same as shipping address",
"checkoutPage.checkout": "Checkout",
"checkoutPage.couponCode": "Enter Coupon Code",
@@ -84,8 +84,8 @@
"checkoutPage.quantity": "Qty : {quantity}",
"checkoutPage.quickCheckout": "Quick Checkout When You Return",
"checkoutPage.returnToCart": "Return to Cart",
- "checkoutPage.reviewOrder": "Review Order",
"checkoutPage.reviewAndPlaceOrder": "Review and Place Order",
+ "checkoutPage.reviewOrder": "Review Order",
"checkoutPage.setAPasswordAndSave": "Set a password and save your information for next time in one easy step!",
"checkoutPage.shippingMethodStep": "2. Shipping Method",
"checkoutPage.showAllItems": "SHOW ALL ITEMS",
@@ -206,8 +206,8 @@
"Live Chat": "Live Chat",
"loadingIndicator.message": "Fetching Data...",
"logo.title": "Venia",
- "magentoRoute.routeError": "That page could not be found. Please try again.",
"magentoRoute.internalError": "Something went wrong. Please try again.",
+ "magentoRoute.routeError": "That page could not be found. Please try again.",
"miniCart.checkout": "CHECKOUT",
"miniCart.editCartButton": "Edit Shopping Bag",
"miniCart.emptyMessage": "There are no items in your cart.",
@@ -228,6 +228,7 @@
"orderDetails.billingInformationLabel": "Billing Information",
"orderDetails.buyAgain": "Buy Again",
"orderDetails.discount": "Discount",
+ "orderDetails.noShippingInformation": "No shipping information",
"orderDetails.orderTotal": "Order Total",
"orderDetails.paymentMethodLabel": "Payment Method",
"orderDetails.printLabel": "Print Receipt",
@@ -240,8 +241,10 @@
"orderDetails.tax": "Tax",
"orderDetails.total": "Total",
"orderDetails.trackingInformation": "Tracking number: {number}",
+ "orderDetails.waitingOnTracking": "Waiting for tracking information",
"orderHistoryPage.emptyDataMessage": "You don't have any orders yet.",
"orderHistoryPage.pageTitleText": "Order History",
+ "orderItems.itemsHeading": "Items",
"orderProgressBar.deliveredText": "Delivered",
"orderProgressBar.processingText": "Processing",
"orderProgressBar.readyToShipText": "Ready to ship",
@@ -255,9 +258,10 @@
"orderRow.shippedText": "Shipped",
"Our Story": "Our Story",
"pagination.firstPage": "move to the first page",
- "pagination.prevPage": "move to the previous page",
- "pagination.nextPage": "move to the next page",
"pagination.lastPage": "move to the last page",
+ "pagination.nextPage": "move to the next page",
+ "pagination.prevPage": "move to the previous page",
+ "postcode.label": "ZIP / Postal Code",
"priceAdjustments.couponCode": "Enter Coupon Code",
"priceAdjustments.giftOptions": "See Gift Options",
"priceAdjustments.shippingMethod": "Estimate your Shipping",
@@ -295,7 +299,6 @@
"productOptions.selectedLabel": "Selected {label}:",
"productQuantity.label": "product's quantity",
"productSort.sortButton": "Sort",
- "postcode.label": "ZIP / Postal Code",
"quantity.buttonDecrement": "Decrease Quantity",
"quantity.buttonIncrement": "Increase Quantity",
"quantity.input": "Item Quantity",
@@ -305,13 +308,13 @@
"resetPassword.invalidTokenMessage": "Uh oh, something went wrong. Check the link or try again.",
"resetPassword.newPasswordText": "New Password",
"resetPassword.pageTitleText": "Reset Password",
- "resetPassword.savePassword": "Save Password",
"resetPassword.savedPasswordText": "Your new password has been saved.",
+ "resetPassword.savePassword": "Save Password",
"resetPassword.successMessage": "Your new password has been saved. Please use this password to sign into your Account.",
"Returns": "Returns",
"savedPaymentsPage.addButtonText": "Add a credit card",
- "savedPaymentsPage.subHeading": "Credit Cards saved here will be available during checkout.",
- "savedPaymentsPage.title": "Saved Payments - {store_name}",
+ "savedPaymentsPage.noSavedPayments": "You have no saved payments.",
+ "savedPaymentsPage.title": "Saved Payments",
"searchBar.heading": "Product Suggestions",
"searchBar.label": " in {label}",
"searchPage.filterButton": "Filter",
@@ -330,14 +333,14 @@
"shippingInformation.editTitle": "1. Shipping Information",
"shippingInformation.loading": "Fetching Shipping Information...",
"shippingMethod.continueToNextStep": "Continue to Payment Information",
- "shippingMethod.loading": "Loading shipping methods...",
"shippingMethod.heading": "Shipping Method",
+ "shippingMethod.loading": "Loading shipping methods...",
"shippingMethods.estimateButton": "I want to estimate my shipping",
"shippingMethods.message": "For shipping estimates before proceeding to checkout, please provide the Country, State, and ZIP for the destination of your order.",
"shippingMethods.prompt": "Shipping Methods",
+ "shippingRadios.errorLoading": "Error loading shipping methods. Please ensure a shipping address is set and try again.",
"shippingSummary.estimatedShipping": "Estimated Shipping",
"shippingSummary.shipping": "Shipping",
- "shippingRadios.errorLoading": "Error loading shipping methods. Please ensure a shipping address is set and try again.",
"Sign In": "Sign In",
"signIn.createAccountText": "Create an Account",
"signIn.emailAddressText": "Email address",
@@ -350,6 +353,8 @@
"sortItem.priceDesc": "Price: High to Low",
"sortItem.relevance": "Best Match",
"stockStatusMessage.message": "An item in your cart is currently out-of-stock and must be removed in order to Checkout.",
+ "storedPayments.creditCard": "Credit Card",
+ "storedPayments.delete": "Delete",
"taxSummary.estimatedTax": "Estimated Tax",
"taxSummary.tax": "Tax",
"validation.hasLengthAtLeast": "Must contain at least {value} character(s).",
@@ -366,21 +371,18 @@
"wishlist.emptyListText": "There are currently no items in this list",
"wishlist.privateText": "Private",
"wishlist.publicText": "Public",
+ "wishlistConfirmRemoveProductDialog.confirmationPrompt": "Are you sure you want to delete this product from the list?",
+ "wishlistConfirmRemoveProductDialog.confirmButton": "Delete",
+ "wishlistConfirmRemoveProductDialog.errorMessage": "There was an error deleting this product. Please try again later.",
+ "wishlistConfirmRemoveProductDialog.title": "Remove Product from Wishlist",
"wishlistItem.addToCart": "Add to Cart",
"wishlistItem.addToCartError": "Something went wrong. Please refresh and try again.",
"wishlistMoreActionsDialog.copy": "Copy to",
"wishlistMoreActionsDialog.delete": "Remove",
"wishlistMoreActionsDialog.move": "Move to",
"wishlistMoreActionsDialog.title": "Actions",
- "wishlistConfirmRemoveProductDialog.confirmButton": "Delete",
- "wishlistConfirmRemoveProductDialog.confirmationPrompt": "Are you sure you want to delete this product from the list?",
- "wishlistConfirmRemoveProductDialog.errorMessage": "There was an error deleting this product. Please try again later.",
- "wishlistConfirmRemoveProductDialog.title": "Remove Product from Wishlist",
"wishlistPage.disabledMessage": "Sorry, this feature has been disabled.",
"wishlistPage.fetchErrorMessage": "Something went wrong. Please refresh and try again.",
"wishlistPage.headingText": "Favorites Lists",
- "wishlistPage.wishlistDisabledMessage": "The wishlist is not currently available.",
- "orderDetails.waitingOnTracking": "Waiting for tracking information",
- "orderItems.itemsHeading": "Items",
- "orderDetails.noShippingInformation": "No shipping information"
+ "wishlistPage.wishlistDisabledMessage": "The wishlist is not currently available."
}
diff --git a/packages/venia-ui/lib/components/CheckoutPage/PaymentInformation/paymentMethodCollection.js b/packages/venia-ui/lib/components/CheckoutPage/PaymentInformation/paymentMethodCollection.js
index ff47c24c3a..6250110945 100644
--- a/packages/venia-ui/lib/components/CheckoutPage/PaymentInformation/paymentMethodCollection.js
+++ b/packages/venia-ui/lib/components/CheckoutPage/PaymentInformation/paymentMethodCollection.js
@@ -1,6 +1,7 @@
/**
* This file is augmented at build time using the @magento/venia-ui build
- * target "payments", which allows third-party modules to add new payment component mappings.
+ * target "checkoutPagePaymentTypes", which allows third-party modules to
+ * add new payment component mappings for the checkout page.
*
* @see [Payment definition object]{@link PaymentDefinition}
*/
@@ -17,6 +18,6 @@ export default {};
* @example
+ * targets.of('@magento/venia-ui').savedPaymentTypes.tap(
+ * savedPaymentTypes => savedPaymentTypes.add({
+ * paymentCode: 'braintree',
+ * importPath: '@magento/braintree_payment'
+ * })
+ * );
+ */
+ savedPaymentTypes: new targets.types.Sync(['savedPaymentTypes'])
});
};
@@ -181,24 +204,24 @@ module.exports = targets => {
* }
*/
-/** Type definition related to: payments */
+/** Type definition related to: checkoutPagePaymentTypes */
/**
- * Intercept function signature for the `payments` target.
+ * Intercept function signature for the `checkoutPagePaymentTypes` target.
*
- * Interceptors of `payments` should call `.add` on the provided [payment list]{@link #PaymentMethodList}.
+ * Interceptors of `checkoutPagePaymentTypes` should call `.add` on the provided [payment list]{@link #CheckoutPaymentTypesDefinition}.
*
* @callback paymentInterceptFunction
*
- * @param {PaymentMethodList} renderers The list of payments registered
+ * @param {CheckoutPaymentTypesDefinition} renderers The list of payments registered
* so far in the build.
*
*/
/**
- * A payment definition object that describes a payment in your storefront.
+ * A payment definition object that describes a checkout page payment in your storefront.
*
- * @typedef {Object} PaymentDefinition
+ * @typedef {Object} CheckoutPaymentDefinition
* @property {string} paymentCode is use to map your payment
* @property {string} importPath Resolvable path to the component the
* Route component will render
@@ -210,24 +233,24 @@ module.exports = targets => {
* }
*/
-/** Type definition related to: payments */
+/** Type definition related to: savedPaymentTypes */
/**
- * Intercept function signature for the `payments` target.
+ * Intercept function signature for the `savedPaymentTypes` target.
*
- * Interceptors of `payments` should call `.add` on the provided [payment list]{@link #PaymentMethodList}.
+ * Interceptors of `savedPaymentTypes` should call `.add` on the provided [payment list]{@link #SavedPaymentTypesDefinition}.
*
- * @callback paymentInterceptFunction
+ * @callback savedPaymentInterceptFunction
*
- * @param {PaymentMethodList} renderers The list of payments registered
+ * @param {SavedPaymentTypesDefinition} renderers The list of saved payments registered
* so far in the build.
*
*/
/**
- * A payment definition object that describes a payment in your storefront.
+ * A payment definition object that describes a saved payment in your storefront.
*
- * @typedef {Object} PaymentDefinition
+ * @typedef {Object} SavedPaymentDefinition
* @property {string} paymentCode is use to map your payment
* @property {string} importPath Resolvable path to the component the
* Route component will render
@@ -235,6 +258,6 @@ module.exports = targets => {
* @example