#dvdmn-clone-card
1 messages ยท Page 1 of 1 (latest)
Sure but there's a lot more to it than just this sentence. for example why are cards on the platform if you do direct charges?
Ultimately, you haven't really given me an example of the error so it's hard to explain but you are likely passing the wrong params when you charge
Basically if you give me an example error, or an id, I can try and look it up to see what the error is and then explain what to change in your code, does that make sense?
why are cards on the platform if you do direct charges?
because the platform charges the customer for a different product (like monthly subcr)
gotcha
error: Customer cus_xxxx does not have a linked source with ID card_xxx.'
I guess I need to understand how stripe connect works 1st..
please correct me if I am wrong... platform account & the connected account are totally separate and nothing (customer or card) is shared between them. that is why I need token
correct
please provide me with a real example not the redacted error message. I can't help without an exact request id
sorry about that
Customer cus_KwmsXP3Tu7N9YB does not have a linked source with ID card_1Jv2eRHTaLbc7iCqZXv9ToJI.'
perfect, let me look
this is the code..
Okay so the Customer cus_KwmsXP3Tu7N9YB is the new one you created on the connected account. But the Card id card_1Jv2eRHTaLbc7iCqZXv9ToJI is incorrect because it's the id of the card you cloned, the one from the platform so that's the issue
yes.. I could not find a way to add card to 'customer' I cloned for connect account
I don't understand what entry.cardID is in your code, but that's the overall problem you have. You can't do that. You saved a brand new card on the Customer when you create the new customer. You have to use that new card id instead for the charge
you already are, you are passing Source = token.Id
this is an old drawing I made
you see how the platform has cus_AAA card_111 and the connected account has cus_123 and card_ABC?
right now you are saying "please charge cus_123andcard_111`
entry.cardID => card_1Jv2eRHTaLbc7iCqZXv9ToJI
yeah that's the wrong id
the one saved on the platform account
that's the card id on the platform, which doesn't make sense
you explicitly went and cloned the card to have a brand new card on the connected account, so you need to reference that card
Really, let me simplify this for you entirely: remove the line Source = entry.cardId on the last bit. That way you do not say which card to charge, you let us charge the default card which is fine since it's a brand new customer with just one card
my assumption was customer's cards are automatically shared over token since the default cardID appears on the cloned customer object.
you let us charge the default card which is fine since it's a brand new customer with just one card
that is the problem
we have a customer who manages two youth baseball teams and he want to use dedicated credit cards for each team
that sentence doesn't really mean much I think because you mix up multiple words together
I'm sorry, please look at my exact drawing, that tells you all the relevant objects
his default card belongs to team A, he wants to pick the 2nd card he has in the account for other team's transactions
I actually tried that by looking at the documentation... maybe the .net driver is missing that field
let me re-type the code and get the error message
I've explained the exact issue in your code above, did you see all my messages?
I clearly said what line of code is incorrect
I understand the payment option part... I was talking about the token creation
I cannot use the card_1Jv2eRHTaLbc7iCqZXv9ToJI for the payment directly, I get it
I'm sorry, I don't follow you. I feel like I told you exactly what to hcange, and I don't get what's blocking you right now. I need you to be a bit more explicit about what is blocking you
this is how I create the customer token
var token = new TokenService().Create(
new TokenCreateOptions {
Customer = stripeCustomer.customerID, // cus_KaD4yIMYQNfpz6
Card = entry.cardID // card_1Jv2hCHTaLbc7iCqjxWqSVpZ (2nd card)
},
new RequestOptions {
StripeAccount = directorAccount, // connected account
}
);
is it the right way?
Ahhhhh
sorry I get it now
And yes Card = entry.cardID is how you tell us "I want to clone that specific card from the platform customer". If you don't pass it, we just clone the default one
duh, I should have seen that's what you meant, I thought you were already cloning the right one
I just created this token tok_1KHCUFC9ocJF4bGwTsJ0CiRq
yeah that Token cloned the card card_1Jv2hCHTaLbc7iCqjxWqSVpZ from the platform
can u check it on your end to make sure it has the right card, not the default one
cool
And so now you use that Token id tok_1KHCUFC9ocJF4bGwTsJ0CiRq to create a Customer with that new card and you will get a new Customer cus_AAAA with a new card id card_XXXXXX different from the platform one
ok let me do that
like this?
var customer = new CustomerService().Create(
new CustomerCreateOptions {
Source = token.Id,
},
new RequestOptions {
StripeAccount = directorAccount,
}
);
it worked
Cool and now you need to charge that customer's card
var paymentOptions = new ChargeCreateOptions {
Amount = amount * 100,
Currency = "usd",
Source = customer.DefaultSourceId,
Customer = customer.Id,
Description = $"Event Entry for {divisionData.eventName} | {divisionData.teamName}",
ReceiptEmail = stripeCustomer.email,
StatementDescriptor = siteName,
ApplicationFeeAmount = 100, // ### TINC FEE ###
};
is this the card with expiration 11/2023?
card_1KHCaUC9ocJF4bGwUDUeTLJa
it comes as defaultsourceID for the new customer I cloned
yeah that's because you are creating a brand new customer, with a brand new card/token. So that card becomes the default
Let's say, later, you want to add the other card to that customer. Instead of the Create Customer API you will use the Create Card API https://stripe.com/docs/api/cards/create and that will return a card_123456 as the new id to use in your charge
cool
๐
Are you unblocked?
yay!
congrats, sorry for all the back and forth. That flow is so easy once you get it, but it takes so long to "get it"
12/2022 card was the default card for that customer.. payment shows the nov/23 expiration
woot!
"platform account & the connected account are totally separate and nothing (customer or card) is shared between them. that is why I need token"
this was the part I was missing
yeah it's hard to describe/explain unfortunately ๐ฆ