sagepay 篮子的交付格式
sage pay 抛出了关于我的篮子的错误。如果我把送货部分取下来,那么它就可以工作,但我想要送货。
// Ordering Shopping Basket
//
$ThisBasket = count( $items );
foreach( $items as $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';
我不知道交付是如何构成的,也找不到任何文档。问候菲尔
sage pay is throwing an error about my basket. if i take the delivery part off then it works but i want delivery on.
// Ordering Shopping Basket
//
$ThisBasket = count( $items );
foreach( $items as $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 the delivery is structured and cannot find any documentation. regards phil
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自 VSP Direct 文档(格式适当):
将表示为:
4:Pioneer NSDV99 DVD 环绕声系统:1:424.68:74.32:499.00:499.00:Donnie Darko 导演剪辑:3:11.91:2.08:13.99 :41.97: 寻找尼莫:2:11.05:1.94:12.99:25.98:Delivery:---:---:---:---:4.99
所以看起来你只需要包括总数交货时,根据需要使用
---
来填写空白字段。不确定您的代码中的self::$cp
是什么,但如果您有总数,请使用它。From the VSP Direct documentation (formatted appropriately):
Would be 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 it looks like you just need to include the total of the delivery, with
---
as appropriate to complete the blank fields. Not sure whatself::$cp
is in your code, but if you have the total, just use that.