2012-08-01 66 views
1

嗨,我有點困惑。我正在使用沙盒憑證進行paypal api調用。返回ACK是:成功。當我去付款人或商業沙箱帳戶時,沒有處理交易。我衝過來,看起來像我填充所有的領域,再加上我會認爲如果一些領域缺失錯誤將被拋出。這是我正在使用的代碼。成功的paypal API調用不在沙箱中顯示

.....

APIProfile apiProfile = ProfileFactory.createSignatureAPIProfile(); 
        apiProfile.setAPIUsername(paypalAccount.getApiLogin()); 
        apiProfile.setAPIPassword(paypalAccount.getApiPassword()); 
        apiProfile.setSignature(paypalAccount.getApiSignature()); 
        apiProfile.setEnvironment(paypalAccount.getApiEnvironment()); 

        // caller 
        NVPCallerServices callerServices = new NVPCallerServices(); 
        callerServices.setAPIProfile(apiProfile); 

        // encoder 
        NVPEncoder encoder = new NVPEncoder(); 
        encoder.add(METHOD, METHOD_VALUE); 
        encoder.add(RETURNURL, paypalAccount.getReturnUrl()); 
        encoder.add(CANCELURL, paypalAccount.getCancelUrl()); 
        encoder.add(CURRENCYCODE, CURRENCYCODE_VALUE); 
        encoder.add(PAYMENTACTION, PAYMENTACTION_VALUE); 
        encoder.add(AMT, payment.getPaymentOrder().getPrice().toString()); 
        encoder.add(L_NAME0, L_NAME0_VALUE); 
        encoder.add(L_AMT0, payment.getPaymentOrder().getPrice().toString()); 

        // call 
        String NVPRequest = encoder.encode(); 
        String NVPResponse = callerServices.call(NVPRequest); 
        NVPDecoder decoder = new NVPDecoder(); 
        decoder.decode(NVPResponse); 

        String ack = decoder.get(ACK); 
        payment.setPaymentTransaction(decoder.get(TOKEN)); 

......

任何幫助將是真棒!

回答