Skip to content

Commit

Permalink
EPS:320: creating eps iFrame (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
bold-nima authored Sep 4, 2024
1 parent 1d32940 commit 9f32fa0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
9 changes: 9 additions & 0 deletions src/types/apiInterfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ export interface IOrderInitialData {
life_elements: Array<ILifeField>;
flow_settings: Record<string, unknown>;
requires_shipping: boolean;
eps_gateways: IEpsGateways;
}

export interface ISupportedLanguage {
Expand Down Expand Up @@ -432,6 +433,14 @@ export interface ICountryInformation {
valid_for_billing: boolean;
}

export interface IEpsGateways {
[gateway_id: string]: IEpsGateway,
}
export interface IEpsGateway {
auth_token: string;
currency: string;
}

export interface ICheckoutProcess{
company_name_option: string,
phone_number_required: boolean,
Expand Down
1 change: 1 addition & 0 deletions src/variables/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ export const orderInitialDataMock: IOrderInitialData = {
life_elements: [],
flow_settings: {},
requires_shipping: true,
eps_gateways: {},
};

export const cssRuleMock: ICssRule = {
Expand Down
5 changes: 3 additions & 2 deletions src/variables/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
export const environment: Required<IEnvironment> = {
type: environmentTypes.production,
url: environmentUrls.production,
path: environmentPath
path: environmentPath,
};

export const auth: IAuth = {
Expand Down Expand Up @@ -192,7 +192,7 @@ export const applicationState: IApplicationState = {
created_via: '',
is_processed: false,
fees,
flow_id: null
flow_id: null,
};

export const orderInitialData: IOrderInitialData = {
Expand All @@ -205,6 +205,7 @@ export const orderInitialData: IOrderInitialData = {
life_elements: [],
flow_settings: {},
requires_shipping: true,
eps_gateways: {},
};

export const retryErrorCodeList: Array<number> = [
Expand Down
3 changes: 1 addition & 2 deletions tests/shipping/changeShippingLineWithCode.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {apiTypeKeys, baseReturnObject, methods, apiTypes, changeShippingLineWithCode, changeShippingLine} from 'src';
import {apiTypeKeys, baseReturnObject, methods, apiTypes, changeShippingLineWithCode} from 'src';
import {applicationStateMock, selectShippingLineMock} from 'src/variables/mocks';
import * as fetchAPI from 'src/utils/fetchAPI';
import * as getApiOptions from 'src/utils/getApiOptions';
Expand All @@ -10,7 +10,6 @@ describe('testing set shipping address api', () => {
const timesWhenCalled = 1;
const index = '1';
const code = 'code';
const code1 = '';
const apiUrlMock = 'https://api.com/checkout/storefront/123/123/addresses/shipping';
const {keysToTest} = apiTypes.changeShippingLines;
let optionsMock: RequestInit;
Expand Down

0 comments on commit 9f32fa0

Please sign in to comment.