mariusbackes / cordova-plugin-sumup

:pager: :moneybag: Cordova plugin for SumUp SDK integration
5 stars 18 forks source link

Problems with Terminal Payments #43

Open startupspain2017 opened 2 years ago

startupspain2017 commented 2 years ago

Hi!

My name is David. I am trying to develop an App using this plugin for SumUPp terminal payments. Everything is working ok until I pay with my credit card. Here is my code:

this.sumUp.pay(1, 'EUR').then((res: SumUpPayment) => { alert("PAY (OK)"); var data = ""; for(var i=0; i<props.length; i++){ data += props[i] + " --> " + res[props[i]] + "\n"; } alert(data); }) .catch((error: SumUpPayment) => { alert("PAY (ERROR)"); var data = ""; for(var i=0; i<props.length; i++) { data += props[i] + " --> " + error[props[i]] + "\n"; } alert(data); });

My problem is I am getting an error on catch clause when payment is working. I get a SumUpPayment object with SUCCESFULL state and I do not understand why. But, when payment goes wrong, for example (no credit card detected on time), I am not getting any error.

Could you please help me?

Thank you so much.