Skip to main content

PayPal Community

  • Dashboard
  • Send and Request
  • Wallet
  • Business
  • Help
Log in

Le forum de Communauté ne sera plus disponible à partir du 30 Juin 2025. Le Forum de la communauté n’est pas disponible pour les nouveaux messages ou les réponses; les articles précédents restent disponibles pour vérification. Afin de connaître les options d’assistance complètes, rendez-vous sur PayPal.com/HelpCenter

Si vous souhaitez signaler du contenu illégal et contraire au Règlement sur les services numériques de l’Union Européenne (DSA), veuillez cliquer ici.

since ‎Apr-12-2018
Country: United States
Type: Business
InvokeTech
InvokeTech Contributor
Contributor
4
Posts
2
Kudos
0
Solutions
Your PayPal Anniversary
The Return
Liked
Ice Breaker
Active
View all
Latest Contributions by InvokeTech
  • Topics InvokeTech has Participated In
  • Latest Contributions by InvokeTech

Re: I keep receiving DUPLICATE_REQUEST_ID in Sandb...

by InvokeTech Contributor in Sandbox Environment
‎Apr-20-2018 03:35 PM
‎Apr-20-2018 03:35 PM
I did submit a support "question" over at https://www.paypal-techsupport.com. I was asked to provide a request/response to the API that produces the error. I chose to bypass the SDK and communicate directly with the API. Below is the request/response, where I am now getting a HTTP 500 response.   REQUEST: curl -v -X POST https://api.sandbox.paypal.com/v1/payments/payment \ -H "Content-Type: application/json" \ -H "Authorization: Bearer MYTOKEN" \ -d '{ "intent": "sale", "payer": { "payment_method": "credit_card", "funding_instruments": [{ "credit_card": { "cvv2": "123", "expire_month": 12, "expire_year": 2019, "first_name": "Foo", "last_name": "Bar", "number": "VALID CC NUMBER", "type": "visa" } }] }, "transactions": [{ "amount": { "currency": "USD", "total": "2.54", "details": { "subtotal": "2.54" } }, "invoice_number": "asdf1234" }] }'   RESPONSE: {"name":"INTERNAL_SERVICE_ERROR","message":"An internal service error occurred.","information_link":"https://developer.paypal.com/docs/api/payments/#errors","debug_id":"170497ba1b4"}   The answer I got from Merchant Technical Support was:   Direct credit card transactions are restricted using the PayPal REST integration. You will need to leverage either the Payflow gateway or Braintree Direct to process direct card transactions. You can find the notice on the following link:-   https://developer.paypal.com/docs/api/payments/   Get in touch with you account manager at PayPal to discuss your business requirements and make a decision based on your use cases.   I did submit a support "question" over at https://www.paypal-techsupport.com. I was asked to provide a request/response to the API that produces the error. I chose to bypass the SDK and communicate directly with the API. Below is the request/response, where I am now getting a HTTP 500 response.   REQUEST: curl -v -X POST https://api.sandbox.paypal.com/v1/payments/payment \ -H "Content-Type: application/json" \ -H "Authorization: Bearer MYTOKEN" \ -d '{ "intent": "sale", "payer": { "payment_method": "credit_card", "funding_instruments": [{ "credit_card": { "cvv2": "123", "expire_month": 12, "expire_year": 2019, "first_name": "Foo", "last_name": "Bar", "number": "VALID CC NUMBER", "type": "visa" } }] }, "transactions": [{ "amount": { "currency": "USD", "total": "2.54", "details": { "subtotal": "2.54" } }, "invoice_number": "asdf1234" }] }'   RESPONSE: {"name":"INTERNAL_SERVICE_ERROR","message":"An internal service error occurred.","information_link":"https://developer.paypal.com/docs/api/payments/#errors","debug_id":"170497ba1b4"}   The answer I got from Merchant Technical Support was:   Direct credit card transactions are restricted using the PayPal REST integration. You will need to leverage either the Payflow gateway or Braintree Direct to process direct card transactions. You can find the notice on the following link:-   https://developer.paypal.com/docs/api/payments/   Get in touch with you account manager at PayPal to discuss your business requirements and make a decision based on your use cases.   My Conclusions: I'm not seeing these errors in my Live account because that account is not restricted, and I've been using credit cards via the REST API for quite some time now. For some reason this un-restricted ability does not flow through to my sandbox accounts. When I create new sandbox accounts they must simply default to restricted.   My guess is that PayPal is going to phase out credit card payments via the REST API in favor of some of their other offerings: Payflow or Braintree? Would be nice to have some clarification on that, or any sort of timeline. Certainly don't want this capability dissapearing from my Live account without some sort of advanced notice! Furthering my speculations it appears that the credit card samples have been removed from the .NET SDK source code in github GitHub (https://github.com/paypal/PayPal-NET-SDK/pull/276). Perhaps pp-randy knows what's up? I'm not seeing these errors in my Live account because that account is not restricted, and I've been using credit cards via the REST API for quite some time now. For some reason this un-restricted ability does not flow through to my sandbox accounts. When I create new sandbox accounts they must simply default to restricted.   My guess is that PayPal is going to phase out credit card payments via the REST API in favor of some of their other offerings: Payflow or Braintree? Would be nice to have some clarification on that, or any sort of timeline. Certainly don't want this capability dissapearing from my Live account without some sort of advanced notice! Furthering my speculations it appears that the credit card samples have been removed from the .NET SDK source code in github GitHub (https://github.com/paypal/PayPal-NET-SDK/pull/276). Perhaps pp-randy knows what's up? ... View more

