From a77bc3a2b75f4ca753a739e7762dacba6d440d17 Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Thu, 4 May 2017 16:59:22 +0300 Subject: [PATCH] createStripeAccount API call changed --- src/containers/EditListingPage/EditListingPage.duck.js | 3 ++- src/ducks/user.duck.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/containers/EditListingPage/EditListingPage.duck.js b/src/containers/EditListingPage/EditListingPage.duck.js index 04e5d96d..877317cb 100644 --- a/src/containers/EditListingPage/EditListingPage.duck.js +++ b/src/containers/EditListingPage/EditListingPage.duck.js @@ -147,8 +147,9 @@ export function requestCreateListing(data) { dispatch(createListing(actionPayload)); const shouldCreateStripeAccount = bankAccountToken && country; + const stripeAccountAddress = { country }; const accountCreated = shouldCreateStripeAccount - ? dispatch(createStripeAccount(bankAccountToken, country)) + ? dispatch(createStripeAccount(bankAccountToken, stripeAccountAddress)) : Promise.resolve('already created'); return accountCreated diff --git a/src/ducks/user.duck.js b/src/ducks/user.duck.js index 0675010e..9827e11e 100644 --- a/src/ducks/user.duck.js +++ b/src/ducks/user.duck.js @@ -90,11 +90,11 @@ export const fetchCurrentUser = () => }); }; -export const createStripeAccount = (bankAccountToken, country) => +export const createStripeAccount = (bankAccountToken, address) => (dispatch, getState, sdk) => { dispatch(stripeAccountCreateRequest()); return sdk.users - .createStripeAccount({ bankAccountToken, country }) + .createStripeAccount({ bankAccountToken, address }) .then(response => { dispatch(stripeAccountCreateSuccess(response)); return response;