Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions includes/class-wc-gateway-paystack.php
Original file line number Diff line number Diff line change
Expand Up @@ -1621,9 +1621,9 @@ public function get_custom_fields( $order_id ) {
/**
* Process a refund request from the Order details screen.
*
* @param int $order_id WC Order ID.
* @param null $amount WC Order Amount.
* @param string $reason Refund Reason
* @param int $order_id WC Order ID.
* @param float|null $amount Refund Amount.
* @param string $reason Refund Reason
*
* @return bool|WP_Error
*/
Expand Down Expand Up @@ -1658,8 +1658,17 @@ public function process_refund( $order_id, $amount = null, $reason = '' ) {
'merchant_note' => $merchant_note,
);

$args['body'] = $body;
$refund_url = 'https://api.paystack.co/refund';
$headers = array(
'Authorization' => 'Bearer ' . $this->secret_key,
);

$args = array(
'headers' => $headers,
'timeout' => 60,
'body' => $body,
);

$refund_url = 'https://api.paystack.co/refund';

$refund_request = wp_remote_post( $refund_url, $args );

Expand Down