Hello, There is a method in the Cart component of ...
# suitecommerce
v
Hello, There is a method in the Cart component of Extensibility API to add payments to the order, example:
Copy code
var cart = container.getComponent("Cart");
cart.addPayment({
	payment_method: {
		internalid: 3
	}
});
But is there no way we can remove payments? I couldn't find any such method in the documentation: https://system.netsuite.com/help/helpcenter/en_US/APIs/SuiteCommerce/Extensibility/Frontend/Cart.html Same for the events: I could find beforeAddPayment and afterAddPayment, but not beforeRemovePayment and afterRemovePayment (We're trying to add/remove Gift Certificates using Extensibility API.) Using SC 2020.2.7 and SCEM 2020.2.4
Also, it is not working for us when we try to add a gift certificate as a payment to the cart this way:
Copy code
Cart.addPayment({
	type: "giftcertificate",
	giftcertificate: {
		code: "ABCDEF123"
	}
});
Is there something wrong with the PaymentMethod object?
My bad, I was sending the object in an incorrect format. This is the right way to do it:
Copy code
Card.addPayment({
	payment_method: {
		type: "giftcertificate",
		giftcertificate: {
			code: "ABCD123
		}
	}
});
Still cannot find a way to remove gift certificates via Extensibility API though. It will be great if someone can help.
Even if we wanted to remove a card that was added via addPayment(), I think is not possible via Extensiblity API.
Any idea if there's a way to remove payment (cards, gift certificates) via Extensibility API? Just like we have addPayment() to add payments?