Athral

Vipps MobilePay for Gravity Forms Filters

gform_vipps_environment

Specifies which Vipps MobilePay environment that is to be used.

Accepted values:

live, test

Example:

add_filter('gform_vipps_environment', function($environment) {
  return 'test';
});

gform_vipps_customer_phone

Offers you the possiblity to manipulate the phone number that gets filled in at checkout. Unless overridden by the filter, country codes for Norway, Denmark and Finland are handled, if none is specified then the default country code in the plugin settings is used.

Example:

function handle_phone($phone, $feed, $submission_data, $form, $entry) {
  return $phone;
});
add_filter('gform_vipps_customer_phone', 'handle_phone');

gform_vipps_reference

The payment reference is by default set using the merge tags specified in the plugin settings, but this filter allowed you to for examplee have the reference to be a random string.

Eksempel:

function generate_reference($reference, $feed, $submission_data, $form, $entry) {
  $reference = uniqid();
  return $reference;
});

add_filter('gform_vipps_reference', 'generate_reference');

gform_vipps_cancel_url

Set the cancel URL programatically and override the value in the form settings.

Eksempel:

function set_cancel_url($cancel_url) {
  return 'https://athral.com';
});

add_filter('gform_vipps_cancel_url', 'set_cancel_url');

gform_vipps_transaction_text

Set the transaction text (shown in the user’s app) to something other than the form title.

Eksempel:

function get_transaction_text($transaction_text, $feed, $submission_data, $form, $entry) {
  return 'Min tittel';
});

add_filter('gform_vipps_transaction_text', 'get_transaction_text');