Skip to content

Commit

Permalink
EPS:320: creating eps iFrame
Browse files Browse the repository at this point in the history
  • Loading branch information
bold-nima committed Sep 3, 2024
1 parent 1d32940 commit 8c4fa6b
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 3 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
12 changes: 12 additions & 0 deletions src/types/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ export interface IEnvironmentTypes {
readonly local: string;
}

export interface IEpsUrls {
readonly production: string;
readonly staging: string;
readonly local: string;
}

export interface IEpsBucketUrls {
readonly production: string;
readonly staging: string;
readonly local: string;
}

export interface IEnvironmentUrls {
readonly production: string;
readonly staging: string;
Expand Down
2 changes: 2 additions & 0 deletions src/types/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ export interface IEnvironment {
type: string;
url?: string;
path?: string;
epsUrl?: string;
epsBucketUrl?: string;
}

export interface IAuth {
Expand Down
16 changes: 15 additions & 1 deletion src/variables/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ import {
IPigiResponseType,
IAlternatePaymentMethodType,
IExternalPaymentGatewayToParentActionTypes,
IExternalPaymentGatewayToIframeActionTypes
IExternalPaymentGatewayToIframeActionTypes,
IEpsUrls,
IEpsBucketUrls
} from 'src';

export const environmentTypes: IEnvironmentTypes = {
Expand All @@ -22,6 +24,18 @@ export const environmentTypes: IEnvironmentTypes = {
local: 'local'
};

export const epsUrls: IEpsUrls = {
production: '',
staging: '',
local: ''
};

export const epsBucketUrls: IEpsBucketUrls = {
production: '',
staging: '',
local: ''
};

export const environmentUrls: IEnvironmentUrls = {
production: 'https://api.boldcommerce.com',
staging: 'https://api.staging.boldcommerce.com',
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
8 changes: 6 additions & 2 deletions src/variables/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ import {
IFees,
httpStatusCode,
} from 'src';
import {epsBucketUrls, epsUrls} from "src/variables/constants";

Check failure on line 26 in src/variables/variables.ts

View workflow job for this annotation

GitHub Actions / Yarn Build

Strings must use singlequote

export const environment: Required<IEnvironment> = {
type: environmentTypes.production,
url: environmentUrls.production,
path: environmentPath
path: environmentPath,
epsUrl: epsUrls.production,
epsBucketUrl: epsBucketUrls.production,
};

export const auth: IAuth = {
Expand Down Expand Up @@ -192,7 +195,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 +208,7 @@ export const orderInitialData: IOrderInitialData = {
life_elements: [],
flow_settings: {},
requires_shipping: true,
eps_gateways: {},
};

export const retryErrorCodeList: Array<number> = [
Expand Down

0 comments on commit 8c4fa6b

Please sign in to comment.