Comment to 'stripe help'
Comment to stripe help
  • So, why am I starting to feel like we are back in Dolphin development stages? Because, I was clear in my issue. I don't develop UNA, but I have collectively 20+ years in IT, 15+ years web design/web languages, and 10+ years Android java/native app production. I'm not a script kiddie.

    So. I was basically told stripe works. I call bull. If you follow UNA documentation as is, stripe 3d one off payments do not work. Maybe their is a setting in stripe, if so, it is not mentioned anywhere in any UNA documentation. So, I went to the code, stripe developer documentation, and realized right away the issue.

    Stripe in one off payments automatically has customer creation set to "if_required" (default). This means, only under some use cases will a customer ID be created. This is because their is no real reason to track a customer in stripe if you are doing a one and done sale.

    So, my stripe 3d was failing on one time payments because stripe wasn't creating a customer, because "if_required" means one off purchases don't create customers. However, UNA is checking on return for customer ID every return.

    Fix.

           $aSession = array_merge([
               'mode' => $sMode,
               'customer_creation' => 'always',
               'payment_method_types' => ['card'],
               'customer_email' => !empty($aClient['email']) ? $aClient['email'] : ''
           ], $aParams);
    

    If UNA is going to check for customer ID on return, then customer creation should be set to always.

    I added in the 'customer_creation' line. GUESS WHAT?

    All Payments through stripe now work. customer_id is never empty now. Stripe {SESSION_ID} is properly filled.

    Or, UNA could stop checking for customer ID on return of one off payments because it is completely unnecessary.

    🤓

    • Hello.

      Stripe Docs has the following:

      Currently, only 'subscription' mode Sessions and 'payment' mode Sessions with post-purchase invoices enabled require a Customer.

      'payment' mode is used for single time payments. Looks like we didn't hear about such problem before because 'post-purchase invoices enabled' by default and Customer is always created.

      By the way, thank you for the research. We'll add this parameter to avoid such problems in the future.