create方法中的Paypal验证错误

1)The problem is that $paypal->create($api) Returns such an error

 Exception: Got Http response code 400 when accessing 
    https://api.sandbox.paypal.com/v1/payments/payment. string(271) "
    {"name":"VALIDATION_ERROR","details":
    [{"field":"transactions.amount","issue":"Currency should be a valid ISO 
    currency code"}],"message":"Invalid request - see 
    details","information_link":"https://developer.paypal.com/docs/api/
    payments/#errors","debug_id":"cea4b8e54646c"}"

2)this is my code

$paypal = new \PayPal\Rest\ApiContext(
    new \PayPal\Auth\OAuthTokenCredential(
        'XXX',
        'YYY'
    )
);

$paypal->setConfig([
    'mode' => 'sandbox',
    'http.ConnectionTimeOut' => 30,
    'log.LogEnabled' => false,
    'log.fileName' => '',
    'log.LogLevel' => 'FINE',
    'validation.level' => 'log'
]);

$payer = new Payer();
$details = new Details();
$amount = new Amount();
$payment = new Payment();
$transaction = new Transaction();
$redirectUrls = new RedirectUrls();

//Payer
$payer->setPaymentMethod('paypal');

//Details
$details->setShipping('2.00')
    ->setTax('0.00')
    ->setSubtotal('20.00');

//Amount
$amount->setCurrency('USA')
    ->setTotal('20.00')
    ->setDetails($details);

//Transactions
$transaction->setAmount($amount)
    ->setDescription('Add balance');

$redirectUrls->setReturnUrl('http://thechaller.com/paypal/pay')
    ->setCancelUrl('http://thechaller.com/paypal/paypalCancel');

$payment->setIntent('sale')
    ->setPayer($payer)
    ->setRedirectUrls($redirectUrls)
    ->setTransactions([$transaction]);

try {
    $payment->create($paypal);
} catch (\PayPal\Exception\PayPalConnectionException $e) {
    echo "Exception: " . $e->getMessage() . PHP_EOL;
    var_dump($e->getData());
    exit(1);
} catch (Exception $e) {
    echo $e->getMessage();
    exit(1);
}

3) client id and secret take from here

This is screen shot

You have $amount->setCurrency('USA'). It should be $amount->setCurrency('USD'). It's explained in the error message:

Currency should be a valid ISO currency code

the valid ISO currency code for USA is USD.