Comments (16)
from checkout-sdk-php.
Hi @ayafaheem ,
Error 422 is a gateway response for invalid data sent. Double check if Apple data is well decoded when sending to your PHP file from the front-end.
You can always catch CheckoutHttpException exception, print $e->getErrors();
or $e->getBody();
to help you on debugging.
from checkout-sdk-php.
Same here, The endpoint did not accept the request. (Code: 422)
from checkout-sdk-php.
Hi @Amaraciuri ,
I believe you are sending invalid data to the gateway. Could you catch the error and see what field is invalid?
from checkout-sdk-php.
Are your payment credentials valid? Check if you are sending request to sandbox or live
from checkout-sdk-php.
Same issue with me. My Secret key and cart token is correct. Did anyone found the solution?
public function store(Request $request)
{
// Initialize the Checkout API
$checkout = new CheckoutApi('sk_test_b5065bb5-f1b1-4dd3-b21a-bd9f2d99375b');
// Create a payment method instance with card details
$method = new TokenSource("$request->checkout_token");
// Prepare the payment parameters
$payment = new Payment($method, 'GBP');
$payment->amount = 10000; // = 10.00
// Send the request and retrieve the response
$response = $checkout->payments()->request($payment);
dd($response);
}
from checkout-sdk-php.
@iamsajidjaved ,
I've tried to run your example and is working fine. Error code 422 means you are sending invalid data to the gateway (see more here).
Try wrapping $response = $checkout->payments()->request($payment);
with a try-catch and see what data is invalid. Here's an example:
try {
$response = $checkout->payments()->request($payment);
} catch(Checkout\Library\Exceptions\CheckoutHttpException $ex) {
print_r($ex->getBody());
}
Here's a link about error handling of the PHP SDK: https://github.com/checkout/checkout-sdk-php/wiki#error-handling
from checkout-sdk-php.
I am facing the same issue is it because I am using the sandbox endpoint ?
from checkout-sdk-php.
@Paula2001 ,
There are many reasons why gateway can respond with 422. You will find more details in the reference.
from checkout-sdk-php.
I've read this several times already and the data is correct ,The only thing left is that I am using the testing token and I want to know if there's a proof that supports that .
from checkout-sdk-php.
I am getting "Your API key is invalid." and I double checked the token also there's something I don't understand $method = new TokenSource('tok_ubfj2q76miwundwlk72vxt2i7q');
what's that @iamsajidjaved
from checkout-sdk-php.
worth to mention that I am using the testing account
from checkout-sdk-php.
from checkout-sdk-php.
from checkout-sdk-php.
from checkout-sdk-php.
thanks appreciate your share
from checkout-sdk-php.
Related Issues (20)
- Include the support for subMerchant information HOT 5
- Checkout_SDK HOT 2
- Error "Call to a member function getId() on array" when calling Payment's getSourceId() HOT 7
- Monolog v3 is not supported HOT 2
- invalid public key HOT 2
- Upgrade guides HOT 6
- php request a payment ,but reurn :The API response status code (422) does not indicate success. HOT 3
- https://github.com/checkout/checkout-sdk-php Library not installed by composer update. HOT 8
- Doc issue : Capture a payment require a CaptureRequest HOT 1
- Receiving error: payment_method_not_supported HOT 17
- Guzzle timeout or custom guzzle client HOT 1
- Paypal : Payment context give 'payee_not_onboarded' error HOT 2
- Get Payment detail : Missing approved key for Sofort HOT 2
- Get Bank decline with Giropay in sandbox HOT 2
- Call to a member function getBody() on null HOT 2
- ConnectException not managed if the host is down HOT 3
- events->load() endpoint removes important response data HOT 2
- Checkout token for a given Apple Pay token does not contains the "scheme" attribute HOT 1
- Allow attemp_n3d in 3DS request HOT 2
- phpunit version in require-dev HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from checkout-sdk-php.