0

我目前正在测试我的贝宝集成。使用 Masspay 时,我输入的每个用户名都有类似邮件的格式(@ 和“.”),我会收到“成功”响应。我正在使用以下代码:

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

1 回答 1

0

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

然后,这笔钱将可以提取到银行账户,或作为 PayPal 余额使用。

于 2012-09-27T16:08:42.067 回答