我想打折扣申请我写的购物车。我正在使用Adaptive API系统,但我似乎搞错了。我已经在SetPaymentOptions电话里试过了:
'receiverOptions' => [
{
'receiver' => {
'email' => 'foo@live.co.uk'
},
'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' )
}
};..and甚至在最初的Pay电话中尝试过,但似乎都没有意识到折扣(并加以应用)。
'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' => 'foo@live.co.uk',
'amount' => '53.00',
'invoiceId' => '47',
'paymentType' => 'GOODS'
}
]
}
};更新: Mmm 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奇怪的是.折扣是.只是没露出来?
发布于 2014-11-08 16:09:19
我很好奇你在哪里看到这些调用中甚至有一个“折扣”参数。?它没有在给付或SetPaymentOptions的API引用中列出。
您需要做的是在SetPaymentOptions中将折扣作为一行项目添加负值。因此,这将是一个额外的一行项目,以-0.15为值。您可以将项目命名为“折扣”或任何您想要的名称,但同样,这些API中没有实际的折扣参数。
https://stackoverflow.com/questions/26817580
复制相似问题