#khaled_03640

1 messages · Page 1 of 1 (latest)

uncut kelpBOT
ripe shuttle
#

Hello

#

You don't actually clone Customer objects themselves, you would just recreate the Customer on the Connected Account.

main seal
#

in second step they told me to clone payment method

ripe shuttle
#

That is our legacy documentation that you should only follow if you are still using our Tokens API and not our newer PaymentMethods API

#

Regardless, even in that documentation you don't actually clone the Customer -- you recreate it and then clone the Token.

main seal
#

okay I see
so I need what i will do is to create another customer with the same data only ?

ripe shuttle
#

Yep

main seal
#

so If I need to attach charge that made to this account to the connect account how to do it

ripe shuttle
#

What does "attach charge" mean?

main seal
#

what I need to do
is create charge with the customer on platform account then create the same customer to connect account and send to him another charge with same data then delete the customer on platform account

ripe shuttle
#

Okay

#

Have you already implemented any of this?

main seal
#

yes now the payment is done on the customer on platform account and I making a transfer with 98% of the charge to connect account now i need when open the connect account can see the payment with the amount and all details for the payment and aslo the customer created

#

did you get me?

ripe shuttle
#

Okay so have you cloned the payment method to your Connected Account yet?

#

That would be the next step.

main seal
#

no

#

when try to clone it they need to create payment method and then clone
so why doing this

ripe shuttle
#

You already have the payment method if you have already created the initial charge.

#

So you clone that payment method that is on your platform, assuming you are saving it for future use?

main seal
#

yes so how to get the id

ripe shuttle
#

How to get the payment method ID?

main seal
#

yes

ripe shuttle
main seal
#

thank you
this step is done
now I have the customer on connect account and his payment methods

#

what is the next step

ripe shuttle
main seal
#

I make transfer in webhook after payment is done and success is it wrong?

ripe shuttle
#

Mostly depends on what you are trying to do?

#

Like do you always want to transfer funds to your Connected Account immediately?

#

And is it a one-to-one relationship?

main seal
#

yes one to one relation and in this case yes want to transfer immediately but with all details of the payment like derict charge

ripe shuttle
#

Hmm not sure what "all details of the payment" entails?

#

But it sounds like you should be using Destination Charges here

#

Not creating separate transfers

main seal
#

what I mean, I need when view the payment that created on connect account I can see description and the customer that paid and payment method that custmer used etc

ripe shuttle
#

You likely want to set metadata with that information in that case

main seal
#

exactly

#

after make a transfer I got transfer object has charge id
how to update metadata for this

#

or am I wrong?

ripe shuttle
#

That is the Charge on your Connected Account

#

And the one you want to update with metadata

main seal
#

now I have destination_payment how to update the metadata

ripe shuttle
main seal
#

how to get the metadata
and when put destination_payment I got
No such charge: 'py_1OgRiRR7tj15pRmknbFw6L60'

ripe shuttle
#

You use the Stripe Account Header to make the request on your Connected Account, as I mentioned above.

main seal
#

this how i use it

        $transferObject->destination_payment,
        ['metadata' => ['shipping' => 'express']]
        ); ```
ripe shuttle
#

You need to add ['stripe_account' => '{{CONNECTED_ACCOUNT_ID}}']

main seal
#

Thanks alot

#

so how to get the meta data to update it

ripe shuttle
#

I don't know what that means

main seal
#

i mean what should I update in this
['metadata' => ['shipping' => 'express']]

ripe shuttle
#

That is completely up to you -- you decide on what metadata you want to set

main seal
#

yes I know but from where I can get it
i need it from the payment that made on the platform account

ripe shuttle
#

Then you retrieve the platform Charge

main seal
#

how

ripe shuttle
#

Depends where you are starting from....

#

Do you just have the Customer ID?

#

Or are you tracking any of this in your own database?

#

Do you have the Charge ID?

main seal
#

I'm start form the webhook and have the webhook response

ripe shuttle
#

Which Webhook specifically?

main seal
#

the callback that send after the payment done

ripe shuttle
#

Sorry, which Event type?

#

charge.succeeded?

#

Or payment_intent.succeeded?

main seal
#

payment_intent.succeeded

ripe shuttle
main seal
#

great thank you
I have now just one thing
now the transfer I made has payment and this payment has customer id is none
how to attach the customer I created on connect account to this payment as the metadata I just updated

ripe shuttle
#

When you create the charge on the Connected Account you want to pass the customer parameter with the Customer you created on your Connected Account

#

So that the charge is associated to that Customer

#

You wouldn't use metadata for that part

#

When you create/confirm your PaymentIntent on the Connected Account

main seal
#

this is what i use not create payment intent

            'amount' => $amount * 100,
            'currency' => $this->getLineItemsCurrency($stripeRegion),
            'transfer_group' => $group,
            'destination' => $this->stripe_connect_id,
            'source_transaction' => $latest_charge
        ]);```
ripe shuttle
#

That is the one on your platform

#

Oh wait sorry

#

You are not talking about the Charge after cloning here

#

You are talking about the destination payment from your Transfer

#

Though honestly I've never tried doing that with a destination payment....

#

But I'd recommend testing it out

main seal
#

you mean to send it in metadata?

ripe shuttle
#

No, you create a Customer object on your Connected Account and then update the Charge to set that Customer object as the customer for the Charge

#

The "Charge" in this case is your destination_payment

main seal
#

okay I got you
i will try it out

ripe shuttle
#

👍