php - delivery format for sagepay basket -
sage pay throwing error basket. if take delivery part off works want delivery on.
// ordering shopping basket // $thisbasket = count( $items ); foreach( $items $item ) { preg_match( "#^\[([^\]]+)\]\[([^\]]+)\]\[([^\]]+)\]$#is", $item, $match ); $thisbasket .= ':' . $match[2]; // item name ( - attribute/options ) $thisbasket .= ':' . $match[1]; // quantity $thisbasket .= ':' . self::$cp . ( $match[3] / $match[1] ); //item value $thisbasket .= ':' . self::$cp . global_data::get_vat( $match[3] / $match[1], true ); // item tax $thisbasket .= ':' . self::$cp . global_data::get_vat( $match[3] / $match[1] ); // // item total $thisbasket .= ':' . self::$cp . global_data::get_vat( $match[3] ); // // line total } $thisbasket .= ':delivery:1:' . self::$cp . '4.99:---:' . self::$cp . '4.99:' . self::$cp . '4.99';
i have no idea how delivery structured , cannot find documentation. regards phil
from vsp direct documentation (formatted appropriately):
item quantity item value item tax item total line total sound system 1 424.68 74.32 499.00 499.00 donnie darko 3 11.91 2.08 13.99 41.97 finding nemo 2 11.05 1.94 12.99 25.98 delivery --- --- --- --- 4.99
would represented thus:
4:pioneer nsdv99 dvd-surround sound system:1:424.68:74.32:499.00: 499.00:donnie darko director’s cut:3:11.91:2.08:13.99:41.97: finding nemo:2:11.05:1.94:12.99:25.98:delivery:---:---:---:---:4.99
so looks need include total of delivery, ---
appropriate complete blank fields. not sure self::$cp
in code, if have total, use that.
Comments
Post a Comment