Skip to content

Stripe.StripeException: 'You cannot specify an on_behalf_of value that is different from the transfer_data[destination] value when using card #1709

Description

@granthoff1107

I'm attempting to have users pay each other directly. I've created a function which creates destination charges from one user to another. I've created a function which will transfer money from a customer to the seller while collecting a fee:

var paymentIntentService = new PaymentIntentService();
var paymentIntentTransferDataOptions = new PaymentIntentTransferDataOptions();

paymentIntentTransferDataOptions.Destination = sellerAccountId ?? this.GetPlatformAccount();

var options = new PaymentIntentCreateOptions
{
    Amount = amountInCents,
    Currency = currency,
    ApplicationFeeAmount = applicationFeeInCents,
    PaymentMethodTypes = new List<string> { "card" },
    OnBehalfOf = customerAccountId,
    TransferData = paymentIntentTransferDataOptions
};

var requestOptions = new RequestOptions { IdempotencyKey = idem };
return await paymentIntentService.CreateAsync(options, requestOptions);

When I try to send money from one user to another I get an error:

Stripe.StripeException: 'You cannot specify an on_behalf_of value that is different from the transfer_data[destination] value when using card or card_present in payment_method_types. This is because when you are using destination charging, Stripe must settle charges in the country of the destination account. You can learn more about charges and transfers here: https://stripe.com/docs/connect/charges-transfers#on-behalf-of'

This error message is very misleading, How would you be able to take in a charge if you cannot have the values of OnBehalfOf differ from destination. E.g Even if you were to send it directly to the platform, the OnBehalfOf would still differ from the destination.

I'm aware I can transfer money to my platform and then to the seller, However, that opens me up to a risk, where the Customer disputes a charge, and I cannot recoup the cost from the seller. So I would perfer the users pay eachother directly, Whether that is in a single transaction, or 2 (e.g customer creates a transaction to the platform for use of services, and then creates another transaction directly to the seller).

According to the documentation overview:

"businesses like Shopify can use the card_payments capability to enable sellers to accept payments directly from their customers ... Connected accounts with the card_payments capability have their statement descriptor displayed on the customer’s bank statement, not the platform’s."

However there is not many examples to support this claim.

How can I have two users pay eachother?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions