Paypal Sandbox: DoExpressCheckoutPayment 10001 Internal Error - php

I'm currently working on an e-commerce website, I have integrated Paypal (Express Checkout) and it worked well until yesterday.
When I send the DoExpressCheckoutPayment Request, I receive this response :
"ACK" => "Failure"
"VERSION" => "204.0"
"BUILD" => "000000"
"L_ERRORCODE0" => "10001"
"L_SHORTMESSAGE0" => "Internal Error"
"L_LONGMESSAGE0" => "Internal Error"
"L_SEVERITYCODE0" => "Error"
The parameters that I send :
'USER' => $username,
'PWD' => $password,
'SIGNATURE' => $signature,
'VERSION' => "204.0",
'METHOD' => 'DoExpressCheckoutPayment',
'TOKEN' => $token,
'PAYERID' => $payerid,
'PAYMENTREQUEST_0_AMT' => $price,
'PAYMENTREQUEST_0_ITEMAMT' => $price,
'PAYMENTREQUEST_0_PAYMENTACTION' => 'Sale',
'PAYMENTREQUEST_0_CURRENCYCODE' => 'EUR'
Do you have Any idea ?

I could solve that by creating a new buyer and merchant account at https://developer.paypal.com/developer/accounts both in the same country (and so using the same currency).
I updated the API credentials (username, password, signature) from the new merchant and payed with the new buyer account.

Related

Paypal Checkout SDK - immediate payment

I need to use Paypal checkout in order to accept immediate payment on my Laravel website, and I switched from old Paypal PHP SDK to the new Paypal checkout SDK to support API V2.
I followed the samples codes that provided in the new SDK, I have to create all workflow on my server, so I created an order with intent=CAPTURE with other required fields.
$request = new OrdersCreateRequest();
$request->headers["prefer"] = "return=representation";
$request->body = $this->buildMinimumRequestBody(...);
$response = $this->client->execute($request);
// redirect the user to approval link.
Order body:
return array(
'intent' => 'CAPTURE',
'application_context' =>
array(
'return_url' => 'https://example.com/return',
'cancel_url' => 'https://example.com/cancel',
'locale' => 'en-US',
'user_action' => 'PAY_NOW',
'shipping_preference'=> 'NO_SHIPPING'
),
'purchase_units' =>
array(
0 =>
array(
'amount' =>
array(
'currency_code' => 'USD',
'value' => 12,
'breakdown' =>
array(
'item_total' =>
array(
'currency_code' => 'USD',
'value' => 10,
),
'tax_total' =>
array(
'currency_code' => 'USD',
'value' => 2,
),
),
),
),
),
);
After the user redirected to approval URL and approving it, I execute the payment like below:
$response = $this->client->execute(new OrdersCaptureRequest($payment_id));
Below is the response after executing the payment.
Order and Payment response
So after directing the user to the approval page, then after approving the payment, then executing the order, I got the above result in the attached screenshot which shows the Order status is completed but the payment status is still "pending" and the reason is "PENDING_REVIEW", so I would like to ask if there is any error or something missed to make the payment immediately without waiting for review with an example.
Thanks.

Stripe saying 'Payment not completed' Stripe connect php

When transferring money to a connected account on Stripe using this code
// // Create a PaymentIntent:
$method = \Stripe\PaymentMethod::create([
'type' => 'card',
'card' => [
'number' => '4242424242424242',
'exp_month' => 12,
'exp_year' => 2020,
'cvc' => '314',
],
]);
$paymentIntent = \Stripe\PaymentIntent::create([
'amount' => $AMOUNT1,
'currency' => 'nzd',
'payment_method_types' => ['card'],
'payment_method' => $method->id,
'customer' => CUSTOMER_ID,
'transfer_group' => '{ORDER'.$_SESSION['order_id'].'}',
]);
// Create a Transfer to a connected account (later):
$transfer = \Stripe\Transfer::create([
'amount' => $AMOUNT2,
'currency' => 'nzd',
'destination' => $ACC_ID,
'transfer_group' => '{ORDER'.$_SESSION['order_id'].'}',
]);
The payment stores on the connected account's dashboard and says its completed but when it stores on my Payments tab it says that the payment is incomplete and that the buyer has not completed the payment
Prev1
Prev2
You need to confirm the payment intent, either by providing confirm=true at creation or by making a call to /confirm.
You're creating a transfer from your account to the connected one, which succeeds, and a payment that you never complete.

Creating Sub Merchant Account in Braintree gives "Master merchant account id is invalid" error

