createStripeAccount API call changed

This commit is contained in:
Vesa Luusua 2017-05-04 16:59:22 +03:00
parent 7eb452c3ed
commit a77bc3a2b7
2 changed files with 4 additions and 3 deletions

View file

@ -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

View file

@ -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;