<bdo id='i3T4r'></bdo><ul id='i3T4r'></ul>
  • <tfoot id='i3T4r'></tfoot>
      1. <legend id='i3T4r'><style id='i3T4r'><dir id='i3T4r'><q id='i3T4r'></q></dir></style></legend>

      2. <i id='i3T4r'><tr id='i3T4r'><dt id='i3T4r'><q id='i3T4r'><span id='i3T4r'><b id='i3T4r'><form id='i3T4r'><ins id='i3T4r'></ins><ul id='i3T4r'></ul><sub id='i3T4r'></sub></form><legend id='i3T4r'></legend><bdo id='i3T4r'><pre id='i3T4r'><center id='i3T4r'></center></pre></bdo></b><th id='i3T4r'></th></span></q></dt></tr></i><div id='i3T4r'><tfoot id='i3T4r'></tfoot><dl id='i3T4r'><fieldset id='i3T4r'></fieldset></dl></div>
      3. <small id='i3T4r'></small><noframes id='i3T4r'>

        PayPal REST API 为信用卡令牌返回 500 服务器错误

        PayPal REST API returning 500 Server error for credit Card Token(PayPal REST API 为信用卡令牌返回 500 服务器错误)
      4. <i id='uNmAU'><tr id='uNmAU'><dt id='uNmAU'><q id='uNmAU'><span id='uNmAU'><b id='uNmAU'><form id='uNmAU'><ins id='uNmAU'></ins><ul id='uNmAU'></ul><sub id='uNmAU'></sub></form><legend id='uNmAU'></legend><bdo id='uNmAU'><pre id='uNmAU'><center id='uNmAU'></center></pre></bdo></b><th id='uNmAU'></th></span></q></dt></tr></i><div id='uNmAU'><tfoot id='uNmAU'></tfoot><dl id='uNmAU'><fieldset id='uNmAU'></fieldset></dl></div>

        1. <tfoot id='uNmAU'></tfoot>
          • <small id='uNmAU'></small><noframes id='uNmAU'>

              <tbody id='uNmAU'></tbody>
            <legend id='uNmAU'><style id='uNmAU'><dir id='uNmAU'><q id='uNmAU'></q></dir></style></legend>
              <bdo id='uNmAU'></bdo><ul id='uNmAU'></ul>

                • 本文介绍了PayPal REST API 为信用卡令牌返回 500 服务器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试让 PayPal REST api 使用存储在保险库中的信用卡创建付款.但是,每当我尝试使用保险库中的卡付款时,PayPal 的 API 都会挂起大约半分钟,然后出现以下 500 错误:

                  I am trying to have the PayPal REST api create a payment with a credit card stored in the vault. But, whenever I try and make a payment with the card in the vault PayPal's API will hang for around half a minute, and then give me the following 500 error:

                  Exception: Got Http response code 500 when accessing https://api.sandbox.paypal.com/v1/payments/payment.
                  {"name":"INTERNAL_SERVICE_ERROR","message":"An internal service error has occurred","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#INTERNAL_SERVICE_ERROR","debug_id":"e3c779ea99f73"}
                  

                  这是我正在使用的代码(如果这里信息过多,我深表歉意,我不知道哪些信息与我的问题相关)

                  This is the code I am using (I apologize if there is too much information here, I didn't know what information was pertinent to my problem)

                  <?php
                  include("bootstrap.php"); //Sample bootstrap file configured with my clientId and Secret, creates $apiContext
                  use PayPalApiCreditCard;
                  use PayPalApiPayer;
                  use PayPalApiFundingInstrument;
                  use PayPalApiDetails;
                  use PayPalApiAmount;
                  use PayPalApiTransaction;
                  use PayPalApiPayment;
                  use PayPalApiAddress;
                  use PayPalApiCreditCardToken;
                  
                  $useVault = true;
                  
                  $addr = new Address();
                  $addr->setLine1('52 N Main ST');
                  $addr->setCity('Johnstown');
                  $addr->setCountry_code('US');
                  $addr->setPostal_code('43210');
                  $addr->setState('OH');
                  
                  
                  $card = new CreditCard();
                  //Also used PayPal Sandbox account number here
                  $card->setNumber('4111111111111111');
                  $card->setExpire_month('03');
                  $card->setExpire_year('2019');
                  $card->setCvv2('123');
                  $card->setFirst_name('Joe');
                  $card->setLast_name('Shopper');
                  $card->setType('visa');
                  $card->setBilling_address($addr);
                  $fi = new FundingInstrument();
                  
                  //Setting $useVault to false here
                  // will attempt to make the payment without storing the CC in the vault
                  // Which works. having it use the vault will return a 500 error
                  if($useVault){
                      //use Store the CC in the vault
                      $response = $card->create($apiContext);
                      $ccToken = new CreditCartToken();
                      $ccToken->setCredit_card_id($response->id);
                      $fi->setCredit_card_token($creditCardToken);
                  }else{
                      $fi->setCredit_card($card);
                  }
                  
                  
                  $payer = new Payer();
                  $payer->setPayment_method('credit_card');
                  $payer->setFunding_instruments(array($fi));
                  $amountDetails = new Details();
                  $amountDetails->setSubtotal('7.41');
                  $amountDetails->setTax('0.03');
                  $amountDetails->setShipping('0.03');
                  
                  
                  $amount = new Amount();
                  $amount->setCurrency('USD');
                  $amount->setTotal('7.47');
                  $amount->setDetails($amountDetails);
                  $transaction = new Transaction();
                  $transaction->setAmount($amount);
                  $transaction->setDescription('This is the payment transaction description.');
                  
                  $payment = new Payment();
                  $payment->setIntent('sale');
                  $payment->setPayer($payer);
                  $payment->setTransactions(array($transaction));
                  try {
                      var_dump($payment->create($apiContext));
                  } catch (PayPalExceptionPPConnectionException $ex) {
                      echo "Exception: " . $ex->getMessage() . PHP_EOL;
                      var_dump($ex->getData());
                      exit(1);
                  }
                  

                  如果我将 $useVault 更改为 false,那么将付款并且交易将显示在开发人员沙箱中.我在 dev-tools.paypal.com 上使用了本指南 它似乎和我有同样的问题(我到达第 3 步,共 4 步,它打印出发生内部服务错误

                  If I change $useVault to false then the payment will be made and the transaction will show up in the developer sandbox. I used this guide at dev-tools.paypal.com and it seems to be having the same problem as me ( I get to step 3 of 4, and it prints that an internal service error has occured

                  推荐答案

                  Paypal 在使用常用的测试 CC 时有时会抛出错误 500,例如您正在使用的测试 CC,因此请尝试另一个或仅尝试使用真实的 CC 编号,只要您处于沙盒模式,它不会向您收取任何费用或类似费用.

                  Paypal sometimes throws error 500 when using frequently used test CC like the one you are using, so try another one or just try with a real CC number as long as you are in sandbox mode it won't charge you or anything like that.

                  这篇关于PayPal REST API 为信用卡令牌返回 500 服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                • <tfoot id='d9jPo'></tfoot>

                      <i id='d9jPo'><tr id='d9jPo'><dt id='d9jPo'><q id='d9jPo'><span id='d9jPo'><b id='d9jPo'><form id='d9jPo'><ins id='d9jPo'></ins><ul id='d9jPo'></ul><sub id='d9jPo'></sub></form><legend id='d9jPo'></legend><bdo id='d9jPo'><pre id='d9jPo'><center id='d9jPo'></center></pre></bdo></b><th id='d9jPo'></th></span></q></dt></tr></i><div id='d9jPo'><tfoot id='d9jPo'></tfoot><dl id='d9jPo'><fieldset id='d9jPo'></fieldset></dl></div>

                        <tbody id='d9jPo'></tbody>
                      1. <small id='d9jPo'></small><noframes id='d9jPo'>

                        <legend id='d9jPo'><style id='d9jPo'><dir id='d9jPo'><q id='d9jPo'></q></dir></style></legend>
                        • <bdo id='d9jPo'></bdo><ul id='d9jPo'></ul>