안녕하세요. 내 iPhone 응용 프로그램에서 Paypal을 사용하고 싶습니다. paypal API를 통합하기 위해 soapRequest를 찾았습니다. 내 코드는iPhone 응용 프로그램에서 PayPal API 사용
NSString *soapMessage = [NSString stringWithFormat:
@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<SOAP-ENV:Envelope xmlns:xsi= \"http://www.w3.org/2001/XMLSchema-instance\" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\n"
"<SOAP-ENV:Header>\n"
"<RequesterCredentials xmlns=\"urn:ebay:api:PayPalAPI\">\n"
"<Credentials xmlns=\"urn:ebay:apis:eBLBaseComponents\">\n"
"<Username>api_username</Username>\n"
"<Password>api_password</Password>\n"
"<Signature/>\n"
"<Subject/>\n"
"</Credentials>\n"
"</RequesterCredentials>\n"
"</SOAP-ENV:Header>\n"
"<SOAP-ENV:Body>\n"
"<specific_api_name_Req xmlns=\"urn:ebay:api:PayPalAPI\">\n"
"<specific_api_name_Request>\n"
"<Version xmlns=urn:ebay:apis:eBLBaseComponents”>service_version</Version>\n"
"<required_or_optional_fields xsi:type=”some_type_here”>\n"
"</required_or_optional_fields>\n"
"</specific_api_name_Request>\n"
"</specific_api_name_Req>\n"
"</SOAP-ENV:Body>\n"
"</SOAP-ENV:Envelope>\n"];
NSLog(@"Soap message===%@",soapMessage);
NSString *parameterString = [NSString stringWithFormat:@"USER=%@&PWD=%@&SIGNATURE=%@&VERSION=57.0&METHOD=SetMobileCheckout&AMT=%.2f&CURRENCYCODE=USD&DESC=%@&RETURNURL=%@", userName, password, signature, donationAmount, @"Some Charge", returnCallURL];
NSLog(parameterString);
NSURL *url = [NSURL URLWithString:paypalUrlNVP];
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];
if(theConnection){
webData = [[NSMutableData data] retain];
// [self displayConnectingView];
}else{
NSLog(@"theConnection is NULL");
}
하지만 여기서는 paypalUrlNVP 값을 얻지 못했습니다. 나는 그것을 어떻게 얻을 수 있냐? 그리고 가능한 경우 아이폰에 paypalAPI 통합의 몇 가지 예를 들어주십시오.
나는 또한 체크 아웃 기능을 사용하고 싶습니다. 나는이 분야에 새로운 것이므로 그것에 대해 전혀 모른다. 그러니 친절하게도 전체 샘플 코드를 제공하십시오. 미리 감사드립니다.
이렇게 보이는 것 같습니다. http://stackoverflow.com/questions/779423/has-anyone-implemented-the-paypal -api-through-a-native-iphone-app – andynormancx