Skip to content

Instantly share code, notes, and snippets.

@hedqvist
Created March 10, 2020 18:29
Show Gist options
  • Select an option

  • Save hedqvist/2121b48c0848ed5a6cc7017fec1a424b to your computer and use it in GitHub Desktop.

Select an option

Save hedqvist/2121b48c0848ed5a6cc7017fec1a424b to your computer and use it in GitHub Desktop.
Swish - Change paymentreference
<?php
/**
* @snippet WooCommerce - Change Reference
* @author Redlight Media AB / Christopher Hedqvist
* @compatible WooCommerce 3.9.0
*/
function redlight_swish_custom_reference( $data, $order ) {
$ref = $data['payeePaymentReference'];
$data['payeePaymentReference'] = 'swish-'.$ref;
return $data;
}
add_filter('redlight_swish_ecommerce_paymentrequest_data', 'redlight_swish_custom_reference', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment