dongmeixi5311 2015-02-01 12:36
浏览 80

PHP - 获取交易百分比的最佳方式

I'm building a website in PHP where users place bids on items. Once bidding has ended, a payment needs to be paid from the winning bidder to the listing owner. But, as the website owner, I also want to take a small percentage - say 5%.

So the process would be the winning bidder pays £100 to the listing owner, and I take 5% as that transaction takes place.

What's the best way of doing this?

I've read about PayPal MassPay, but I'm not sure whether it's what I need or not.

I'm in the UK too, not US - if that effects anything.

  • 写回答

2条回答 默认 最新

  • dongzhui9936 2015-02-01 15:25
    关注

    You can use Stripe Connect to do this if you're in the UK. You would ask your users to connect their Stripe account to your Connect Application first. You would get some data back, especially a publishable_key and an access_token which you would store on your end.

    The you would use those this way:

    • On the front-end along with Stripe.js or Stripe Checkout you need to use the publishable_key you got from the connected user when going through the Connect flow. You should not use your API key.

    • Once you get a card token you send it to your server where you will create a charge. There, you should not set your API key but you should pass the access_token of the connected user as a second parameter to the Create Charge API. You can see some example code in the documentation showing how to collect fees.

    This would automatically deposit the funds in the connected user's Stripe account minus the Stripe fee and the application_fee you chose. The fee would need to be a specific amount and not a percentage but you can calculate this on your end when creating the charge.

    评论

报告相同问题?

悬赏问题

  • ¥15 目详情-五一模拟赛详情页
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line