invertase / stripe-firebase-extensions

Repository of Firebase Extensions built by Stripe.
https://firebase.google.com/products/extensions
Apache License 2.0
437 stars 171 forks source link

[createPortalLink] flow_data didn't work because version 0.3.4 is not deployed #629

Closed EArminjon closed 4 months ago

EArminjon commented 5 months ago

Bug report

Describe the bug

createPortalLink https cloud function seems to not send flow_data to stripe.

As you can see POST Request data didn't show flow_data...

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  Future<dynamic> getCancelSubscriptionUrl() async {
    final HttpsCallableResult<dynamic> result = await functions
        .httpsCallableFromUrl(
      'https://europe-west1-my-app-dev.cloudfunctions.net/ext-firestore-stripe-payments-createPortalLink',
    )
        .call(
      <String, Object>{
        'returnUrl': 'https://webview-app-link/error',
        'flow_data': <String, Object>{
          'type': 'subscription_cancel',
          'subscription_cancel': <String, Object>{
            'subscription': 'sub_1PPS3vFb7Lp0rmcNdCp4MoWu', // for example
          },
          'after_completion': <String, Object>{
            'type': 'redirect',
            'redirect': <String, Object>{
              'return_url': 'https://webview-app-link/subscription-cancel',
            },
          },
        },
      },
    );
    print(result.data); // {livemode: false, configuration: bpc_1PPRqcFb7Lp0rmcNWzVUGjIY, on_behalf_of: null, created: 1717869156, return_url: https://webview-app-link/error, id: bps_1PPTRQFb7Lp0rmcNbUmQlBUn, locale: auto, flow: null, url: https://billing.stripe.com/p/session/test_YWNjdF8xR3BlWnJGYjdMcDBybWNOLF9RRnpRRlY0UHNWMTh6Z0hPcGZBZ1JUSmp0cWZMSTNs01008qfOI2If, object: billing_portal.session, customer: cus_QFxzcensoredVZO}

    return result.data;
  }
  1. call ext-firestore-stripe-payments-createPortalLink extension
  2. try to provide flow_data as my code above
  3. url created didn't take care of flow_data
  4. https://dashboard.stripe.com/test/logs didn't show flow_data in logs

Expected behavior

flow_data must work

Screenshots

image

EArminjon commented 5 months ago

On cloud function the source code version is 0.3.3 and flow_data is missing :

image image

On firebase stripe extension the source code version is 0.3.4 and so flow_data is available :

image image

Please deploy 0.3.4

EArminjon commented 5 months ago

Ah, will try invertase one. Stripe officially deprecated. image

EArminjon commented 5 months ago

Issue well fixed by Invetase one.

Stripe one didn't deployed the right version...