0
我試圖在我的網站上實施電子商務解決方案莫林,但我正在努力讓貝寶專業網關工作。這不是一個NodeJS SDK,它只是一個Javascript-SDK。我的代碼看起來像這樣。莫爾丁Javascript-SDK不與貝寶專業網關
moltin.Authenticate(function() {
moltin.Cart.Complete({
gateway: 'paypal-pro',
customer: {
first_name: customer["first_name"],
last_name: customer["last_name"],
email: customer["email"]
},
bill_to: {
first_name: billto["first_name"],
last_name: billto["last_name"],
address_1: billto["address_1"],
city: billto["city"],
county: billto["county"],
country: billto["country"],
postcode: billto["postcode"]
},
ship_to: 'bill_to',
shipping: 'standard'
}, function(orders) {
console.log(orders);
moltin.Checkout.Payment('purchase', orders.id, {
data: {
first_name: billto["first_name"],
last_name: billto["last_name"],
number: ccInfo["number"],
expiry_month: ccInfo["month"],
expiry_year: ccInfo["year"],
cvv: ccInfo["cvv"]
}
}, function(success) {
alert("Congratulations, products are on their way!");
}, function(error) {
console.log(error);
});
}, function(error) {
//Error
});
});
代碼運行之後,我成功登錄該訂單意味着車完成了一個對象,但我得到的,看起來像這樣的錯誤:
無法加載資源:服務器迴應狀態爲400(錯誤請求)
對此端點的錯誤請求是: https://api.molt.in/v1/checkout/payment/purchase/1306137221123801951其中最後的數字是訂單的ID。
任何想法爲什麼這不會處理付款?