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