Re: I keep receiving DUPLICATE_REQUEST_ID in Sandb...

by InvokeTech Contributor in Sandbox Environment
‎Apr-15-2018 09:14 AM
1 Kudo
‎Apr-15-2018 09:14 AM
1 Kudo
Thank you Jennifer for suggestions, however, I tried changing the settings and I'm still getting the same error responses from the API. It's refusing to accept any credit card payments. I've tried setting up a brand new sandbox account and app with a new clientId and clientSecret. I also applied the settings you suggested above to the new sandbox account. Still, I receive this exact same error every time I try to create a credit card payment using the code from before. Is there something else I can try? ... View more

I keep receiving DUPLICATE_REQUEST_ID in Sandbox b...

by InvokeTech Contributor in Sandbox Environment
‎Apr-13-2018 06:55 AM
1 Kudo
‎Apr-13-2018 06:55 AM
1 Kudo
 sing the .NET PayPal SDK, I keep getting this 400 response every time I try to process a payment using a credit card in the sandbox environment. Exact same code works in the production. I've tried all different kinds of generated credit card number, and real ones. I've tried calling apiContext.ResetRequestId(). Still same error response. Here's my code:   var config = ConfigManager.Instance.GetProperties(); var accessToken = new OAuthTokenCredential(config).GetAccessToken(); var apiContext = new APIContext(accessToken); apiContext.Config = ConfigManager.Instance.GetProperties(); var transaction = new Transaction(); transaction.amount = new Amount() { currency = "USD", total = string.Format("{0:N}", amount), details = new Details() { subtotal = string.Format("{0:N}", amount) } }; transaction.invoice_number = invoiceNumber; var payer = new Payer(); payer.payment_method = "credit_card"; payer.funding_instruments = new List<FundingInstrument>() { new FundingInstrument() { credit_card = new CreditCard() { cvv2 = cvv2, expire_month = expireMonth, expire_year = expireYear + 2000, first_name = firstName, last_name = lastName, number = cardNumber, type = GetCreditCardType(cardNumber) } } }; var payment = new Payment(); payment.intent = "sale"; payment.payer = payer; payment.transactions = new List<Transaction>() { transaction }; try { apiContext.ResetRequestId(); var createdPayment = payment.Create(apiContext); if (createdPayment.state == "failed") throw new Exception("Transaction not approved"); if (createdPayment.transactions.Count > 0 && createdPayment.transactions[0].related_resources.Count > 0) { string d = createdPayment.transactions[0].related_resources[0].sale.create_time; // https://stackoverflow.com/questions/3556144/how-to-create-a-net-datetime-from-iso-8601-format DateTime create_time = DateTime.Parse(d, null, System.Globalization.DateTimeStyles.RoundtripKind); d = createdPayment.transactions[0].related_resources[0].sale.update_time; DateTime update_time = DateTime.Parse(d, null, System.Globalization.DateTimeStyles.RoundtripKind); return new Domain.Models.Payment() { PaymentID = createdPayment.id, CreateTime = create_time, UpdateTime = update_time, TransactionID = createdPayment.transactions[0].related_resources[0].sale.id }; } else { //return createdPayment.id; throw new Exception("No sale for payment"); } } catch (PayPal.PaymentsException ex) { // TODO figure out what the problem was so we can add it to the log and error message. //ex. if (ex.Details != null) { string msg = ex.Details.message; if (ex.Details.details != null) { foreach (var d in ex.Details.details) { msg += string.Format(" (field = {0}, issue = {1}, code = {2}, purchase_unit_reference_id = {3}) (invoice: {4}) ", d.field, d.issue, d.code, d.purchase_unit_reference_id, invoiceNumber); } } throw new Exception(msg, ex); } throw ex; } catch (Exception ex) { throw ex; } ... View more

