title: Paypal Sandbox Api Validation Error?
body: <p>So I'm playing around with the Paypal Sandbox and I just implemented Credit card transactions. I followed the Paypal Dev example closely but it seems to continuously return an error. I have tried multiple credit cards. Everything was working correctly before  I addec direct credit card transactions.</p>
  
  <pre><code>&lt;?php
      use PayPal\Api\Payer;
      use PayPal\Api\Details;
      use PayPal\Api\Amount;
      use PayPal\Api\Transaction;
      use PayPal\Api\Payment;
      use PayPal\Api\RedirectUrls;
      use PayPal\Api\CreditCard;
      use PayPal\Api\FundingInstrument;
      use PayPal\Exception\PayPalConnectionException;
  
      require 'protected/extensions/paypal/src/start.php';
  
      $payer = new Payer();
      $details = new Details();
      $amount = new Amount();
      $transaction = new Transaction();
      $payment = new Payment();
      $redirectUrls = new RedirectUrls();
      $card = new CreditCard();
  
      $card-&gt;setType("visa")
          -&gt;setNumber("4214024046137679")
          -&gt;setExpireMonth("03")
          -&gt;setExpireYear("2020")
          // -&gt;setCvv2("012")
          -&gt;setFirstName("asdf")
          -&gt;setLastName("asdf");
  
      $fi = new FundingInstrument();
      $fi-&gt;setCreditCard($card);
      //PAYER
      $payer-&gt;setPaymentMethod("credit_card")
       -&gt;setFundingInstruments(array($fi));
  
      //Details
      //acutal prices(20 dollars is a test)
  
      //Amount
      $details-&gt;setShipping(0.0)
          -&gt;setSubtotal(20.00);
  
      $amount-&gt;setCurrency("CAD")
          -&gt;setTotal(20.00)
          -&gt;setDetails($details);
  
      //Transaction
      $transaction-&gt;setAmount($amount)
        -&gt;setDescription('Membership');
  
      //Payment
      $payment-&gt;setIntent("sale")
          -&gt;setPayer($payer)
          -&gt;setRedirectUrls($redirectUrls)
          -&gt;setTransactions(array($transaction));
  
      $payment-&gt;setRedirectUrls($redirectUrls);
  
      try{
        $payment-&gt;create($api);
        $currentId = Yii::app()-&gt;user-&gt;getId();
  
        $transactionHash = $payment-&gt;getId();
        // $_SESSION['transactionId'] = $transactionHash;
  
        $update = Yii::app()-&gt;db-&gt;createCommand()
        -&gt;update('member', array(
          'transactionId'=&gt; $transactionHash,
          ), 'id=:id', array(':id'=&gt; $currentId));
  
        var_dump($payment-&gt;create($api));
  
      } catch(PayPal\Exception\PayPalConnectionException $ex){
        echo $ex-&gt;getData();
      }
  
      // $approvalUrl = $payment-&gt;getApprovalLink();
  
      // $redirectUrl = $payment-&gt;getHref();
      // header('Location: ' . $approvalUrl);
      ?&gt;
  </code></pre>
  
  <p>This is the error it is returning:</p>
  
  <blockquote>
    <p>{"name":"VALIDATION_ERROR","details":[{"field":"payer.funding_instruments[0].credit_card.number","issue":"Value is invalid"},{"field":"payer.funding_instruments[0].credit_card.number","issue":"Must be numeric"}],"message":"Invalid request - see details","information_link":"<a href="https://developer.paypal.com/webapps/developer/docs/api/#VALIDATION_ERROR" rel="nofollow">https://developer.paypal.com/webapps/developer/docs/api/#VALIDATION_ERROR</a>","debug_id":"d25b7c74793c9"}</p>
  </blockquote>