Answer the question
In order to leave comments, you need to log in
How to get JSON in Yandex.Checkout?
We read the Yandex cash register documentation .
Send a request to Yandex.Checkout and pass in the data for creating a payment, authentication data (shop ID and secret key), and idempotency key (any random value will do).
use YandexCheckout\Client;
$client = new Client();
$client->setAuth('<Идентификатор магазина>', '<Секретный ключ>');
$payment = $client->createPayment(
array(
'amount' => array(
'value' => 100.0,
'currency' => 'RUB',
),
'confirmation' => array(
'type' => 'redirect',
'return_url' => 'https://www.merchant-website.com/return_url',
),
'capture' => true,
'description' => 'Заказ №1',
),
uniqid('', true)
);
{
"id": "23d93cac-000f-5000-8000-126628f15141",
"status": "pending",
"paid": false,
"amount": {
"value": "100.00",
"currency": "RUB"
},
"confirmation": {
"type": "redirect",
"confirmation_url": "https://money.yandex.ru/api-pages/v2/payment-confirm/epl?orderId=23d93cac-000f-5000-8000-126628f15141"
},
"created_at": "2019-01-22T14:30:45.129Z",
"description": "Заказ №1",
"metadata": {},
"recipient": {
"account_id": "100001",
"gateway_id": "1000001"
},
"test": false
}
print_r(json_encode($payment), true);
print_r(json_encode($payment,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT));
Answer the question
In order to leave comments, you need to log in
In short, the problem is solved. It turns out that's how it was possible to get the parameter I needed. But in the documentation about this, of course, not a word was written.
print_r($payment['confirmation']['confirmation_url']);
print_r(json_encode($payment), true);
json_decode
As a standard, on any site you can see the implementation.
Wrapper or link, inside an image:
Next, pseudo-elements are used:
a { display: block; position: relative; }
a:after { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.5); opacity: 0; }
a:before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: url(icon-path); opacity: 0; }
a:hover:before,
a:hover:after { opacity: 1; }
<a href="#" class="img__link">
<img src="path" />
<span class="img__mask"><i class="img__icon"></i></span>
</a>
a { display: block; position: relative; }
.mask { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.5); opacity: 0; }
a:hover:after {
opacity: 1;
}
CSS filters:
https://paulund.co.uk/css-filter
caniuse.com/#feat=css-filters
hang hover on the img wrapper, make the icon visible: visible on hover.
.img_wrapper:hover {
...
background: rgba(0,0,0,0.5) //прозрачность сами выставите
}
img_wrapper:hover .icon {
visibility: visible
}
<div class="block">
...
</div>
.block {
position: relative;
}
.block::before {
content: normal;
}
.block::after{
content: normal;
}
.block:hover::before {
content: ''
}
.block:hover::after {
content: ''
}
.block::before {
position: absolute;
top: 0;
left: 0;
width: 0;
heigth: 0;
background-color: rgba(0, 0, 0, 0.6);
z-index: 1;
}
.block::after {
position: absolute;
background: url('icon.png');
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 2;
}
For a quick one like this https://jsbin.com/pokunufiho/edit?html,css,output
But the icon will also be transparent. To eliminate this, you need to make a picture of the desired transparency and add a background to the block. By default, the hiding block is display: none, and to appear we write this .img-block:hover .hover-block{
display: block;
}
Well, add time to make it smooth.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question