fn_get_createpayiniturl

Get the Payment URL from Saferpay (init).

Description

(string) fn_get_createpayiniturl( $gateway, $order, $backlink, $faillink ); 

Returns (string)

(URL)

Parameters (4)

0. $gateway
The gateway.
1. $order
The order.
2. $backlink
The backlink.
3. $faillink
The faillink.

Usage

  1. if ( !function_exists( 'fn_get_createpayiniturl' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-payment-gateway-for-saferpay/fn-saferpay.php'; 
  3.  
  4. // The gateway. 
  5. $gateway = null; 
  6.  
  7. // The order. 
  8. $order = null; 
  9.  
  10. // The backlink. 
  11. $backlink = null; 
  12.  
  13. // The faillink. 
  14. $faillink = null; 
  15.  
  16. // NOTICE! Understand what this does before running. 
  17. $result = fn_get_createpayiniturl($gateway, $order, $backlink, $faillink); 
  18.  

Defined (1)

The function is defined in the following location(s).

/fn-saferpay.php  
  1. function fn_get_createpayiniturl($gateway, $order, $backlink, $faillink) 
  2.  
  3. $description = str_replace("#_ORDERID", $order->id, $gateway->order_description); 
  4. $orderid = $gateway->order_id_prefix . $order->id; 
  5.  
  6. $variables = array ( 
  7.  
  8.  
  9. 'ACCOUNTID' => $gateway->saferpay_accountid,  
  10. 'AMOUNT' => round($order->get_total(), 2) * 100, // Saferpay wants to have cent-values 
  11. 'CURRENCY' => get_woocommerce_currency(),  
  12. 'DESCRIPTION' => urlencode($description),  
  13. 'ORDERID' => $orderid,  
  14. /** 'VTCONFIG' => '', */  
  15. 'SUCCESSLINK' => $gateway->successlink,  
  16. 'FAILLINK' => $faillink,  
  17. 'BACKLINK' => $backlink,  
  18. 'NOTIFYURL' => $gateway->notify_url,  
  19. /** 'AUTOCLOSE' => '0', */ // We do not autoclose at the moment 
  20. 'CCNAME' => 'yes',  
  21. 'DELIVERY' => 'no',  
  22. 'SHOWLANGUAGES' => 'yes',  
  23. 'PAYMENTMETHODS' => $gateway->get_payment_methods(),  
  24. /** 'USERNOTIFY' => trim($gateway->receiver_email) */ 
  25.  
  26. );  
  27.  
  28. return add_query_arg($variables, FN_SAFERPAY_CREATEINITURL);