diff --git a/src/paymentwall_gateway.php b/src/paymentwall_gateway.php index 3794402..1efc624 100644 --- a/src/paymentwall_gateway.php +++ b/src/paymentwall_gateway.php @@ -176,7 +176,7 @@ function ipnResponse() if ($this->settings['enable_delivery']) { // Delivery Confirmation $delivery = new Paymentwall_GenerericApiObject('delivery'); - $response = $delivery->post($this->prepareDeliveryConfirmationData($order)); + $response = $delivery->post($this->prepareDeliveryConfirmationData($order, $pingback->getReferenceId())); } $order->add_order_note(__('Paymentwall payment completed', 'woocommerce')); @@ -257,10 +257,10 @@ function prepareUserProfileData($order) ); } - function prepareDeliveryConfirmationData($order) + function prepareDeliveryConfirmationData($order, $ref) { return array( - 'payment_id' => $order->payment_method, + 'payment_id' => $ref, 'type' => 'digital', 'status' => 'delivered', 'estimated_delivery_datetime' => date('Y/m/d H:i:s'),