首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在退款电话中使用paypal认证信号和时间戳

如何在退款电话中使用paypal认证信号和时间戳
EN

Stack Overflow用户
提问于 2013-03-19 01:34:28
回答 1查看 150关注 0票数 0

我需要代表第三方向客户退款。我研究了权限API,如何获取访问令牌和验证码,以便在认证API中生成签名和时间戳。但是在这之后,我仍然对如何在退款API中使用这个感到困惑。目前这是我的退款paypal代码

代码语言:javascript
复制
CallerServices caller = new CallerServices();
APIProfile profile = ProfileFactory.createSignatureAPIProfile();
if(Configuration.getProperty("PaypalEnvironment").equals("sandbox"))
{
profile.setAPIUsername(Configuration.getProperty("PaypalAPIUsername"));
profile.setAPIPassword(Configuration.getProperty("PaypalAPIPassword"));
profile.setSignature(Configuration.getProperty("PaypalSignature"));
profile.setEnvironment(Configuration.getProperty("PaypalEnvironment"));
caller.setAPIProfile(profile);
}
RefundTransactionRequestType pprequest = new RefundTransactionRequestType();
if ((amount != null && amount.length() > 0)
        && (refundType.equals("Partial"))) {
    BasicAmountType amtType = new BasicAmountType();
    amtType.set_value(amount);
    amtType.setCurrencyID(CurrencyCodeType.fromString(currencyCode));
    pprequest.setAmount(amtType);
}
pprequest.setVersion("63.0");
pprequest.setTransactionID(transactionId);
pprequest.setMemo(note);
pprequest.setRefundType(RefundType.fromString(refundType));
RefundTransactionResponseType ppresponse = (RefundTransactionResponseType) caller
            .call("RefundTransaction", pprequest);

在这段代码中,我如何嵌入签名?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-03-19 06:31:12

退款很简单。一旦你得到了请求令牌和验证码,就是这样。退费接口不需要传入此参数。上面所要做的就是添加下面这一行

代码语言:javascript
复制
            profile.setSubject(emailid);

然后它会得到退款。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15483210

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档