Print value of an array or variable in a payment plugin
Question
I am programming a payment plugin for woocommerce, for the purposes of testing it I need to print the values of $response
, I have treated withecho
, print_r
andvar_dump
, but when I make the purchase process it does not print in any side.
How can I do to visualize its content when buying a product.
(After entering the card details and making the purchase process I need to see those values)
Part of the plugin code:
$payload = array(
"key_id" => $key_id,
"hash" => $hash,
"time" => $time,
"amount" => $customer_order->order_total,
"ccnumber" => str_replace( array(' ', '-' ), '', $_POST['bac_payment-card-number'] ),
"ccexp" => str_replace( array( '/', ' '), '', $_POST['bac_payment-card-expiry'] ),
"orderid" => $orderid,
"cvv" => ( isset( $_POST['bac_payment-card-cvc'] ) ) ? $_POST['bac_payment-card-cvc'] : '',
"type" => "auth",);
// Send this payload to Authorize.net for processing
$response = wp_remote_post( $environment_url, array(
'method' => 'POST',
'body' => http_build_query( $payload ),
'timeout' => 90,
'sslverify' => false,
) );
//***********
//when I make a purchase I need to see these values
//************
var_dump($response);
var_dump($response_body);
die()
0
plugin-development, plugins, woocommerce
3 years
2019-12-05T09:51:43-05:00
2019-12-05T09:51:43-05:00 0 Answers
94 views
0
Leave an answer