Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions tests/qa/resources/pcp-gateways.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,21 +274,7 @@ const payUponInvoice: Pcp.Gateway = {
enabled: false,
};

const debitOrCreditCard: Pcp.Gateway = {
shortcut: 'card',
country: 'usa',
currency: 'USD',

id: 'ppcp-gateway',
description: '',
title: 'Credit or debit cards (via PayPal)',
titleInPcpSettings: 'Credit or debit cards',
titleInWcSettings: 'Credit or debit cards (via PayPal)',
hasSettingsButton: true,
enabled: true,
};

const standardCardButton: Pcp.Gateway = {
const bcdc: Pcp.Gateway = {
shortcut: 'card',
country: 'usa',
currency: 'USD',
Expand Down Expand Up @@ -323,6 +309,5 @@ export const gateways = {
multibanco,
oxxo,
payUponInvoice,
debitOrCreditCard,
standardCardButton,
bcdc,
};
12 changes: 3 additions & 9 deletions tests/qa/resources/pcp-payments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,8 @@ const fastlaneRyan: Pcp.Payment = {
card: cards.visaFastlane,
};

const debitOrCreditCard: Pcp.Payment = {
gateway: gateways.debitOrCreditCard,
card: cards.visa,
};

const standardCardButton: Pcp.Payment = {
gateway: gateways.standardCardButton,
const bcdc: Pcp.Payment = {
gateway: gateways.bcdc,
card: cards.visa,
};

Expand All @@ -85,8 +80,7 @@ export const payments = {
acdc3ds,
fastlaneGary,
fastlaneRyan,
debitOrCreditCard,
standardCardButton,
bcdc,
payUponInvoice,
googlePay,
};
Comment thread
mishautkin marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/**
* Internal dependencies
*/
import {
payments,
orders,
customers,
guests,
merchants,
ShopOrder,
} from '../../../../resources';

const customer = customers.mexico;
const guest = guests.mexico;

/**
* BCDC (Branded Card Debit/Credit) — classic checkout only.
* Block checkout is NOT supported).
*/
const merchant = merchants.mexico;

export const bcdcClassicCheckout: ShopOrder[] = [
{
// https://inpsyde.atlassian.net/browse/PCP-1211
title: 'PCP-1211 | Transaction - Classic checkout - BCDC - Default order @Critical',
...orders.default,
payment: payments.bcdc,
customer: guest,
merchant,
},
{
// https://inpsyde.atlassian.net/browse/PCP-2747
title: 'PCP-2747 | Transaction - Classic checkout - BCDC - Order by customer',
...orders.default,
payment: payments.bcdc,
customer,
merchant,
},
];

export const bcdcClassicCheckoutExcludingTax: ShopOrder[] = [
{
// https://inpsyde.atlassian.net/browse/PCP-1253
title: 'PCP-1253 | Transaction - Classic checkout - BCDC - Order with price excluding tax',
...orders.excludingTax,
payment: payments.bcdc,
customer: guest,
merchant,
},
];

export const bcdcClassicCheckoutIntentAuthorized: ShopOrder[] = [
{
// https://inpsyde.atlassian.net/browse/PCP-2759
title: 'PCP-2759 | Transaction - Classic checkout - BCDC - Order with Intent Authorized',
...orders.default,
payment: {
...payments.bcdc,
isAuthorized: true,
},
orderStatus: 'on-hold',
customer: guest,
merchant,
},
];
1 change: 1 addition & 0 deletions tests/qa/tests/05-transactions/_test-data/bcdc/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './bcdc-classic-checkout.data';
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ export const transactionsOnClassicCheckout = ( testOrder: ShopOrder ) => {
await utils.fillVisitorsCart( testOrder.products );
await classicCheckout.visit();
await classicCheckout.completeCheckoutDetails( testOrder );
await classicCheckout.payPalUi.makePayment( { merchant, payment } );
await classicCheckout.payPalUi.makePayment( {
merchant,
payment,
customer,
} );
await orderReceived.assertOrderDetails( testOrder );

const orderId = await orderReceived.getOrderNumber();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/**
* Internal dependencies
*/
import { test } from '../../utils';
import {
merchants,
storeConfigMexico,
gateways,
taxSettings,
customers,
} from '../../resources';
import { transactionsOnClassicCheckout } from './_test-scenarios';
import {
bcdcClassicCheckout,
bcdcClassicCheckoutExcludingTax,
bcdcClassicCheckoutIntentAuthorized,
} from './_test-data/bcdc';

/**
* BCDC
* BCDC is classic-checkout only — block checkout is not supported.
*/

const { payPal, bcdc } = gateways;

test.beforeAll( async ( { utils, pcpApi, wooCommerceApi } ) => {
await utils.configureStore( {
...storeConfigMexico,
enableClassicPages: true,
customer: customers.mexico,
} );
await utils.installAndActivatePcp();
await pcpApi.resetDb();
await pcpApi.connectMerchant(
merchants.mexico.client_id,
merchants.mexico.client_secret
);
await pcpApi.updatePcpPaymentMethods( {
[ payPal.id ]: { id: payPal.id, enabled: true },
[ bcdc.id ]: {
id: bcdc.id,
enabled: true,
},
} );
await wooCommerceApi.deleteAllOrders();
} );

for ( const testOrder of bcdcClassicCheckout ) {
transactionsOnClassicCheckout( testOrder );
}

// Excluding Tax
test.describe( () => {
test.beforeAll( async ( { wooCommerceUtils } ) => {
await wooCommerceUtils.setTaxes( taxSettings.excluding );
} );

for ( const testOrder of bcdcClassicCheckoutExcludingTax ) {
transactionsOnClassicCheckout( testOrder );
}

test.afterAll( async ( { wooCommerceUtils } ) => {
await wooCommerceUtils.setTaxes( taxSettings.including );
} );
} );

// Intent Authorized
test.describe( () => {
test.beforeAll( async ( { pcpApi } ) => {
await pcpApi.updatePcpSettings( { authorizeOnly: true } );
} );

for ( const testOrder of bcdcClassicCheckoutIntentAuthorized ) {
transactionsOnClassicCheckout( testOrder );
}

test.afterAll( async ( { pcpApi } ) => {
await pcpApi.updatePcpSettings( { authorizeOnly: false } );
} );
} );
Loading
Loading