Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Multichannel support in Checkout.com #4885

Closed
Fifciu opened this issue Sep 17, 2020 · 1 comment
Closed

RFC: Multichannel support in Checkout.com #4885

Fifciu opened this issue Sep 17, 2020 · 1 comment
Assignees
Labels
Next Issues/bugs for Vue Storefront Next RFC Request for comments

Comments

@Fifciu
Copy link
Collaborator

Fifciu commented Sep 17, 2020

I have to implement support for multichannels in Next's CKO integration. Developers will be able to pick up channel. That's why they will have to use some setChannel method in proper moment in their app.

The current shape of the config:

interface Configuration {
  publicKey: string;
  ckoWebHookUrl?: string;
  ctApiUrl?: string;
  tokenizedCardKey?: string;
  saveInstrumentKey?: string;
  card?: CardConfiguration;
}

The proposed shape of the new config:

interface MultichannelConfiguration {
  channels: Record<string, Configuration>,
  defaultChannel: string;
}

I would export function called setChannel which would take one argument - channelKey: string. It would be something like:

if (!compareObjects(currentConfig, configs[providedChannelKey])
  currentConfig = configs[providedChannelKey];

Ofc, with some fallback to previous value if someone tries to use a non existing channel.
The function will be exported in index.ts so we should be able to import it with:

import { setChannel } from '@vue-storefront/checkout-com';

What do you think about this approach?

@Fifciu Fifciu added RFC Request for comments Next Issues/bugs for Vue Storefront Next labels Sep 17, 2020
@Fifciu Fifciu added this to Backlog in Next Core 1.0 via automation Sep 17, 2020
@andrzejewsky
Copy link
Contributor

I think it's another function in useCko composable that allows you to change channel, @Fifciu is there any concern why that's a bad idea? The composables shouldn't know about where parameters (URL etc.) comes from, you provide this from the app

@Fifciu Fifciu closed this as completed Sep 24, 2020
Next Core 1.0 automation moved this from Backlog to Done Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Next Issues/bugs for Vue Storefront Next RFC Request for comments
Projects
No open projects
Next Core 1.0
  
Done
Development

No branches or pull requests

3 participants