We build a platform for sellers and customers.
With Stripe, that called a destination charge where the platform charges the customer, but the actual money is routed to the seller. The seller then sees he's been paid the amount, but not by whom (apart from "through our platform").
I'm using Stripe.NET in our C# ASP.NET backend, but my question is not technology related.
I can create a charge to do exactly as described above.
Example code:
var stripeCharge = stripeChargeService.Create(
new Stripe.ChargeCreateOptions
{
Amount = (int)(price * multiplier),
Currency = currency,
CustomerId = stripeCustomer.Id,
SourceId = source,
Destination = new Stripe.ChargeDestinationCreateOptions
{
Account = stripeSellerId
},
StatementDescriptor = "PLATFORM: " + invoiceNumber,
Description = "PLATFORM Payment for invoice number " + invoiceNumber,
Metadata = new Dictionary<string, string>
{
{ "InvoiceNumber", invoiceNumber }
}
});
When I do this, it works. I can see the charge in my platform account. I can see the payment in my seller's account. But the seller does not get any information that I provided. The "Description" and "Metadata" only show up in my platform account's charge. The sellers payment only says "123.45€". Uh... great... who paid their invoice? Matter of fact I don't care who. But which invoice was paid seems to be a core requirement for everybody building a platform or selling on it.
I checked the documentation of Stripe.NET and I checked if maybe it's older than the stripe API itself. But there is no parameter I could set. Nothing in the ChargeDestinationCreateOptions
I could set (something like DestinationDescription for example).
The description field for the seller exists, I can see it in the dashboard, but it's empty. So what am I missing?
How do I set the description or metadata of payment the seller can see in their account when doing a "destination charge"?
The connected account's balance increases with every charge. Your account balance increases with application fees from every charge. The connected account's balance will be debited for the cost of Stripe fees, refunds, and chargebacks.
Destination charges are created on the platform, but as part of the charge operation, funds are transferred to the connected account specified in the transfer_data[destination] parameter of the charge. The platform is responsible for the cost of the Stripe fees, refunds, and chargebacks.
After the funds are available in your platform's Stripe balance, you can transfer funds to a connected account through the API or the Dashboard. In the Dashboard, transfer funds to a connected account by clicking Send funds in the Balance section of the connected account's detail page.
When you create a destination charge with Stripe, there are three objects created:
ch_xxx
) on the platform accounttr_xxx
) on the platform account representing the transfer to the destination connected account.py_xxx
, which is equivalent on an API level to a charge object) on the connected account, representing the funds from the transfer being paid to that account.From your description, it sounds like it is the third object here that you would like to set metadata or a description on? You're right, you can't do this directly in the parameters of creating a destination charge. However, once the charge is created, you can easily get a reference to the created payment and update it with the needed fields:
var chargeService = new StripeChargeService();
chargeService.ExpandTransfer = true;
var chargeOptions = new StripeChargeCreateOptions
{
Amount = 1000,
Currency = "usd",
SourceTokenOrExistingSourceId = "tok_visa",
Description = "Payment for Invoice #42",
Destination = "acct_1DHFyLAXrgjEhAUx",
DestinationAmount = 800
};
var charge = chargeService.Create(chargeOptions);
var paymentId = charge.Transfer.DestinationPaymentId;
var paymentUpdateOptions = new StripeChargeUpdateOptions
{
Description = "Payment for Invoice #42"
};
chargeService.Update(paymentId, paymentUpdateOptions, new StripeRequestOptions
{
StripeConnectAccountId = "acct_1DHFyLAXrgjEhAUx"
});
The key point here is that a charge object links to the transfer, and the transfer links to the payment. So by combining that with the expanding object feature of the API, you can get access to the payment and update it!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With