샌드 박스 또는 프로덕션에서 발생합니다. 샌드 박스에서 4111111111111111의 비자 코드와 exp 날짜를 입력하면 ... payment.Creat (토큰) 행에 도달하면 예외가 throw됩니다. "스트림을 읽을 수 없습니다." 423456789과 같은 다른 참조 번호를 입력하면 결제가 정상적으로 처리됩니다. 생산에서, 내가 4234를 사용한다면 ... 나는 스트림이 읽을 수있는 오류가 아니었다. 테스트 카드가 항상 작동하는 것은 아니지만 신용 카드 무효 응답을 기대합니다. 내가 가진 문제는 고객 중 일부가 스트림 오류가 발생하고 있다는 것입니다 ... 생산에 실제 CC를 넣으면 정상적으로 작동하지만 .. 1을 변경하면 유효하지 않은 카드 오류가 발생합니다 .... 그래서 때로는 그것을 올바르게 되돌려 보내고, 다른 때는 스트림 오류입니다 ... 최근에 Nuget을 사용하여 가장 최신의 최고의 API로 패키지를 업데이트하지만 그 밖의 다른 제안이 있습니까?PayPalRest API에 스트림을 읽을 수 없습니다.
여기 내 관련 코드입니다. 시도 { var token = GetAPIToken(); 41 : 45852 [33] DEBUG PayPal.PayPalResource [(여기서
var creditCard = new CreditCard();
creditCard.number = req.CardNumber;
creditCard.expire_month = req.ExpMonth;
creditCard.expire_year = req.ExpYear;
creditCard.first_name = req.FirstName;
creditCard.last_name = req.LastName;
creditCard.type = req.CardType;
creditCard.payer_id = req.UserId.ToString();
creditCard.cvv2 = req.SecurityCode;
creditCard.billing_address = new Address()
{
line1 = req.Address1,
city = req.City,
state = req.State,
postal_code = req.ZipCode,
country_code = "US"
};
var payment = new Payment();
payment.intent = "sale";
payment.payer = new Payer();
payment.transactions = new List<Transaction>();
var t = new Transaction()
{
description = req.Description,
amount = new Amount()
{
total = req.TotalPayment.ToString("N2"),
currency = "USD",
},
};
t.item_list = new ItemList();
t.item_list.items = new List<Item>();
t.item_list.items.Add(new Item()
{
name = req.Description,
quantity = "1",
price = req.TotalPayment.ToString("N2"),
currency = "USD",
});
payment.transactions.Add(t);
payment.payer.funding_instruments = new List<FundingInstrument>();
payment.payer.payment_method = "credit_card";
var fundingInstrument = new FundingInstrument();
fundingInstrument.credit_card = creditCard;
payment.payer.funding_instruments.Add(fundingInstrument);
var pay = payment.Create(token);
if (req.PaymentOption != PayOption.UsePayPal && pay.state == PayPalStateApproved
&& pay.transactions.Any() && pay.transactions[0].related_resources.Any()
&& pay.transactions[0].related_resources[0].sale != null
&& !String.IsNullOrEmpty(pay.transactions[0].related_resources[0].sale.id))
{
resp.TransactionID = pay.transactions[0].related_resources[0].sale.id;
}
else
{
resp.Status = Status.Error;
resp.Messages.Add(new Message { Code = "paypal", Text = pay.state });
}
}
catch (Exception ex)
{
var err = CheckPayPalError(ex);
resp.Messages.Add(new Message { Code = "paypal", Text = String.IsNullOrEmpty(err) ? ex.Message : err });
resp.Status = Status.Error;
}
return resp;
로그 엔트리는 제없이 재시 2013년 8월 29일 09이고, 재시>가 0으로 설정되면 제이고, 아르 null)] 사용자 에이전트 : PayPalSDK/rest-sdk-dotnet 0.7.3, lang = DOTNET, v = 4.0.30319.18052, 비트 = 64, os = Windows 7 6.1.7601.65536; 2013-08-29 09 : 41 : 45,852 DEBUG PayPal.PayPalResource [(null)] PayPal-Request-Id : a781e6bb-c0b0-4f06-abf8-1202dbc17a59 2013-08-29 09 : 41 : 45,920 [ 33] DEBUG PayPal.Manager.ConnectionManager ("null") { "의도": "판매", "지불 자": { "지불 방법": "신용 카드", "funding_instruments": [{ "신용 카드": { "번호" "expire_month": 5, "expire_year": 2015, "cvv2": "123", "first_name": "MIckey", "last_name": "Keenan", "billing_address" ": {"line1 ":"123 Main St ","city ":"Denver ","country_code ":"US ","postal_code ":"80210 ","state ":"CO "},"payer_id " "" "통화": "USD", "합계": "4.75"}, "설명": "WFS 점심 주문", "item_list" { "items": [{수량 ":"1 ","이름 ":"WFS 점심 식사 주문 ","가격 ":"4.75 ","통화 ":"USD "}}}}] 2013-08 -29 09 : 41 : 49,505 [33] ERROR PayPal.Manager.ConnectionManager [(null)] 오류 응답 : { "name": "INTERNAL_SERVICE_ERROR", "message": "내부 서비스 오류가 발생했습니다. ","information_link ":"https://developer.paypal.com/webapps/developer/docs/api/#INTERNAL_SERVICE_ERROR ","debug_id ":"2520071cde1ca "} 2013-08-29 09 : 41 : 49,506 [33] 정보 PayPal.Manager.ConnectionManager [(null)] InternalServerError 상태가되었습니다. 코드 서버에서 2013-08-29 09 : 41 : 49,507 [33] 오류 PayPal.Exception.PayPalException [(null)] HttpConnection에서 예외 실행 : 스트림을 읽을 수 없습니다. PayPal.Exception.PayPalException : HttpConnection 예외 실행 : 스트림을 읽을 수 없습니다. ---> System.ArgumentException : 스트림을 읽을 수 없습니다. at System.IO.StreamReader..ctor (스트림 스트림, 인코딩 인코딩, 부울 detectEncodingFromByteOrderMarks, Int32 버퍼 크기, 부울 leaveOpen) at System.IO.StreamReader..ctor (스트림 스트림) PayPal.HttpConnection.Execute (String payLoad ,의 HttpWebRequest HttpRequest에) --- 내부 예외 스택 추적 --- 끝 여기
인 제 2013년 8월 29일 09 : 44 : 27,685 [16] DEBUG PayPal.PayPalResource [(NULL) '사용자 - 에이전트 : PayPalSDK/rest-sdk-dotnet 0.7.3, lang = DOTNET, v = 4.0.30319.18052, bit = 64, os = Windows 7 6.1.7601.65536; 2013-08-29 09 : 44 : 27,686 DEBUG PayPal.PayPalResource [(null)] PayPal 요청 ID : 1d5c68e5-4b4b-4876-8bf4-3b9f64d0afb6 2013-08-29 09 : 44 : 27,753 [ 16] DEBUG PayPal.Manager.ConnectionManager [(null)] { "의도": "판매", "지불 자": { "지불 방법": "credit_card", "funding_instruments": [{ "credit_card": { "number" "expire_month": 5, "expire_year": 2015, "cvv2": "123", "first_name": "MIckey", "last_name": "Keenan", "billing_address" ": {"line1 ":"123 Main St ","city ":"Denver ","country_code ":"US ","postal_code ":"80210 ","state ":"CO "},"payer_id " "" "통화": "USD", "합계": "4.75"}, "설명": "WFS 점심 주문", "item_list" { "items": [{ "수량": "1", "이름": "WFS 점심 식사 주문", "가격": "4.{ "name": "75", "currency": "USD"}}}}} 2013-08-29 09 : 44 : 28,847 [16] 오류 PayPal.Manager.ConnectionManager [(null)] 오류 응답 : 내부 서비스 오류가 발생했습니다. ","information_link ":" https://developer.paypal.com/webapps/developer/docs/api/#INTERNAL_SERVICE_ERROR ","debug_id ":"465701e606a56 "} 2013-08-29 09 : 44 : 28,848 [16] INFO PayPal.Manager .ConnectionManager [(null)] 서버의 InternalServerError 상태 코드를 가져 왔습니다. 2013-08-29 09 : 44 : 28,850 [16] HttpConnection에서 예외가 발생했습니다. PayPal.Exception.PayPalException : 예외 (예외) 예외 HttpConnection 실행시
동일한 문제가 있습니다. 시도한 모든 테스트 신용 카드에서 INTERNAL_SERVICE_ERROR 응답을받습니다. 나는 PayPal 지원에 연락했고 그들은 나를이 게시물로 추천했다. :) – Cully