mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-30 18:16:48 +10:00
Merge pull request #815 from sharetribe/process-alias
Add configurable processAlias (new API feature)
This commit is contained in:
commit
7571b9d032
2 changed files with 12 additions and 0 deletions
|
|
@ -19,6 +19,14 @@ const i18n = {
|
|||
// Should search results be ordered by distance to origin.
|
||||
const sortSearchByDistance = false;
|
||||
|
||||
// API supports custom processes to be used in booking process.
|
||||
// We need to specify it when we are initiating a new order
|
||||
// (or fetching price information by calling 'initiateSpeculative' endpoint).
|
||||
//
|
||||
// In a way, 'processAlias' defines which transaction process (or processes)
|
||||
// this particular web application is able to handle.
|
||||
const bookingProcessAlias = 'preauth-nightly-booking/release-1';
|
||||
|
||||
// The transaction line item code for the main unit type in bookings.
|
||||
//
|
||||
// Possible values: ['line-item/night', 'line-item/day', 'line-item/units';]
|
||||
|
|
@ -283,6 +291,7 @@ const config = {
|
|||
env,
|
||||
dev,
|
||||
locale,
|
||||
bookingProcessAlias,
|
||||
bookingUnitType,
|
||||
i18n,
|
||||
sdk: {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { pick } from 'lodash';
|
||||
import config from '../../config';
|
||||
import { denormalisedResponseEntities } from '../../util/data';
|
||||
import { storableError } from '../../util/errors';
|
||||
import { TRANSITION_REQUEST } from '../../util/types';
|
||||
|
|
@ -109,6 +110,7 @@ export const initiateOrder = (orderParams, initialMessage) => (dispatch, getStat
|
|||
dispatch(initiateOrderRequest());
|
||||
const bodyParams = {
|
||||
transition: TRANSITION_REQUEST,
|
||||
processAlias: config.bookingProcessAlias,
|
||||
params: orderParams,
|
||||
};
|
||||
return sdk.transactions
|
||||
|
|
@ -159,6 +161,7 @@ export const speculateTransaction = params => (dispatch, getState, sdk) => {
|
|||
dispatch(speculateTransactionRequest());
|
||||
const bodyParams = {
|
||||
transition: TRANSITION_REQUEST,
|
||||
processAlias: config.bookingProcessAlias,
|
||||
params: {
|
||||
...params,
|
||||
cardToken: 'CheckoutPage_speculative_card_token',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue