-2
페이팔 웹 서비스를 사용하여 iphone 앱에서 페이팔을 통합하는 방법.페이팔 웹 서비스를 사용하여 iphone 앱에서 페이팔을 통합하는 방법
NSString *parameterString = [NSString stringWithFormat:@"USER=%@&PWD=%@&SIGNATURE=%@&VERSION=57.0&METHOD=SetexpressCheckout&AMT=%.2f&CURRENCYCODE=USD&&DESC=10.00&CancelURL=%@&RETURNURL=%@", userName, password, signature,@"http://www.fourerr.com",returnCallURL];
NSURL *url = [NSURL URLWithString:@"https://api-3t.sandbox.paypal.com/nvp"];
NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url];
NSString *msgLength = [NSString stringWithFormat:@"%d", [parameterString length]];
[theRequest addValue: msgLength forHTTPHeaderField:@"Content-Length"];
[theRequest setHTTPMethod:@"POST"];
[theRequest setHTTPBody: [parameterString dataUsingEncoding:NSUTF8StringEncoding]];
NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
[theConnection start];
콘솔 :
이getting error: paypal Data: TIMESTAMP=2011%2d12%2d10T11%3a43%3a53Z&CORRELATIONID=2e0852675ece5&ACK=Failure&VERSION=57%2e0&BUILD=2271164&L_ERRORCODE0=10401&L_ERRORCODE1=10471&L_ERRORCODE2=10472&L_SHORTMESSAGE0=Transaction%20refused%20because%20of%20an%20invalid%20argument%2e%20See%20additional%20error%20messages%20for%20details%2e&L_SHORTMESSAGE1=Transaction%20refused%20because%20of%20an%20invalid%20argument%2e%20See%20additional%20error%20messages%20for%20details%2e&L_SHORTMESSAGE2=Transaction%20refused%20because%20of%20an%20invalid%20argument%2e%20See%20additional%20error%20messages%20for%20details%2e&L_LONGMESSAGE0=Order%20total%20is%20invalid%2e&L_LONGMESSAGE1=ReturnURL%20is%20invalid%2e&L_LONGMESSAGE2=CancelURL%20is%20invalid%2e&L_SEVERITYCODE0=Error&L_SEVERITYCODE1=Error&L_SEVERITYCODE2=Error
제발, 나에게 페이팔 webservice에 대한 적절한 URLstring을 제공하십시오. – saurav
API 문서를 읽어 보시기 바랍니다. https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/howto_api_reference – tobiasbayer