You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am trying to implement PayPal Credit card functionality on laravel for Rest Api. I am receiving the "PAYEE_ACCOUNT_INVALID" error. Any idea what am I doing wrong? Any help would be really appreciated. Thanks.
This is my code snippet.
public function payment()
{
$gateway = Omnipay::create('PayPal_Rest');
// Initialise the gateway
$gateway->initialize(array(
'clientId' => env('PAYPAL_SANDBOX_CLIENT_ID'),
'secret' => env('PAYPAL_SANDBOX_CLIENT_SECRET'),
'testMode' => true,
));
#### Direct Credit Card Payment
// Create a credit card object
// DO NOT USE THESE CARD VALUES -- substitute your own
// see the documentation in the class header.
$card = new CreditCard([
'firstName' => 'Example',
'lastName' => 'User',
'number' => '4111111111111111',
'expiryMonth' => '01',
'expiryYear' => '2027',
'cvv' => '123',
]);
// Do a purchase transaction on the gateway
try {
$transaction = $gateway->purchase([
'amount' => '1.00',
'currency' => 'AUD',
'description' => 'This is a test purchase transaction.',
'card' => $card,
]);
$response = $transaction->send();
$data = $response->getData();
echo "Gateway purchase response data == " . print_r($data, true) . "\n";
if ($response->isSuccessful()) {
echo "Purchase transaction was successful!\n";
}
} catch (Exception $e) {
echo "Exception caught while attempting authorize.\n";
echo "Exception type == " . get_class($e) . "\n";
echo "Message == " . $e->getMessage() . "\n";
}
}
The text was updated successfully, but these errors were encountered:
Same error here.
I have tried with various REST API apps (sandbox), and thus different Business sandbox accounts, client IDs and secrets.
But always ends up with the 400 "Payee account is invalid." error.
The documentation does not help much https://developer.paypal.com/docs/api/payments/v1/#error-PAYEE_ACCOUNT_INVALID
I have revised the sandbox merchant accounts are indeed both Business and Verified (they are by default).
Important: The use of the PayPal REST /payments APIs to accept credit card payments is restricted. Instead, you can accept credit card payments with Braintree Direct.
Hi, I am trying to implement PayPal Credit card functionality on laravel for Rest Api. I am receiving the "PAYEE_ACCOUNT_INVALID" error. Any idea what am I doing wrong? Any help would be really appreciated. Thanks.
This is my code snippet.
The text was updated successfully, but these errors were encountered: