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

Support flow_data parameter in createPortalLink function #556

Merged
merged 1 commit into from
Sep 4, 2023

Conversation

chetbox
Copy link
Contributor

@chetbox chetbox commented Aug 31, 2023

Resolves #551

Example usage to create a portal link that asks the customer to confirm an amendment to the price and/or quanity of a subscription:

import { getFunctions, httpsCallable } from 'firebase/functions';

const flow_data = {
  type: 'subscription_update_confirm',
  subscription_update_confirm: {
    subscription: 'sub_XXXXXX',
    items: [
      { id: 'si_XXXXXX', quantity: 4, price: 'price_XXXXXX' },
    ],
  },
};

const portalLinkUrl = (await httpsCallable(getFunctions(app), 'createPortalLink')({ flow_data })).data.url;

@CLAassistant
Copy link

CLAassistant commented Aug 31, 2023

CLA assistant check
All committers have signed the CLA.

@dackers86 dackers86 merged commit 2e63228 into invertase:master Sep 4, 2023
2 checks passed
@chetbox
Copy link
Contributor Author

chetbox commented Sep 5, 2023

@dackers86 does this now need to be merged into the next branch? That seems to be default branch but master was the default branch when this PR was created.

@dackers86
Copy link
Member

HI @chetbox

Yes, you are correct! The base branch was updated today to be the next branch

@dackers86
Copy link
Member

dackers86 commented Sep 5, 2023

Moved to next 9ab8170 Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use flow_data in a portal session to pre-populate quantity and price
3 participants