DUPLICATE_REQUEST_ID

by InvokeTech Contributor in Merchant Products and Services Archives
‎Apr-12-2018 01:35 PM
‎Apr-12-2018 01:35 PM
Using the .NET PayPal SDK, I keep getting this 400 response every time I try to process a payment using a credit card in the sandbox environment. Exact same code works in the production. I've tried all different kinds of generated credit card number, and real ones. I've tried calling apiContext.ResetRequestId(). Still same error response. Here's my code:   var config = ConfigManager.Instance.GetProperties(); var accessToken = new OAuthTokenCredential(config).GetAccessToken(); var apiContext = new APIContext(accessToken); apiContext.Config = ConfigManager.Instance.GetProperties(); var transaction = new Transaction(); transaction.amount = new Amount() { currency = "USD", total = string.Format("{0:N}", amount), details = new Details() { subtotal = string.Format("{0:N}", amount) } }; transaction.invoice_number = invoiceNumber; var payer = new Payer(); payer.payment_method = "credit_card"; payer.funding_instruments = new List<FundingInstrument>() { new FundingInstrument() { credit_card = new CreditCard() { cvv2 = cvv2, expire_month = expireMonth, expire_year = expireYear + 2000, first_name = firstName, last_name = lastName, number = cardNumber, type = GetCreditCardType(cardNumber) } } }; var payment = new Payment(); payment.intent = "sale"; payment.payer = payer; payment.transactions = new List<Transaction>() { transaction }; try { apiContext.ResetRequestId(); var createdPayment = payment.Create(apiContext); if (createdPayment.state == "failed") throw new Exception("Transaction not approved"); if (createdPayment.transactions.Count > 0 && createdPayment.transactions[0].related_resources.Count > 0) { string d = createdPayment.transactions[0].related_resources[0].sale.create_time; // https://stackoverflow.com/questions/3556144/how-to-create-a-net-datetime-from-iso-8601-format DateTime create_time = DateTime.Parse(d, null, System.Globalization.DateTimeStyles.RoundtripKind); d = createdPayment.transactions[0].related_resources[0].sale.update_time; DateTime update_time = DateTime.Parse(d, null, System.Globalization.DateTimeStyles.RoundtripKind); return new Domain.Models.Payment() { PaymentID = createdPayment.id, CreateTime = create_time, UpdateTime = update_time, TransactionID = createdPayment.transactions[0].related_resources[0].sale.id }; } else { //return createdPayment.id; throw new Exception("No sale for payment"); } } catch (PayPal.PaymentsException ex) { // TODO figure out what the problem was so we can add it to the log and error message. //ex. if (ex.Details != null) { string msg = ex.Details.message; if (ex.Details.details != null) { foreach (var d in ex.Details.details) { msg += string.Format(" (field = {0}, issue = {1}, code = {2}, purchase_unit_reference_id = {3}) (invoice: {4}) ", d.field, d.issue, d.code, d.purchase_unit_reference_id, invoiceNumber); } } throw new Exception(msg, ex); } throw ex; } catch (Exception ex) { throw ex; } ... View more
Paypal Logo
  • Help
  • Contact Us
  • Security
  • Fees
  • © 1999-2025 PayPal, Inc. All rights reserved.
  • Privacy
  • Legal
  • Cookies
  • Policy Updates

The money in your balance is eligible for pass-through FDIC insurance.

The PayPal Cash Mastercard is issued by The Bancorp Bank pursuant to a license by Mastercard International Incorporated. The Bancorp Bank; Member FDIC.

Powered by Khoros