Comments (17)
Hi @adamjimenez, we apologise, we reopen this issue, you can now publish a new comments.
from checkout-sdk-php.
Hi @adamjimenez! We will take a look and get back to you as soon as possible. Thank you.
from checkout-sdk-php.
Hi @adamjimenez!
Sandbox accounts come enabled for Visa and Mastercard tests only, if you need to enable other schemes, you need to be done in the account config, please check your test card(s).
from checkout-sdk-php.
Hi @adamjimenez, we close this issue due to inactivity, if you need it, please open a new issue. Thank you.
from checkout-sdk-php.
Hi @adamjimenez, we close this issue due to inactivity, if you need it, please open a new issue. Thank you.
So it takes you 3 weeks to respond and you give me 2 days?
from checkout-sdk-php.
In answer to your question, I'm using the visa test card 4242424242424242
from the test cards list.
from checkout-sdk-php.
Thank you @adamjimenez. We are testing your example and the data. At the same time, please check in the SDK tests, there are some examples with 3DS.
from checkout-sdk-php.
Hi @adamjimenez! Happy new year. Please try this:
<?php
use Checkout\CheckoutApiException;
use Checkout\CheckoutSdk;
use Checkout\Common\Currency;
use Checkout\Common\CustomerRequest;
use Checkout\Environment;
use Checkout\Payments\Request\PaymentRequest;
use Checkout\Payments\Request\Source\RequestTokenSource;
use Checkout\Payments\Sender\PaymentInstrumentSender;
use Checkout\Payments\ThreeDsRequest;
use Checkout\Tokens\CardTokenRequest;
require __DIR__ . '/vendor/autoload.php';
$CheckoutAPI = CheckoutSdk::builder()->staticKeys()
->publicKey("pk_sbox_xxxx")
->secretKey('sk_sbox_xxxx')
->environment(Environment::sandbox())
->build();
$cardTokenRequest = new CardTokenRequest();
$cardTokenRequest->number = "4242424242424242";
$cardTokenRequest->expiry_month = 6;
$cardTokenRequest->expiry_year = 2025;
try {
$tokenResponse = $CheckoutAPI->getTokensClient()->requestCardToken($cardTokenRequest);
$requestTokenSource = new RequestTokenSource();
$requestTokenSource->token = $tokenResponse["token"];
$threeDsRequest = new ThreeDsRequest();
$threeDsRequest->enabled = true;
$paymentInstrumentSender = new PaymentInstrumentSender();
$customerRequest = new CustomerRequest();
$customerRequest->email = $user['email'];
$customerRequest->name = $user['name'] . ' ' . $user['surname'];
$paymentRequest = new PaymentRequest();
$paymentRequest->source = $requestTokenSource;
$paymentRequest->amount = $amount * 100;
$paymentRequest->currency = Currency::$GBP;
$paymentRequest->capture = true;
$paymentRequest->capture_on = date('c', strtotime('tomorrow')); // ISO 8601 e.g. "2019-09-10T10:11:12Z",
$paymentRequest->reference = $ref;
$paymentRequest->three_ds = $threeDsRequest;
$paymentRequest->sender = $paymentInstrumentSender;
$paymentRequest->customer = $customerRequest;
$paymentRequest->processing_channel_id = 'pc_xxxx';
$paymentRequest->metadata = $metadata;
$paymentRequest->success_url = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$paymentRequest->failure_url = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
try {
$response = $CheckoutAPI->getPaymentsClient()->requestPayment($paymentRequest);
print_r($response);
exit;
} catch (Exception $ex) {
print_r($ex->getMessage());
}
} catch (CheckoutApiException $ex) {
print_r($ex->getMessage());
}
exit;
This is the response with my credentials and processing channel:
Array
(
[http_metadata] => Checkout\HttpMetadata Object
(
[reason_phrase:Checkout\HttpMetadata:private] => Accepted
[status_code:Checkout\HttpMetadata:private] => 202
[headers:Checkout\HttpMetadata:private] => Array
(
[Date] => Array
(
[0] => Fri, 12 Jan 2024 10:01:51 GMT
)
[Content-Type] => Array
(
[0] => application/json; charset=utf-8
)
[Content-Length] => Array
(
[0] => 542
)
[Connection] => Array
(
[0] => keep-alive
)
[Location] => Array
(
[0] => https://api.sandbox.checkout.com/payments/pay_xxxx
)
[Cko-Request-Id] => Array
(
[0] => xxxx-xxxx-xxxx-xxxx
)
[Cko-Version] => Array
(
[0] => 1.344.1+e6797bc63
)
[Strict-Transport-Security] => Array
(
[0] => max-age=16000000; includeSubDomains; preload;
)
)
[protocol:Checkout\HttpMetadata:private] => 1.1
)
[id] => pay_xxxx
[status] => Pending
[reference] => xxxx
[customer] => Array
(
[id] => cus_xxxx
[email] => email
[name] => name
)
[3ds] => Array
(
[downgraded] =>
[enrolled] => Y
)
[_links] => Array
(
[self] => Array
(
[href] => https://api.sandbox.checkout.com/payments/pay_xxxx
)
[actions] => Array
(
[href] => https://api.sandbox.checkout.com/payments/pay_xxxx/actions
)
[redirect] => Array
(
[href] => https://api.sandbox.checkout.com/sessions-interceptor/sid_xxxx
)
)
)
from checkout-sdk-php.
Hi,
Thanks for the reply.
I've tried the code and am still getting the same 422
error.
I did a composer update and we're on 3.0.20
version of the sdk.
I checked the keys and processing id which appear to be correct.
Is there any way to get more information on this error?
from checkout-sdk-php.
Hi @adamjimenez!
Debugging you can find a detailed error in:
from checkout-sdk-php.
from checkout-sdk-php.
I think that this link can help you:
https://www.checkout.com/docs/card-issuing/manage-cards/enroll-a-card-in-3d-secure
from checkout-sdk-php.
from checkout-sdk-php.
I'm not sure if that link applies. How do we enable 3ds in the sandbox area?
from checkout-sdk-php.
Hi @adamjimenez, please check https://www.checkout.com/docs/card-issuing/manage-cards/enroll-a-card-in-3d-secure
from checkout-sdk-php.
That documentation is nothing to do with the problem, he is using the test card 4242424242424242 , that documentations is for issuing other cards
from checkout-sdk-php.
I too am receiving 422 responses using the sandbox. Here is a request payload:
URL: https://api.sandbox.checkout.com/payments
{
"source": {
"type": "token",
"token": "***",
"billing_address": {
"address_line1": "***",
"address_line2": "",
"city": "***",
"state": "***",
"zip": "00000",
"country": "AE"
}
},
"amount": 159600,
"currency": "AED",
"payment_type": "Regular",
"reference": "AE200005095",
"description": "Payment request from ***",
"capture": true,
"capture_on": "2024-04-02T15:01:30Z",
"customer": {
"email": "***",
"name": "***"
},
"shipping": {
"address": {
"address_line1": "***",
"address_line2": "",
"city": "***",
"state": "***",
"zip": "00000",
"country": "AE"
}
},
"3ds": {
"enabled": true,
"attempt_n3d": false
},
"processing_channel_id": "pc_jot***",
"success_url": "***/checkout_com\/payment\/verify",
"failure_url": "***/checkout_com\/payment\/fail",
"metadata": {
"methodId": "checkoutcom_card_payment",
"quoteData": "{\"quote_id\":\"3079662\",\"store_id\":13,\"customer_email\":\"***\"}",
"udf5": "{\"server_url\":\"***\",\"sdk_data\":\"PHP v8.1.14, SDK v3.0.6\",\"integration_data\":\"Checkout.com Magento 2 Module v5.2.0\",\"platform_data\":\"Magento 2.4.6-p4\"}"
}
}
And the response:
{
"request_id": "108aacaa-095b-4679-a7b5-6eedac4bab60",
"error_type": "processing_error",
"error_codes": [
"payment_method_not_supported"
]
}
I used the following card details:
5588686116426417
03/30
100
I have tried the visa 3DS enabled test card 4485040371536584
and the standard visa test card 4242424242424242
. Both times with the expiry date 03/30
and CVV 100
. I receive the same response as above with these cards too.
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
- 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.