stripe help

Hello! I went through and setup my stripe account. All is good there. I went to test mode, and I added a product (membership upgrade), used the pricing ID as the name, and it worked in my tests.

Now, I tested credits and donations. Both fail. In payment log, I get this:

Apr 20 04:40:52 [3] /m/payment/finalize_checkout/stripe_v3/8?mode=payment&order_id=pi_3P7Vj8RvhaF0CXNc1t82AJi1&customer_id=&pending_id=23&redirect= :
[stripe_v3]
Retrieve Customer Error: The resource ID cannot be null or whitespace.

It does the same thing for both donations and credits. I imagine any non subscription type purchase.

It goes to the stripe checkout, has the correct info, payment success at stripe, then I get an error on site that action can't be completed, please report. And the log entry above.

Am I doing something wrong? Please advise. Thank you!

  • 172
  • More
Replies (18)
    • Hello @Wise !

      Perhaps you didn't setup the return URL for Stripe, which can be taken from the [UNA URL]page.php?i=payment-details URL in the seller's profile.

      • @LeonidS the log shows the return URL. It is definitely in webhooks, with all events selected. And, as I wrote above, subscriptions work perfectly. But credits, donations, these fail on return with above error from payments log.

        Something isn't right. If I switch to swipe option one (not v3) the donations and credits work, but subscriptions don't. Without changing a thing. Same test keys, just turning on the end point for that version. I have them both in webhooks, just disable the one I'm not using.

        UNA 14. A3. Please advise, as I need swipe to work. Thank you.

        • I just bought credits from UNA. On purchase response:

          customer_id=

          Is filled in, however, on all my responses, it is blank, therefore the error is thrown. What is the fix?

          • There is definitely something wrong. I have subscription based payments working well in stripe. All others fail. It is the customer_id field which is always blank on return. I feel as if there is a bug in sending this to stripe?

            It works here, I bought credits, so what is different?

            • It should be known by now, I don't just post to post. There is nothing I can do, to figure out this issue, without ripping through code.

              So, can someone from UNA team advise why this return customer_id is not being filled? This happens for all "one off" purchases. Subscriptions work.

                • 👀

                  • This is a legitimate question, from a paying premium/pro customer. I shouldn't be required to comb though code to learn how you implemented this. And for my 17 years of being around Boonex, if I report something, its not because I'm inexperienced. Its because it don't work. I've got the log, as I posted above. The customer_id is not being filled by stripe on return, so it errors.

                    I doubt this is a configuration error, or a user error. Subscriptions work. Stripe payment ID as the back end name of the sub.

                    Now, NO one off purchases work due to customer_id

                    I need help. I'm not tracking and debugging code. Its why I paid pro. I'll "do it myself" if you advise what to check or do?

                    • Where did these values even go?

                      /m/payment/finalize_checkout/stripe_v3/8?mode=payment&order_id=pi_3P7Vj8RvhaF0CXNc1t82AJi1&customer_id=WhereIsIt&pending_id=23&redirect=WhereIsIt? :
                      

                      Where I placed "WhereIsIt?" there should be something there but they are coming back as null for both variables. It's as if they get lost in the mix during the processing. It's really sad that @LeonidS had made no attempt to further research this and would rather place the blame on you.

                      You may want to look into a charge back if the service isn't working as intended.

                      • Hello

                        I just configured Stripe in test mode on our test site (ci.una.io/test) and paid for Creadits without any problems. Return URL:

                        https://ci.una.io/test/m/payment/finalize_checkout/stripe_v3/20?mode=payment&order_id=pi_3P8yBdHidzZJ62C30d1I872v&customer_id=cus_Pyw4g4dUv4g36R&pending_id=1&redirect=
                        
                        • Customer is creating on Stripe end and should be attached to a session. The last one is created after a buyer filled in the payment form. Then session with customer and the other info should be returned to UNA for further usage. If it wasn't returned we cannot do anything on UNA end. May be you have some errors on Stripe end. Did you check events related to your payments in Stripe account?

                          Also what integration you are using: old one or new one with 3D Secure? If you have new Stripe account then Old integration may work incorrectly.

                          • I'm using 3d secure. Subscriptions work. I can subscribe. But I can not do one off payments. There are no errors on stripe end that I can find. None reported.

                            UNA must send this customer_id session, otherwise how would return URL know who customer_id is??? Is it not sent to stripe then returned?

                            • @Anton L it works here as well (I bought credits). So I need to know what I should do to get purchases working on my site?

                              • UNA must send this customer_id session, otherwise how would return URL know who customer_id is??? Is it not sent to stripe then returned?

                                This customer_id is generated on Stripe end therefore UNA cannot send it if it wasn't received from Stripe first.

                                • As I see you have the payment: pi_3P7Vj8RvhaF0CXNc1t82AJi1 What info you can see viewing this payment on Stript end? I just checked mine and it has 'Customer' in 'Checkout summary' section. Also new customer can be seen in 'Customers' list. It has ID and is associated with the payment.

                                  • @Anton L I have sent you a message.

                                    • 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.

                                        Login or Join to comment.