#latwelve

1 messages · Page 1 of 1 (latest)

frozen depotBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

meager reef
#

'payment_intent_data' => [
'transfer_data' => [
'destination' => 'xxx',
],
],

granite escarp
meager reef
#

pi_3O8OVLIEG6XkSwCO02pGEe9c

granite escarp
#

You didn't pass transfer data

meager reef
#

I know it looks like that but its there :/

#

if I dump the Session after creation I should also be able to see it in the passed information but its not coming through for some reason:

For example this is the same code I used in testing


            $stripe_session = Session::create([
                'payment_method_types' => ['card'],
                'submit_type'          => 'pay',
                'customer'             => $this->booking->user->stripe_id,
                'client_reference_id'  => $this->booking->reference,
                'line_items'           => $this->line_items,
                'mode'                 => 'payment',
                'metadata'             => [
                    'booking_id'          => $this->booking->id,
                    'user_id'             => $this->booking->user->id,
                    'type'                => $this->type->value,
                    'payment_type'        => $this->payment_type->value,
                    'payment_destination' => $this->payment_destination->value,
                ],
                'payment_intent_data' => [
                                          'application_fee_amount' => $one_percent_fee,
                                          'transfer_data' => [
                                              'destination' => $this->concierge_account_id,
                                          ],
                                      ],
                'success_url'         => URL::to('/guest-area/booking-payment-success?session_id={CHECKOUT_SESSION_ID}'),
                'cancel_url'          => URL::to('/guest-area/booking/'.$this->booking->reference),
            ]);

#

and dumping $stripe_session i'd have excepted to see the payment_intent_data passed but its not weirdly?

granite escarp
#

Log $this->concierge_account_id

#

prior to calling session::create

#

If that's null then there's your issue

meager reef
#

its not sadly

granite escarp
#

Are you sure

#

You're logging it in production?

#

I'm not talking about test

meager reef
#

Yep I've got it setup here with live details its coming from the same class not remotely.

I've just inlined it to simplify it for testing and its still not in the dump for the stripe_session

#

can I pm you a quick screenshare video to show?

granite escarp
#

No we help many users at once

#

We don't do 1:1 dms here

meager reef
#

sorry I only asked as the last person here suggested it

#

I just didnt want to share the live details

granite escarp
#

Doesn't make much sense that it works in test mode with the same code

#

So something must be different here

#

Either you're using the wrong code

#

Or the data you're passing isn't what you expect

#

Recommend logging all the params you're passing BEFORE you call $stripe_session = Session::create([

meager reef
#

Its baffling me I've looked and all the data is there

#

literally everything is in the log except the payment_intent part

granite escarp
#

You're logging individual pieces of data prior to the session create call?

#

You mentioned you're logging the session AFTER the call

meager reef
#

yes and you can see them in the stripe log after

#

even with the intent inlined with no external calls it doesnt pass the info to the live session

                'payment_intent_data' => [
                        'transfer_data' => [
                            'destination' => 'xxx',
                        ],
                    ],
#

xxx is obscured for the real account id

#

I've triple checked the docs for what is required as a field - but its not something stupid like on_behalf_of being required also is it?

#

I'm going to go grab a dump of the working test vs the incomplete live version for help

granite escarp
meager reef
#

the information passed to stripe in the gui

granite escarp
#

Do you have an example?

#

The request I linked earlier didn't show them in the gui

meager reef
#

the other fields - all except the transfer data

#

Please can you let me know that I'm correct in thinking that I should be able to dump the session after its creation and see the payment_intent_data information?

granite escarp
#

You should

#

Is everything the same between live and test mode

#

Client library version, language runtime, etc

meager reef
#

the test mode is also producing the same results on this code now

#

i did a very basic test earlier today then refactored my code and thought it was just a live/test error.

#

I've now just simplified its to its basics and all inlined so you can see nothing is coming in incorrectly and it still doesnt seem to pass the data to the session for the destination:


            $stripe_session = Session::create([
                'payment_method_types' => ['card'],
                'submit_type'          => 'pay',
                'customer' => 'cus_OwHpRfzzePcFn7',
                'client_reference_id'  => 'xxx',
                'line_items'           => [
                [
                    'price_data' => [
                        'currency'     => 'eur',
                        'unit_amount'  => '90000',
                        'product_data' => [
                            'name' => 'Test',
                        ],
                    ],
                    'quantity' => 1,
                ],
            ],
                'mode'                 => 'payment',
                'payment_intent_data' => [
                        'transfer_data' => [
                            'destination' => 'acct_1O56wGI1NhFQRbo5',
                        ],
                    ],
                'success_url'         => URL::to('/guest-area/booking-payment-success?session_id={CHECKOUT_SESSION_ID}'),
                'cancel_url'          => URL::to('/guest-area/booking/'.$this->booking->reference),
            ]);

granite escarp
#

So it's actually not working in test mode then?

meager reef
#

not now - my example this morning was - sorry for that

#

but the session couldnt be simpler

granite escarp
#

What did you change

#

That doesn't make sense that it's intermittently working haha

meager reef
#

this was this mornings...

#

        $stripe_session = Session::create([
            'payment_method_types' => ['card'],
            'submit_type'          => 'pay',
            'customer'             => $customer_id,
            'client_reference_id'  => $this->booking->reference,
            'line_items'           => $this->line_items,
            'mode'                 => 'payment',
            'metadata'             => [
                'booking_id'   => $this->booking->id,
                'user_id'      => Auth::id(),
                'type'         => $this->type,
                'payment_type' => $payment_type,
            ],
             'payment_intent_data' => [
//            'application_fee_amount' => 100, // optional
            'transfer_data' => [
              'destination' => 'xxx',
            ],
          ],
            'success_url' => URL::to('/guest-area/booking-payment-success?session_id={CHECKOUT_SESSION_ID}'),
            'cancel_url'  => URL::to('/guest-area/booking/'.$this->booking->reference),
        ]);

#

nothing really i was just tidying up the class above it - but the data passed to here is the same

#

I didnt physically dump the session to test this morning i just ran a card through

#

Are you able to test a session for me to see if the transfer_data gets added to the dump?

#

ok so i've got a bit further

#

$stripe_session does not log the transfer data in the object.

#

which is why it wasn't showing.

#

I just did a test with test details on my code and it does seem to go through correctly

#

I'll try the live again.. but it'd be good to know how I can test the destination information in the stripe_session object

frozen depotBOT
cinder bridge
#

Hi 👋

I'm jumping in and trying to catch up

#

Can you share a couple API request IDs? One each from Test mode that is working as expected and one from LIve mode that is not doing what you expect?