从卡向特定商家收费 - Stripe? [英] Charge from a card to specific merchant - Stripe?

查看:20
本文介绍了从卡向特定商家收费 - Stripe?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我首先说明我的付款逻辑.

<块引用>

我的应用中有两个用户级别

  • 服务提供商将设置其银行账户以接收付款.因此,我在 Stripe 中创建了一个客户 Merchant1,然后添加了 &验证了该客户对象下的 a/c.然后保存客户 ID 以备后用.

  • 客户将添加他的卡以支付服务费用.我创建了一个客户 Customer1 并在下面添加了卡片,然后保存了客户 ID.

现在我必须从 Customer1Merchant1 收费.除了最后的程序 IE,充电之外,一切都很好.

我浏览了 Stripe

<块引用>

An

下添加卡片

<块引用>

Raju

下添加帐户

像这样,会有许多客户和提供商需要使用 Stripe API 动态接受和自动付款.

解决方案

客户正在付款来源.他们可以提供资金,但不能接收资金.

为了代表第三方接受付款,您必须使用 Stripe Connect.您将为您的商家创建帐户(而非客户).

我建议您花一些时间浏览 Connect 的文档,并直接联系 Stripe 的支持,如果您对如何将 Connect 应用于您的特定业务模式有疑问.

Let me illustrate my payment logic first off all.

I have two user-level in my app

  • Service provider will set up his bank a/c's to receive payment. So, I have created a customer Merchant1 in stripe then added & verified an a/c under that customer object. then saved the customer id for using it later.

  • Customer will add his cards for making payment for a service. I have created a customer Customer1 and added card under then saved the customer id .

Now I have to charge from Customer1 to Merchant1. Everything is works well except the final procedure IE, Charging.

I have gone through stripe charging docs but I couldn't find out how to charge directly from Customer1 to Merchant1.

By using the following code I had tried out but It seems the destination account should be connected to use the param destination. Ain't understand what's a connected account. I just want to tranfer from one customer card to other ones account. I'm stucked completely. Pl. offer me a helping hand.

// Set your secret key: remember to change this to your live secret key in production
// See your keys here: https://dashboard.stripe.com/account/apikeys
\Stripe\Stripe::setApiKey("sk_test_BQokikJOvBiI2HlWgH4olfQ2");

\Stripe\Charge::create(array(
  "amount" => 1500,
  "currency" => "usd",
  "customer" => $customer_id, // Previously stored, then retrieved
  "destination" => {CONNECTED_STRIPE_ACCOUNT_ID}
));

And also tried with the below snippet but that giving an error response like Merchant not found

 $charge_deails = \Stripe\Charge::create(array(
       "amount" => "300",
       "currency" => "usd",
       "customer" => "***", 
       "destination"=>"**",
       "description" => $requestParams['additional_description']));

Any help would greatly appreciated.

Update

Attachment for clarification

Two customers An and Raju were An is the customer and added a card to make payment and Raju is the service provide who need to receive payment.

Card added under An

Account added under Raju

Like this there would be many customers and providers those need to dynamically accept and make payment automatically using stripe API's.

解决方案

Customers are payment sources. They can provide funds, but not receive them.

In order to accept payments on behalf of third parties, you must use Stripe Connect. You would create accounts (not customers) for your merchants.

I recommend you spend some time browsing through Connect's documentation, and reach out directly to Stripe's support if you have questions about how to apply Connect to your specific business model.

这篇关于从卡向特定商家收费 - Stripe?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