#sddevnet-Connect
1 messages · Page 1 of 1 (latest)
When you capture, do you often capture less than the original Payment?
Let's say you open a Payment for $10, with application_fee of $3. When you capture some amount like $8, you want to specify the application_fee to $2 again?
The Capture API allows to set both new amount_to_capture and new transfer_data.amount: https://stripe.com/docs/api/payment_intents/capture
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
So our delivery service doesn't have access to the menu of the places where things are being ordered from. The customer can free form enter what they want (i.e. pick up 6 2x4s from Home Depot). When the user places the order, we put a standard hold amount ($100) on the card and have capture mode set to "manual". Then a driver accepts the order (the amount we pay a driver changes based on which driver is picking up the order, so we do not put an application fee on PaymentIntentCreate because we don't know how much of the delivery fee the application gets and how much the driver gets). When the driver picks up the order, they take a picture of the receipt and enter the total amount. At that point, if the total amount is less than the authorization hold, we try and create a PaymentIntentCapture
When we make the PaymentIntentCapture, we now know who the driver is and what their portion of the delivery fee will be, so I tried to do the following:
var chargeOptions = new PaymentIntentCaptureOptions()
{
AmountToCapture = (int)Math.Round(total * 100),
TransferData = new PaymentIntentTransferDataOptions()
{
Amount = (int)Math.Round(((order.DeliveryFee * .8m) + order.Tip) * 100),
Destination = driver.driverSettings.ExternalId
}
};
Yeah that looks correct to me. (Is it Java?)
I get an error message back from this, though, that transfer_data[options] is not a valid property
its c#
I just found this googling around, I am going to see if maybe it will work:
https://stripe.com/docs/connect/charges-transfers
Stripe.net is a sync/async .NET 4.6.1+ client, and a portable class library for stripe.com. - stripe-dotnet/PaymentIntentCaptureOptions.cs at master · stripe/stripe-dotnet
This one, correct?
Your code looks correct to me tho
yea, that's the right one
Can you locate your errored message here? Or was it errored inside the SDK , before actually sending a request?
which seems pretty weird to me since I am using stripe's sdk, and their object has this property on it
ah
https://stripe.com/docs/api/payment_intents/capture?lang=dotnet#capture_payment_intent-transfer_data
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yes in the timing of capture, you can't re-specify the account
Do you know the driver account at the timing of creating PaymentIntent?
Yea, when I make the payment intent, the customer has already chosen the driver
So I could probably add that to the CreatePaymentIntent and just set the amount when I capture
Yes
I think it might be easier to just separate the transfer completely though
I believe it should work. Let's test it out
It's really the matter of: do you know the connected account when creating the PaymentIntent?
- Yes -> Destination Charge
- No -> Separate Charge and Transfers
Note that with Separate Charge and Transfers, those information is not really "linked" unless you use source_transaction, etc. It's more flexible but could have more scenario to handle, like negative balances with async PaymentMethod etc
I would say stick with Destination Charge if you can