$masterMerchantAccountId = $this->config->item('merchantId_sandbox');
$merchantAccountParams = [
'individual' => [
'firstName' => $inputData['firstName'],
'lastName' => $inputData['lastName'],
'email' => $merchantIndividualEmail,
'dateOfBirth' => $inputData['dob'],
'address' => [
'streetAddress' => $merchantIndividualAddress,
'locality' => $merchantAccountLocality,
'region' => $merchantAccountRegion,
'postalCode' => $inputData['zipCode'],
]
],
'funding' => [
'descriptor' => $merchantFundDescriptor,
'destination' => Braintree\MerchantAccount::FUNDING_DESTINATION_BANK,
'accountNumber' => $merchantFundAccount,
'routingNumber' => $merchantFundRoutingNo,
],
'tosAccepted' => true,
'masterMerchantAccountId' => $masterMerchantAccountId
];
$merchantAccountResponse = $gateway->merchantAccount()->create($merchantAccountParams);
I am using this code to create sub merchant account through braintree sandbox, but i receive error from Braintree. Error is given below.
"Master merchant account id is invalid"
How can I resolve this issue?
I want to do sub merchant accounts in my master merchant accounts and customer will do payment to sub merchants.
Customer created through braintree sandbox working correctly. it gives no error only sub merchant account create gives error.

No such external account and my Stripe Payout not working using php?

I am transferring fund from stripe account to connect account using payout api
my code is:
$payout = \Stripe\Payout::create([
'amount' => 500,
'currency' => 'aud',
'description' => 'first payout payment transfer on stripe',
'destination' => 'bank_id',
'method' => 'instant',
'source_type' => 'bank_account',
'statement_descriptor' => 'first payout payment transfer on stripe ',
]);
after hit this api show error:
Stripe\Exception\InvalidRequestException: No such external account:
ba_1G497bAoBoRegJgCC1jj2UE2 in file
/var/www/html/ultimateFitness/app/Stripe/lib/Exception/ApiErrorException.php
on line 38
Also i am follow stripe documentation:
https://stripe.com/docs/api/payouts/create
You need to make the call on behalf of the connected account — right now it gives an error because it's looking for the bank account on your Stripe account, not the connected one.
https://stripe.com/docs/connect/authentication
$payout = \Stripe\Payout::create([
'amount' => 500,
'currency' => 'aud',
'description' => 'first payout payment transfer on stripe',
'destination' => $bank_id,
'method' => 'instant',
'source_type' => 'bank_account',
'statement_descriptor' => 'first payout payment transfer on stripe ',
],
["stripe_account" => "{{CONNECTED_STRIPE_ACCOUNT_ID}}"]); // value like "acct_xxx"

"The Transaction is invalid ...." PayPal when I send user for approval

I am really in trouble from couple of hours, tried many ways but still no luck. I have integrated PayPal in my wordpress theme using Paypal Framework Wordpress plugin. The Sandbox settings are working fine. I got Success on SetExpressCheckout with Token, When I send user to PayPal for approval and payment using https://www.sandbox.paypal.com/webscr?TOKEN=EC-2FY692500K5578627&cmd=_express-checkout it gives me error...
This transaction is invalid. Please return to the recipient's website to complete your transaction using their regular checkout flow.
Please help, what can I do to make it work... I am really worried... :(
UPDATED
I am sending following params for SetExpressCheckout
$ppParams = array(
'METHOD' => 'SetExpressCheckout',
'PAYMENTREQUEST_0_PAYMENTACTION' => 'Sale',
'RETURNURL' => admin_url('admin-ajax.php?action=paypal_handler&step=commit&user_id=' . $user_id),
'CANCELURL' => home_url(),
'AMT' => $price,
'PAYMENTREQUEST_0_AMT' => $price,
'PAYMENTREQUEST_0_ITEMAMT' => $price,
'L_PAYMENTREQUEST_0_ITEMCATEGORY0' => 'Digital',
'L_PAYMENTREQUEST_0_NAME0' => 'Prod Name',
'L_PAYMENTREQUEST_0_QTY0' => 1,
'L_PAYMENTREQUEST_0_AMT0' => $price,
'DESC' => 'description',
'FIRSTNAME' => $_POST['first_name'],
'LASTNAME' => $_POST['last_name'],
'EMAIL' => $email
);
$response = hashCall($ppParams);
I am using following https://cms.paypal.com/uk/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_ECGettingStarted for cross checking and implementation.
Huh! found the solution... it was nothing just use lower-case letters for TOKEN... in https://www.sandbox.paypal.com/webscr?token=EC-2FY692500K5578627&cmd=_express-checkout

Categories