ds000001 2017-04-20 20:28
浏览 37

Wepay整合

I'm trying to create a simple checkout page with wepay and my checkout code (taken from the SDK sample) works great for the owner (me) when I'm signed in, but when logged in as a different user who hasn't created the account (under theirs?) it says the account is invalid or does not belong to the user.

So how are new logged in users supposed to pay to the account (mine), in other words make payments?

Here is the code for reference. The account_id doesn't work for new logged in users because they haven't created it.

$wepay = new WePay($_SESSION['wepay_access_token']);

$checkout = $wepay->request('checkout/create', array(
    'account_id' => 501999810,
    'amount' => 1.00,
    'currency'=> 'USD',
    'short_description'=> 'Selling 42 Pens',
    'type'=> 'goods'
));

Maybe I have something completely off, but that account_id is where I want to receive payments?

Any help would be appreciated!

  • 写回答

2条回答 默认 最新

  • dongtou2016 2017-06-05 16:26
    关注

    Once you register the user, you have to create an actual merchant account by calling /account/create.

    Once you have the user's access token, you can call /account/create with the user's access token and the relevant info to actually attach an account to the user. The /account/create call will return an account_id. That account_id is the one you use in the /checkout/create call.

    So until you create an account via /account/create the user cannot accept payments.

    评论

报告相同问题?

悬赏问题

  • ¥100 连续两帧图像高速减法
  • ¥15 组策略中的计算机配置策略无法下发
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据
  • ¥20 给自己本科IT专业毕业的妹m找个实习工作
  • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?
  • ¥30 我的代码按理说完成了模型的搭建、训练、验证测试等工作(标签-网络|关键词-变化检测)
  • ¥50 mac mini外接显示器 画质字体模糊
  • ¥15 TLS1.2协议通信解密
  • ¥40 图书信息管理系统程序编写