0

我需要代表第三方将付款退还给客户。我研究了权限 API 如何获取访问令牌和验证码以在身份验证 API 中使用它来生成签名和时间戳。但在此之后,我仍然对如何在 Refund API 中使用它感到困惑。目前这是我的退款贝宝代码

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);

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

4

1 回答 1

0

退款很简单。一旦您获得请求令牌和验证码,就可以了。您无需将其传递给退款 API。您所要做的就是添加这一行

            profile.setSubject(emailid);

然后它会被退还。

于 2013-03-18T22:31:11.783 回答