paypal masspay总是会回归成功,即使现有用户也是如此

时间:2012-09-27 10:32:41

标签: paypal paypal-sandbox

我目前正在测试我的paypal集成。当我使用Masspay时,我输入的每个用户名都具有类似邮件的格式(@和a"。")我获得了成功"响应。我使用以下代码:

def emails =[]
def amounts = []

emails[0]=params.cuenta;
amounts[0]=params.cantidad;



//masspay.massPayCode("Dinero recibido de TikCode.com", "info@tikcode.com", emails,          amount, "EUR");

String emailSub = "Dinero recibido de TikCode.com";
String emailAddress = "info@tikcode.com";
String [] receiverEmailItems = emails;
String [] amountItems = amounts;
String currencyCode = "EUR";
CallerServices caller = new CallerServices();

String responseValue = null;


    APIProfile profile = ProfileFactory.createSignatureAPIProfile();
    /*
     WARNING: Do not embed plaintext credentials in your application code.
     Doing so is insecure and against best practices.
     Your API credentials must be handled securely. Please consider
     encrypting them for use in any production environment, and ensure
     that only authorized individuals may view or modify them.
     */

// Set up your API credentials, PayPal end point, and API version.
    profile.setAPIUsername("myusername");
    profile.setAPIPassword("mypasswordapi");
    //profile.setSignature("AFcWxV21C7fd0v3bYYYRCpSSRl31ARykt6evANuQsOANN9TjehZjqIl3"); 
    profile.setSignature("mysignature");
    profile.setEnvironment("sandbox");
    caller.setAPIProfile(profile);
    MassPayRequestType pprequest = new MassPayRequestType();
    pprequest.setVersion("90.0");
    println("llegas aqui?")
// Add request-specific fields to the request.
    MassPayRequestItemType[] massPayItem = new MassPayRequestItemType[receiverEmailItems.length];
    int j = 0
    for(int i=0;i<receiverEmailItems.length; i++)
    {
        String recreceiverEmail=receiverEmailItems[i];
        if(recreceiverEmail != null && recreceiverEmail.length()!= 0)
        {
            MassPayRequestItemType massItemReq = new MassPayRequestItemType();
            massItemReq.setReceiverEmail(receiverEmailItems[i]);
            BasicAmountType amount = new BasicAmountType();
               amount.set_value(amountItems[i]);
            amount.setCurrencyID(CurrencyCodeType.fromString(currencyCode));
            //massItemReq.setUniqueId(uniqueIdItems[i]);
            //massItemReq.setNote(noteItems[i]);
            massItemReq.setAmount(amount);
            massPayItem[j]=massItemReq;
            j++;
        }
    }
    pprequest.setEmailSubject(emailSub);
//  pprequest.setReceiverType(ReceiverInfoCodeType.fromString("abdel@publidirecta.com"));
    pprequest.setMassPayItem(massPayItem);

// Execute the API operation and obtain the response.
    MassPayResponseType ppresponse = (MassPayResponseType) caller.call("MassPay", pprequest);
    responseValue = ppresponse.getAck().toString();

// println(ex)     // ex.printStackTrace();

return responseValue;

1 个答案:

答案 0 :(得分:0)

这是预期的; MassPay允许将资金转移给非注册用户 这些人将收到来自PayPal的电子邮件,让他们知道钱正在等待他们,他们只需要注册PayPal并确认他们的电子邮件地址即可接收。

这笔钱可以提取到银行账户,或者用作PayPal余额。