#sddevnet-Connect

1 messages · Page 1 of 1 (latest)

molten tendon
#

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?

lament knoll
#

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
}
};

molten tendon
#

Yeah that looks correct to me. (Is it Java?)

lament knoll
#

I get an error message back from this, though, that transfer_data[options] is not a valid property

#

its c#

molten tendon
#

This one, correct?

#

Your code looks correct to me tho

lament knoll
#

yea, that's the right one

molten tendon
#

Can you locate your errored message here? Or was it errored inside the SDK , before actually sending a request?

lament knoll
#

which seems pretty weird to me since I am using stripe's sdk, and their object has this property on it

molten tendon
#

ah

#

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?

lament knoll
#

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

molten tendon
#

Yes

lament knoll
#

I think it might be easier to just separate the transfer completely though

molten tendon
#

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?

  1. Yes -> Destination Charge
  2. 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

lament knoll
#

That makes sense. Thanks for your help

#

That ended up working perfectly, thanks

#

solution was to:

  1. Add connected account to the PaymentIntentTransferOptions on the CreateIntent method
  2. Set the amount for the driver in the PaymentIntentTransferOptions on the PaymentIntentCapture