gpt4 book ai didi

ios - 来自 iOS 的 PayPal 错误 580001 HTTP 请求

转载 作者:技术小花猫 更新时间:2023-10-29 10:39:45 24 4
gpt4 key购买 nike

在 iOS 中实现自适应支付时遇到一些困难,不幸的是,PayPal 网站或响应中的文档非常少。这是代码:

- (void)makePaymentSandbox{

NSError *error;

//NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
//NSURLSession *session = [NSURLSession sessionWithConfiguration:configuration delegate:self delegateQueue:nil];

NSURL *url = [NSURL URLWithString:@"https://svcs.sandbox.paypal.com/AdaptivePayments/Pay"];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:30.0];

//setting
[request setHTTPMethod:@"POST"];

//headers
[request addValue:@"alex-facilitator_api1.fastwebnet.it" forHTTPHeaderField:@"X-PAYPAL-SECURITY-USERID"];
[request addValue:@"FW79EZXASW69NE8X" forHTTPHeaderField:@"X-PAYPAL-SECURITY-PASSWORD"];
[request addValue:@"ABZua9nnv9oieyN4MwVt15YdgetaJHcyzqOHjkLbuM-bGRoI7WRS" forHTTPHeaderField:@"X-PAYPAL-SECURITY-SIGNATURE"];
//NV
[request addValue:@"JSON" forHTTPHeaderField:@"X-PAYPAL-REQUEST-DATA-FORMAT"];
[request addValue:@"JSON" forHTTPHeaderField:@"X-PAYPAL-RESPONSE-DATA-FORMAT"];

[request addValue:@"APP-80W288712P519543T" forHTTPHeaderField:@"X-PAYPAL-APPLICATION-ID"];

[request addValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[request addValue:@"en_US" forHTTPHeaderField:@"Accept-Language"];


//data

/*NSString *userUpdate =[NSString stringWithFormat:@"clientDetails.applicationId=%@&actionType=%@",@"APP-80W284485P519543T", @"PAY",nil];
NSData *data1 = [userUpdate dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:data1];
[request setValue: [NSString stringWithFormat:@"%lu", (unsigned long)[data1 length]] forHTTPHeaderField:@"Content-Length"];*/


NSDictionary *mapData = [[NSDictionary alloc] initWithObjectsAndKeys:

@"PAY", @"actionType",

@"USD", @"currencyCode",

@"http:\\www.cleverlyapp.com", @"cancelUrl",
@"http:\\www.cleverlyapp.com", @"returnUrl",


@"ReturnAll", @"requestEnvelope.detailLevel",
@"en_US", @"requestEnvelope.errorLanguage",


@"seneder@email.com", @"senderEmail",

@"0.1", @"receiverList.receiver(0).amount",
@"a-buyer@fastwebnet.it", @"receiverList.receiver(0).email",

@"0.1", @"receiverList.receiver(1).amount",
@"a-facilitator@fastwebnet.it", @"receiverList.receiver(1).email",


@"APP-80W284485P519543T", @"clientDetails.applicationId",


nil];
NSData *postData = [NSJSONSerialization dataWithJSONObject:mapData options:0 error:&error];
[request setHTTPBody:postData];


[NSURLConnection connectionWithRequest:request delegate:self];
}

这是响应:

String: {
error = (
{
category = Application;
domain = PLATFORM;
errorId = 580001;
message = "Invalid request: {0}";
severity = Error;
subdomain = Application;
}
);
responseEnvelope = {
ack = Failure;
build = 17325060;
correlationId = e82ede718b929;
timestamp = "2015-07-14T09:50:06.222-07:00";
};
}

最佳答案

请检查这些:

  1. Adaptive Payments Pay API Error 580001
  2. 580001 Invalid request: {0} PayPal (PHP)
  3. Error 580001

有些与编码有关,设置为 JSON,但实际上以 URL 编码发送,等等,其他与货币和使用的货币格式有关(例如发送的值不应包括货币符号等。)

关于ios - 来自 iOS 的 PayPal 错误 580001 HTTP 请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31412809/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com