具有Paypal权限和Paypal Express结帐的Rails [英] Rails with Paypal Permissions and Paypal Express Checkout

查看:188
本文介绍了具有Paypal权限和Paypal Express结帐的Rails的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个应用程序,用户可以在其中通过Paypal Permissions SDK( https://github.com/paypal/permissions-sdk-ruby ).我能够成功获得用户的许可,并且能够存储从Paypal许可SDK返回的令牌.现在,我将以下宝石用于Express Checkout( https://github.com/nov/paypal-express ).但是关于代表用户的Paypal Express Checkout的文档尚不清楚如何使用令牌调用Express Checkout的调用.

I'm building an application where a user can connect their own Paypal account through Paypal Permissions SDK (https://github.com/paypal/permissions-sdk-ruby). I was able to successfully get permission from the user and was able to store the tokens that were returned from the Paypal Permissions SDK. Now, I am using the following gem for Express Checkout (https://github.com/nov/paypal-express). But the documentation for Paypal Express Checkout on behalf of a user is not clear on how we should use the tokens to invoke a call for Express Checkout.

我有以下代码

@api = PayPal::SDK::Permissions::API.new({
  token: @credential.paypal_access_token,
  token_secret: @credential.paypal_secret_token
})

@credential是我存储在数据库中的对象,该对象具有来自Paypal Permissions SDK的令牌.

Where @credential is my object stored in the database that has the tokens from the Paypal Permissions SDK.

现在获取后,我可以使用@api对象获取Paypal用户名,密码和签名

Now after getting, I can use the @api object to get Paypal Username, Password, and Signature

request = Paypal::Express::Request.new(
  :username   => @api.config.username,
  :password   => @api.config.password,
  :signature  => @api.config.signature
)

现在,我的问题是,钱并没有直接转到用户的贝宝帐户,而是转到了我们的帐户(我们创建了一个帐户,以便可以在贝宝的Classic API部分中创建应用程序).

Now, my problem is that the money isn't going directly to the users paypal account but it is going to our account (we made an account so that we can create a Application in the Classic API part of Paypal).

有人可以帮助我吗?或将我指向正确的方向?

Is there anyone who can help me? or point me to the right direction?

推荐答案

当代表其他帐户调用API时,您需要添加参数"subject"来指示您要为其调用API的帐户. 主题"的值可以是帐户的主要电子邮件地址或payerID.然后,这笔钱将转到作为主题值的帐户中.

When calling API on behalf of other account, you need to add parameter "subject" to indicate the account that you are calling API for. The value of "subject" could be the account primary email address or payerID. Then the money will go to the account which was the value of subject.

这篇关于具有Paypal权限和Paypal Express结帐的Rails的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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