/**
  * Create Redirect response to complete cart.
  *
  * @param int $id
  * @param \Userdesk\Subscription\Contracts\Product $product
  * @param \Userdesk\Subscription\Contracts\Consumer $consumer
  * @return \Illuminate\Http\Response|null
  */
 public function complete(int $id, SubscriptionProductContract $product, SubscriptionConsumerContract $consumer)
 {
     $params = ['mode' => '2CO', 'sid' => array_get($this->config, 'sid'), 'li_0_type' => 'product', 'li_0_name' => $product->getTitle(), 'li_0__description' => $product->getDescription(), 'li_0_price' => $product->getPrice(), 'li_0_recurrence' => $product->getFrequency() == 'month' ? '1 Month' : ($product->getFrequency() == 'year' ? '1 Year' : ''), 'li_0_duration' => $product->getFrequency() == 'year' || $product->getFrequency() == 'month' ? 'Forever' : '', 'li_0_tangible' => 'N', 'li_0_quantity' => '1', 'merchant_order_id' => $id, 'card_holder_name' => $consumer->getName(), 'street_address' => $consumer->getAddress(), 'street_address2' => '', 'city' => $consumer->getCity(), 'state' => $consumer->getState(), 'zip' => $consumer->getZip(), 'country' => $consumer->getCountry(), 'email' => $consumer->getEmail(), 'phone' => $consumer->getPhone(), 'purchase_step' => 'payment-method', 'x_receipt_link_url' => $product->getReturnUrl(), 'ipn_url' => $product->getIpnUrl(), 'submit' => 'Checkout'];
     if ($product->getDiscount() > 0) {
         $params = array_merge($params, ['li_0_startup_fee' => $product->getDiscount()]);
     }
     $url = sprintf('https://www.2checkout.com/checkout/purchase?%s', http_build_query($params));
     return redirect()->away($url);
 }