Please help me with some sample code. I am battling to get Adyen drop in components to work (seemlessly) in my asp.net .net framework 4.72 ..
I have pretty much followed the php example from github and do exactly the same thing just made it work with c# and asp.net .. https://github.com/adyen-examples/adyen-php-online-payments
I have managed to get a response: Refused and Accepted with my interaction through javascript..
the problem is: once payment has succeeded(or failed) the payment method component stays in a waiting state (donut).. I want to :
- show a message and reset it on fail
- redirect somewhere else on success (I was hoping it was clever enough to redirect to my redirect url by itself.. but I dont know if the drop in can do that ?)
the makepayment javascript looks like this:
its literally from the php sample.
const makePayment = (paymentMethod, config = {}) => {
const paymentsConfig = { ...paymentsDefaultConfig, ...config };
const paymentRequest = { ...paymentsConfig, ...paymentMethod };
updateRequestContainer(paymentRequest);
return httpPost(baseurl + 'payments', paymentRequest)
.then(response => {
//if (response.error) throw 'Payment initiation failed';
updateResponseContainer(response);
//ui stuff so I can see what happened.
if (response.error) {
$("#payment-failed").show();
return;
}
//alert(response.resultCode);
if (response.resultCode == "Authorised") {
document.getElementById('payment-success').style = "display:block"
}
else {
document.getElementById('payment-failed').style = "display:block"
}
return response;
})
.catch(console.error);
};
this never changes once payment has gone to the server and returned in the javascript above.
I cant figure out how to reset the drop in component

Happy to help!
The Adyen Drop-in is able handle this for you. According to the Adyen documentation, you can get this behavior by overriding the
onPaymentCompleted(...)and theonError(...)functions. Note: You must ensure that thereturnUrlis specified in your request, see documentation here.The configuration is used in
Checkout(configuration), you can find a Javascript + .NET integration-example here.I see that your question also contains a reference to the ".NET Framework 4.72". Typically, the (javascript) code above should be part of your frontend (client-side). The client should then send your request to your backend (server-side/ASP .NET Core usually, which holds your secrets such as your
ADYEN_API_KEYandADYEN_MERCHANT_ACCOUNT), which then forwards that request to the Adyen servers. I've included a diagram below for illustration purposes:Hope this helped you move forward with your integration :)