0
我试图让折扣适用于我写的购物车。我正在使用Adaptive API
系统,但似乎无法正确完成。我已经试过在SetPaymentOptions电话:PayPal API - 折扣?
'receiverOptions' => [
{
'receiver' => {
'email' => '[email protected]'
},
'invoiceData' => {
'totalShipping' => '8.00',
'totalTax' => 0,
'item' => [
{
'itemPrice' => '15.00',
'name' => 'Alice in Wonderland Mechanism Necklace',
'price' => '15',
'itemCount' => 1
},
{
'itemPrice' => '30.00',
'name' => '110 Year Old Unicorn Dial Necklace',
'price' => '30',
'itemCount' => 1
}
],
'discount' => '0.15'
}
}
],
'requestEnvelope' => {
'errorLanguage' => 'en_US',
'detailLevel' => 'ReturnAll'
},
'payKey' => 'AP-2F6415163M814733M',
'SenderOptions' => {
'requireShippingAddressSelection' => bless(do{\(my $o = 1)}, 'JSON::XS::Boolean')
}
};
..和甚至尝试过在初始收费电话 - 但也似乎认识到优惠(并应用)。
'currencyCode' => 'GBP',
'requestEnvelope' => {
'errorLanguage' => 'en_US',
'detailLevel' => 'ReturnAll'
},
'cancelUrl' => 'https://sitedev.net/',
'discount' => '0.15',
'actionType' => 'CREATE',
'ipnNotificationUrl' => 'https://sitedev.net/cgi-bin/ipn.cgi',
'returnUrl' => 'https://sitedev.net/myorders',
'reverseAllParallelPaymentsOnError' => bless(do{\(my $o = 0)}, 'JSON::XS::Boolean'),
'receiverList' => {
'receiver' => [
{
'email' => '[email protected]',
'amount' => '53.00',
'invoiceId' => '47',
'paymentType' => 'GOODS'
}
]
}
};
UPDATE:嗯OK - 这个仍然有问题!
'item' => [
{
'itemPrice' => '25.00',
'name' => 'Cryptex - 16Gb USB Drive',
'price' => '25',
'itemCount' => 1
},
{
'name' => 'Special Discount',
'price' => '-2.50',
'itemCount' => 1
},
{
'itemPrice' => '5.00',
'name' => 'Shipping',
'price' => '5.00',
'itemCount' => 1
}
]
这就是价值观,我传递,但在车结束,它显示为:
Steampunk Junkies £27.50
Cryptex - 16Gb USB Drive
£25.00
Shipping
£5.00
£0.00
怪异的事情 - 是正在应用的折扣......只是不显示???
啊,这是一个好主意 - 不知道为什么我没有想到这一点:)我看到在另一个API中的折扣参数(你通过一个URL传递给“标准”支付)。 ..但只是假定它也可以在JSON中工作。他们的API文档对于自适应的东西有些蹩脚:(现在就放弃它,然后如果它能够正常工作,那么它就会投票)= – 2014-11-08 16:16:29
嗯,没有用 - 当你尝试使用负数时出错:'错误:请求参数无效:itemPrice在/var/home/user/site.net/cgi-bin/admin/Want/Cart.pm 437行不能为负数。' – 2014-11-08 16:18:46
啊,我的错误 - 它不喜欢'itemPrice'被定义......如果我只是使用'price'参数,那么它工作正常。谢谢! – 2014-11-08 16:23:30