fn_complete_saferpay_payment

Complete Saferpay payment.

Description

(string) fn_complete_saferpay_payment( $gateway, $id ); 

Returns (string)

- returns the content of the response from Saferpay

Parameters (2)

0. $gateway
The gateway.
1. $id
The id.

Usage

  1. if ( !function_exists( 'fn_complete_saferpay_payment' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-payment-gateway-for-saferpay/fn-saferpay.php'; 
  3.  
  4. // The gateway. 
  5. $gateway = null; 
  6.  
  7. // The id. 
  8. $id = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = fn_complete_saferpay_payment($gateway, $id); 
  12.  

Defined (1)

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

/fn-saferpay.php  
  1. function fn_complete_saferpay_payment($gateway, $id) 
  2. //  
  3. $account = $gateway->get_option('accountid'); 
  4.  
  5. $variables = array ( 
  6. 'ACCOUNTID' => $account,  
  7. 'ID' => $id 
  8. );  
  9.  
  10. // Add the password for the test account 
  11. if($account == FN_SAFERPAY_TESTACCOUNT_ID
  12. $variables['spPassword'] = FN_SAFERPAY_TESTACCOUNT_PW
  13.  
  14. // Build the URL for the verification process 
  15. $url = add_query_arg($variables, FN_SAFERPAY_PAYCOMPLETEV2); 
  16.  
  17. // Return the content of the response 
  18. return fn_get_urlcontent($url); 
  19.