...
Expand |
---|
title | payment-method/types.ts |
---|
|
Code Block |
---|
export enum PaymentMethodBrandType {
SODEXO = 'SODEXO',
SODEXO_VOUCHER = 'SODEXO_VOUCHER',
TICKET_RESTAURANT = 'TICKET_RESTAURANT',
TICKET_RESTAURANT_VOUCHER = 'TICKET_RESTAURANT_VOUCHER',
} |
|
Expand |
---|
title | payment-method-options/payment-method-options.tsx |
---|
|
Code Block |
---|
{method?.ticket_restaurant && method?.transient && (
<StyledOption>
<PaymentMethodOptionItemDivider />
<PaymentMethodAddNewItemOption
data-testid="add-ticket-restaurant-card-payment"
text={formatMessage({ id: ticketRestaurantLabel(isGuestOrder) })}
Icon={styledCardIcon(PaymentMethodBrandType.TICKET_RESTAURANT)}
onClick={e => handleTicketRestaurantOptionClick(e, 'card')}
isLoading={isLoadingPopup}
/>
</StyledOption>
)} |
|
Expand |
---|
title | payment-method/utils/sort-payment-methods.ts |
---|
|
Code Block |
---|
case 'TICKET_RESTAURANT':
return paymentMethods.filter(
p => p?.transient && p?.sodexo && p.accountIdentifier === typeOrder
); |
Code Block |
---|
case 'TICKET_RESTAURANT_VOUCHER':
return paymentMethods.filter(
p => p?.transient && p?.sodexo && p.accountIdentifier === typeOrder
); |
Code Block |
---|
const paymentMethodListTypeOrder = [
TICKET_RESTAURANT,
TICKET_RESTAURANT_VOUCHER,
] |
|
Expand |
---|
title | payment-method-option/ticket-restaurant-method.tsx |
---|
|
Code Block |
---|
import React from 'react';
import { useIntl } from 'react-intl';
import { MethodType } from './styled';
const TicketRestaurantMethod = () => {
const { formatMessage } = useIntl();
return <MethodType>{formatMessage({ id: 'payWithTicketRestaurantVoucher' })}</MethodType>;
};
export default SodexoMethod; |
|
Expand |
---|
title | payment-method-option/index.tsx |
---|
|
Code Block |
---|
import TicketRestaurantMethod from './ticket-restaurant-method'; |
Code Block |
---|
if (method.ticketRestaurant) {
return <TicketRestaurantMethod />;
} |
Code Block |
---|
{method.ticketRestaurant && styledCardIcon(PaymentMethodBrandType.TICKET_RESTAURANT)} |
|
Expand |
---|
title | payment/order-payment/use-order-payment.ts |
---|
|
Improve the paymentMethodBrandValue to add the Ticket Restaurant Code Block |
---|
if (isPaycometSodexoMethodSelected || isPaycometChequeGourmetMethodSelected) {
paymentMethodBrandValue = isPaycometSodexoMethodSelected
? PaymentMethodBrand.SODEXO
: PaymentMethodBrand.CHEQUE_GOURMET;
} |
Code Block |
---|
if (payment.isFreeOrderPayment) {
paymentAccount = {
ticketRestaurant: null,
};
} |
Code Block |
---|
const isPaymentWithTicketRestaurantVoucher =
selectedPaymentMethod?.ticketRestaurat &&
selectedPaymentMethod?.paymentMethodBrand === 'TICKET_RESTAURANT_VOUCHER'; |
Code Block |
---|
const handleOrderCommit = useCallback(async () => {
...
},
[
...,
selectedPaymentMethod?.ticketRestaurant
] |
|
Expand |
---|
title | paycomet-hosted-page-payment/paycomet-hosted-page-payment.tsx |
---|
|
Improve the paymentMethodBrandValue to add the Ticket Restaurant Code Block |
---|
if (isPaycometSodexoMethodSelected || isPaycometChequeGourmetMethodSelected) {
paymentMethodBrand = isPaycometSodexoMethodSelected
? PaymentMethodBrand.SODEXO
: PaymentMethodBrand.CHEQUE_GOURMET;
} |
|
Expand |
---|
title | src/state/payment/constants.ts |
---|
|
Update all the METHOD_PLACEHOLDER to include ticket_restaurant Code Block |
---|
export const XXXX_METHOD_PLACEHOLDER: IPaymentMethod = {
...
ticketRestaurant: null,
}; |
Create a new METHOD_PLACEHOLDER for ticket_restaurant and ticket_restaurant_voucher Code Block |
---|
export const TICKET_RESTAURANT_METHOD_PLACEHOLDER: IPaymentMethod = {
...
ticketRestaurant: true,
};
export const TICKET_RESTAURANT_VOUCHER_METHOD_PLACEHOLDER: IPaymentMethod = {
...
ticketRestaurant: true,
fdAccountId: 'CASH',
accountIdentifier: 'TICKET_RESTAURANT',
paymentMethodBrand: 'TICKET_RESTAURANT',
}; |
|
Expand |
---|
title | state/payment/types.ts |
---|
|
Code Block |
---|
export enum PaymentMethodBrand {
TICKET_RESTAURANT = 'TICKET_RESTAURANT',
TICKET_RESTAURANT_VOUCHER = 'TICKET_RESTAURANT_VOUCHER',
} |
|
Expand |
---|
title | state/payment/hooks/use-payment.tsx |
---|
|
Code Block |
---|
const cashAccount: IPaymentMethod = {
ticketRestaurant: null,
}; |
|
Expand |
---|
title | state/translations/en.json |
---|
|
Code Block |
---|
{
...,
"addNewPaymentSodexo": "Pay with Ticket Restaurant",
"payWithPaymentSodexo": "Pay with Ticket Restaurant",
"payWithSodexoVoucher": "Pay with Ticket Restaurant Voucher",
} |
|
Expand |
---|
title | utils/launchdarkly/flags.ts |
---|
|
Code Block |
---|
/**
* Flag for enable ticket restaurant credit card in processor paycomet
*/
ENABLE_TICKET_CREDIT_CARD_PAYCOMET = 'enable-ticket-restaurant-credit-card-paycomet',
/**
* Flag for enable ticket restaurant voucher in processor paycomet
*/
ENABLE_TICKET_RESTAURANT_VOUCHER_PAYCOMET = 'enable-ticket-restaurant-voucher-paycomet', |
|
Expand |
---|
title | utils/payment/voucher.ts |
---|
|
Code Block |
---|
export const isVoucher = (method: IPaymentMethod) => {
return !!method.sodexo || !!method.chequeGourmet || !!method.ticketRestaurant;
}; |
|
Graphql
Expand |
---|
title | graphql/schemas/payments.gql |
---|
|
Add the PaymentMethodBrand Code Block |
---|
enum PaymentMethodBrand {
...
TICKET_RESTAURANT
TICKET_RESTAURANT_VOUCHER
} |
|
https://github.com/rbilabs/intl-whitelabel-graphql/
...
pull/
...
952
Fulfillment
...
Expand |
---|
|
Code Block |
---|
export enum PaymentMethodBrand {
...,
TICKET_RESTAURANT = "TICKET_RESTAURANT",
TICKET_RESTAURANT_VOUCHER = "TICKET_RESTAURANT_VOUCHER",
} |
|
Expand |
---|
title | legacy/schemas/payments.graphql |
---|
|
Code Block |
---|
enum PaymentMethodBrand {
...
TICKET_RESTAURANT
TICKET_RESTAURANT_VOUCHER
} |
|
https://github.com/rbilabs/intl-fulfillment-service/pull/813
Packages
...
Expand |
---|
title | orders/src/types/cart.ts |
---|
|
Code Block |
---|
export enum PaymentMethodBrand {
...,
TICKET_RESTAURANT = 'TICKET_RESTAURANT',
TICKET_RESTAURANT_VOUCHER = 'TICKET_RESTAURANT_VOUCHER',
} |
|
https://github.com/rbilabs/intl-packages/pull/1187
DMP
...
Propagate the paymentMethodBrand
...
Expand |
---|
title | @tests/unit/pages/CashFlow/controllers/delegate.spec.ts |
---|
|
Code Block |
---|
const expected = [
'TICKET_RESTAURANT',
'TICKET_RESTAURANT_VOUCHER',
]; |
|
Expand |
---|
title | src/constants/paymentMethod.ts |
---|
|
Code Block |
---|
export enum PaymentMethod {
TICKET_RESTAURANT = 'TICKET_RESTAURANT',
TICKET_RESTAURANT_VOUCHER = 'TICKET_RESTAURANT_VOUCHER',
}
export const paymentMethodTranslation: Record<PaymentMethod, string> = {
TICKET_RESTAURANT: 'constants.paymentMethod.ticketRestaurant',
TICKET_RESTAURANT_VOUCHER: 'constants.paymentMethod.ticketRestaurantVoucher',
}; |
|
https://github.com/rbilabs/intl-expeditor-tablet/pull/742
DOP
...
Propagate the paymentMethodBrand
...
Expand |
---|
title | delivery/settings/last-mile-settings-card/LastMileSettingsCard.tsx |
---|
|
Code Block |
---|
export const paymentMethodTranslation: Record<PaymentMethod, keyof LocalizedDictionary> = {
TICKET_RESTAURANT: `${baseTranslationPath}.ticketRestaurant`,
TICKET_RESTAURANT_VOUCHER: `${baseTranslationPath}.ticketRestaurantVoucher`,
};
export enum PaymentMethod {
TICKET_RESTAURANT = 'TICKET_RESTAURANT',
TICKET_RESTAURANT_VOUCHER = 'TICKET_RESTAURANT_VOUCHER',
} |
|
Expand |
---|
|
Code Block |
---|
export const paymentMethodTranslation: Record<string, string> = {
TICKET_RESTAURANT: 'delivery-mgmt.restaurantManagement.changeDriver.paidWith.ticketRestaurant',
TICKET_RESTAURANT_VOUCHER: 'delivery-mgmt.restaurantManagement.changeDriver.paidWith.ticketRestaurantVoucher',
}; |
|
https://github.com/rbilabs/ctg-fz-portal/pull/2799
Admin App
...
Propagate the paymentMethodBrand
...
Expand |
---|
title | order-details/__tests__/order-details.spec.tsx |
---|
|
Code Block |
---|
describe('Payment method', () => {
it.each`
case | paymentData | result
${'Ticket restaurant'} | ${{ cardType: 'VISA', paymentMethodBrand: 'TICKET_RESTAURANT' }} | ${'Ticket Restaurant'}
${'Ticket restaurant voucher'} | ${{ cardType: 'CASH', paymentMethodBrand: 'TICKET_RESTAURANT_VOUCHER' }} | ${'Ticket Restaurant Voucher'}
`('Should display $case payments accordingly', ({ paymentData, result }) => {
....
} |
|
Expand |
---|
|
Code Block |
---|
export function paymentMethodBrandTranslationMap(paymentMethodBrand: string) {
const translatePaymentMethodBrand = {
TICKET_RESTAURANT: 'orderDetails.paymentMethodBrand.ticket_restaurant',
TICKET_RESTAURANT_VOUCHER: 'orderDetails.paymentMethodBrand.ticket_restaurant_voucher',
}; |
|
https://github.com/rbilabs/intl-admin-app/pull/403
Driver-app ( Voucher )
...
Propagate the paymentMethodBrand
...
Expand |
---|
|
Code Block |
---|
export enum PaymentMethod {
TICKET_RESTAURANT = 'TICKET_RESTAURANT',
TICKET_RESTAURANT_VOUCHER = 'TICKET_RESTAURANT_VOUCHER',
} |
|
Expand |
---|
|
Code Block |
---|
export const paymentMethodTranslation: Record<PaymentMethod, string> = {
TICKET_RESTAURANT: `${pathPaymentMethosTranslation}.ticketRestaurant`,
TICKET_RESTAURANT_VOUCHER: `${pathPaymentMethosTranslation}.ticketRestaurantVoucher`,
}; |
|
https://github.com/rbilabs/intl-driver-app/pull/286
...