...
ENUM | VALUE |
---|
TICKET_RESTAURANT_CARD | TICKET_RESTAURANT_CARD |
TICKET_RESTAURANT_VOUCHER | TICKET_RESTAURANT_VOUCHER |
...
Expand |
---|
title | payment-method/index.tsx |
---|
|
Code Block |
---|
const SelectedTicketRestaurantOptionItem = (
<PaymentMethodAddNewItemOption
text={formatMessage({ id: ticketRestaurantLabel(isGuestOrder) })}
Icon={styledCardIcon(PaymentMethodBrandType.TICKET_RESTAURANT_CARD)}
onClick={getSelectedMethodClickHandler()}
selected
/>
); |
|
Expand |
---|
title | payment-method/styled.tsx |
---|
|
Code Block |
---|
import IconSodexo from 'components/icons/sodexo';
....
export const paymentsMethodIcon: Record<string, IconSVGElement> = {
[PaymentMethodBrandType.SODEXO]: IconSodexo,
[PaymentMethodBrandType.CHEQUE_GOURMET]: IconChequeGourmet,
[PaymentMethodBrandType.TICKET_RESTAURANT_CARD]: IconTicketRestaurant,
}; |
|
Expand |
---|
title | payment-method/types.ts |
---|
|
Code Block |
---|
export enum PaymentMethodBrandType {
SODEXO = 'SODEXO',
SODEXO_VOUCHER = 'SODEXO_VOUCHER',
TICKET_RESTAURANT_CARD = 'TICKET_RESTAURANT_CARD',
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_CARD)}
onClick={e => handleTicketRestaurantOptionClick(e, 'card')}
isLoading={isLoadingPopup}
/>
</StyledOption>
)} |
|
Expand |
---|
title | payment-method/utils/sort-payment-methods.ts |
---|
|
Code Block |
---|
case 'TICKET_RESTAURANT_CARD':
return paymentMethods.filter(
p => p?.transient && p?.sodexoticketRestaurant && p.accountIdentifier === typeOrder
); |
Code Block |
---|
case 'TICKET_RESTAURANT_VOUCHER':
return paymentMethods.filter(
p => p?.transient && p?.sodexoticketRestaurant && p.accountIdentifier === typeOrder
); |
Code Block |
---|
const paymentMethodListTypeOrder = [
TICKET_RESTAURANT_CARD,
TICKET_RESTAURANT_VOUCHER,
] |
|
Expand |
---|
title | payment-method-option/ticket-restaurant-method-flat-list-with-button/payment-method-flat-list-with-button.tsx |
---|
|
Code Block |
---|
import React{
from 'react';
import { useIntl TICKET_RESTAURANT_PAYMENT_METHOD_PLACEHOLDER,
} from 'state/payment/constants'; |
Code Block |
---|
// Exclude .... Ticket Restaurant if it is ...
return paymentMethods.filter(
n =>
...
n.accountIdentifier !== TICKET_RESTAURANT_PAYMENT_METHOD_PLACEHOLDER.accountIdentifier
); |
|
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 | src/state/payment/constants.ts |
---|
|
Update all METHOD_PLACEHOLDER to include ticket_restaurant ticketRestaurant with null value Code Block |
---|
export const XXXX_METHOD_PLACEHOLDER: IPaymentMethod = {
...
ticketRestaurant: null,
}; |
Create a new METHOD_PLACEHOLDER for ticket_restaurant_card 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_CARD',
TICKET_RESTAURANT_VOUCHER = 'TICKET_RESTAURANT_VOUCHER',
} |
Code Block |
---|
export interface IPaymentMethod {
ticketRestaurant?: boolean | null;
} |
|
...
Expand |
---|
title | graphql/schemas/payments.gql |
---|
|
Add the PaymentMethodBrand Code Block |
---|
enum PaymentMethodBrand {
...
TICKET_RESTAURANT_CARD
TICKET_RESTAURANT_VOUCHER
} |
|
...
Expand |
---|
|
Code Block |
---|
export enum PaymentMethodBrand {
...,
TICKET_RESTAURANT_CARD = "TICKET_RESTAURANT_CARD",
TICKET_RESTAURANT_VOUCHER = "TICKET_RESTAURANT_VOUCHER",
} |
|
Expand |
---|
title | legacy/schemas/payments.graphql |
---|
|
Code Block |
---|
enum PaymentMethodBrand {
...
TICKET_RESTAURANT_CARD
TICKET_RESTAURANT_VOUCHER
} |
|
https://github.com/rbilabs/intl-fulfillment-service/pull/813
...
Packages
/wiki/spaces/IBC/pages/4590338104
Expand |
---|
title | orders/src/types/cart.ts |
---|
|
Code Block |
---|
export enum PaymentMethodBrand {
...,
TICKET_RESTAURANT_CARD = 'TICKET_RESTAURANT_CARD',
TICKET_RESTAURANT_VOUCHER = 'TICKET_RESTAURANT_VOUCHER',
} |
|
...
Expand |
---|
title | @tests/unit/pages/CashFlow/controllers/delegate.spec.ts |
---|
|
Code Block |
---|
const expected = [
'TICKET_RESTAURANT_CARD',
'TICKET_RESTAURANT_VOUCHER',
]; |
|
Expand |
---|
title | src/constants/paymentMethod.ts |
---|
|
Code Block |
---|
export enum PaymentMethod {
TICKET_RESTAURANT_CARD = 'TICKET_RESTAURANT_CARD',
TICKET_RESTAURANT_VOUCHER = 'TICKET_RESTAURANT_VOUCHER',
}
export const paymentMethodTranslation: Record<PaymentMethod, string> = {
TICKET_RESTAURANT_CARD: 'constants.paymentMethod.ticketRestaurantticketRestaurantCard',
TICKET_RESTAURANT_VOUCHER: 'constants.paymentMethod.ticketRestaurantVoucher'ticketRestaurantVoucher',
}; |
|
Expand |
---|
|
Code Block |
---|
"paymentMethod": {
"ticketRestaurantCard": "Ticket Restaurant",
"ticketRestaurantVoucher": "Ticket Restaurant Voucher",
};, |
|
https://github.com/rbilabs/intl-expeditor-tablet/pull/742
...
Expand |
---|
title | delivery/settings/last-mile-settings-card/LastMileSettingsCard.tsx |
---|
|
Code Block |
---|
export const paymentMethodTranslation: Record<PaymentMethod, keyof LocalizedDictionary> = {
TICKET_RESTAURANT_CARD: `${baseTranslationPath}.ticketRestaurant`ticketRestaurantCard`,
TICKET_RESTAURANT_VOUCHER: `${baseTranslationPath}.ticketRestaurantVoucher`,
};
export enum PaymentMethod {
TICKET_RESTAURANT_CARD = 'TICKET_RESTAURANT_CARD',
TICKET_RESTAURANT_VOUCHER = 'TICKET_RESTAURANT_VOUCHER',
} |
|
Expand |
---|
|
Code Block |
---|
export const paymentMethodTranslation: Record<string, string> = {
TICKET_RESTAURANT_CARD: 'delivery-mgmt.restaurantManagement.changeDriver.paidWith.ticketRestaurantticketRestaurantCard',
TICKET_RESTAURANT_VOUCHER: 'delivery-mgmt.restaurantManagement.changeDriver.paidWith.ticketRestaurantVoucher',
}; |
|
Expand |
---|
|
Code Block |
---|
"paidWith": {
"ticketRestaurantCard": "Ticket Restaurant",
"ticketRestaurantVoucher": "Ticket Restaurant Voucher",
};, |
|
https://github.com/rbilabs/ctg-fz-portal/pull/2799
...
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_CARD' }} | ${'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_CARD: 'orderDetails.paymentMethodBrand.ticket_restaurant_card',
TICKET_RESTAURANT_VOUCHER: 'orderDetails.paymentMethodBrand.ticket_restaurant_voucher',
}; |
|
Expand |
---|
|
Code Block |
---|
"paymentMethods": {
"ticket_restaurant_card": "Ticket Restaurant",
"ticket_restaurant_voucher": "Ticket Restaurant Voucher",
}, |
|
https://github.com/rbilabs/intl-admin-app/pull/403
...
Expand |
---|
|
Code Block |
---|
export enum PaymentMethod {
TICKET_RESTAURANT_CARD = 'TICKET_RESTAURANT_CARD',
TICKET_RESTAURANT_VOUCHER = 'TICKET_RESTAURANT_VOUCHER',
} |
|
Expand |
---|
|
Code Block |
---|
export const paymentMethodTranslation: Record<PaymentMethod, string> = {
TICKET_RESTAURANT: `${pathPaymentMethosTranslation}.ticketRestaurant`,
TICKET_RESTAURANT_VOUCHER: `${pathPaymentMethosTranslation}.ticketRestaurantVoucher`,
}; paymentMethodTranslation: Record<PaymentMethod, string> = {
TICKET_RESTAURANT_CARD: `${pathPaymentMethosTranslation}.ticketRestaurantCard`,
TICKET_RESTAURANT_VOUCHER: `${pathPaymentMethosTranslation}.ticketRestaurantVoucher`,
}; |
|
Expand |
---|
|
Code Block |
---|
"paymentMethods": {
"ticketRestaurantCard": "Ticket Restaurant",
"ticketRestaurantVoucher": "Ticket Restaurant Voucher",
}, |
|
https://github.com/rbilabs/intl-driver-app/pull/286
...
Scenarios | Description | PaymentMethod | PaymentMethodBrand |
---|
The user wants to make a purchase via restaurant ticket | It should display the payment option via ticket restaurant and when clicked, a jet iframe for credit card appears. | CREDIT | TICKET_RESTAURANT_CARD |
The user wants to make a purchase via restaurant ticket voucher | It should display the payment option via ticket restaurant voucher and when clicked, only a pay button will appear | CASH | TICKET_RESTAURANT_VOUCHER |
The user select restaurant ticket and change the payment method | It should be possible to change the payment method when restaurant ticket is selected | CREDIT | TICKET_RESTAURANT_CARD |
The user select restaurant ticket and change the payment method | It should be possible to change the payment method when restaurant ticket is selected | CASH | TICKET_RESTAURANT_VOUCHER |
If the user purchases via restaurant ticket voucher, the payment method must be displayed in the Driver-app. | It should be possible to see which paymentMethodBrand was chosen in the Driver-app. | CASH | TICKET_RESTAURANT_VOUCHER |
If the user purchases via restaurant ticket, the payment method must be displayed in the DMP. | It should be possible to see which paymentMethodBrand was chosen in the DMP. | CREDIT or CASH | TICKET_RESTAURANT_CARD or TICKET_RESTAURANT_VOUCHER |
If the user purchases via restaurant ticket, the payment method must be displayed in the DOP. | It should be possible to see which paymentMethodBrand was chosen in the DOP. | CREDIT or CASH | TICKET_RESTAURANT_CARD or TICKET_RESTAURANT_VOUCHER |
If the user purchases via restaurant ticket, the payment method must be displayed in the ADMIN APP. | It should be possible to see which paymentMethodBrand was chosen in the ADMIN APP. | CREDIT or CASH | TICKET_RESTAURANT_CARD or TICKET_RESTAURANT_VOUCHER |
...
To make payments with the Ticket Restaurant card, we can use the same cards used for credit card payments. This integration with meal voucher cards is activated at restaurant points, together with Paycomet. We just need to validate that the credit card field is displayed to the user and that they can follow the same credit card payment flow and the paymentMethodBrand is filled with “TICKET_RESTAURANT_RESTAURANT”CARD”.
...
Ticket Restaurant Voucher
To make payments with the Ticket Restaurante Voucher, it is necessary to ensure that the process follows the CASH flow and the paymentMethodBrand is filled with “TICKET_RESTAURANT_VOUCHER”, where payment only occurs when the order is delivered to the customer and is made in person.
...
Payment Methods
...
It should be possible to select the restaurant card ticket as the main option to be chosen when the user enters the payment screen. You must be aware that the ticket restaurant card is not to be displayed in this list, only the voucher.
...
Possible Issues
Ticket Restaurant not accepted in payment request via paycomet
...