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, $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. Only used for one-time payments.
Eksempel:
function generate_reference($reference, $feed, $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_return_url
Redirect the user to a different URL than the default page with the spinner that checks the entry status and redirection 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, $form, $entry) {
return 'Min tittel';
});
add_filter('gform_vipps_transaction_text', 'get_transaction_text');
gform_vipps_confirmation_url
Replace the confirmation URL retrived from the form the configured confirmation page/URL.
gform_vipps_merchant_agreement_url
Overwrite the feed settings field for the Merchant Agreement URL (subscriptions only)
gform_vipps_subscription_name
Set the payment agreement name