private function renderPaymentLink($array = []) { $order = $array; $transaction_details = array('order_id' => Order::max('order_id') + 1, 'gross_amount' => $order['total']); $i = 0; foreach ($order['product'] as $product) { $items_details = [$i => ['id' => $product['id'], 'price' => $product['product_price'], 'quantity' => $product['product_qty'], 'name' => $product['product_name']]]; $i++; } $shipping_fee = ['id' => 'shipping', 'price' => $order['shipping']['fee'], 'quantity' => '1', 'name' => $order['shipping']['service']]; array_push($items_details, $shipping_fee); // Optional $billing_address = array('first_name' => $order['user']['first_name'], 'last_name' => $order['user']['last_name'], 'address' => $order['user']['address'], 'city' => getCity($order['user']['city']), 'postal_code' => "55281", 'phone' => $order['user']['mob_phone'], 'country_code' => 'IDN'); // Optional $customer_details = array('first_name' => $order['user']['first_name'], 'last_name' => $order['user']['last_name'], 'email' => $order['user']['email'], 'phone' => $order['user']['mob_phone'], 'billing_address' => $billing_address, 'shipping_address' => $billing_address); // Fill transaction details $transaction = array('payment_type' => 'vtweb', "vtweb" => array("enabled_payments" => getPayment(), "credit_card_3d_secure" => true, "finish_redirect_url" => url('checkout/complete'), "unfinish_redirect_url" => url('checkout/uncomplete'), "error_redirect_url" => url('checkout/error')), 'transaction_details' => $transaction_details, 'customer_details' => $customer_details, 'item_details' => $items_details); $vtweb_url = Veritrans_VtWeb::getRedirectionUrl($transaction); return $vtweb_url; }