Beispiel #1
0
        public string paymentResult(AdyenResult adyenResult)
        {
            try
            {
                //here we map the fields
                var paymentNotice = new PaymentNotice
                {
                    success       = true,
                    paymentRef    = adyenResult.merchantReference,
                    type          = (adyenResult.authResult == "A") ? "AUTHORISATION" : "REFUSED",
                    transactionId = adyenResult.pspReference
                };


                //then we create thepayment notice
                CreatePaymentNotice.save(paymentNotice);

                //then we result a payment status
                result.PaymentStatus = new PaymentStatus
                {
                    paymentRef = adyenResult.merchantReference,
                    success    = (adyenResult.authResult == "A"),
                };



                if (result.PaymentStatus.success)
                {
                    //pay.paymentRef, pay.amount, pay.currency, pay.shopperEmail, pay.accountHolderName
                    var paramPayment = new Payment {
                        paymentRef = adyenResult.merchantReference
                    };
                    result.Payment = orm.execObject <Result>(paramPayment, "api.user_payment_get").Payment;

                    result.Payment.sendReceiptEmail();
                }
            }
            catch (Exception exp)
            {
                errorResult(exp);
            }
            return(formattedResult(result));
        }
        public string paymentResult(AdyenResult adyenResult)
        {
            try
            {
                //here we map the fields
                var paymentNotice = new PaymentNotice
                    {
                        success = true,
                        paymentRef = adyenResult.merchantReference,
                        type = (adyenResult.authResult == "A") ? "AUTHORISATION" : "REFUSED",
                        transactionId = adyenResult.pspReference
                    };

                //then we create thepayment notice
                CreatePaymentNotice.save(paymentNotice);

                //then we result a payment status
                result.PaymentStatus = new PaymentStatus
                    {
                        paymentRef = adyenResult.merchantReference,
                        success = (adyenResult.authResult == "A"),

                    };

                if (result.PaymentStatus.success)
                {

                   //pay.paymentRef, pay.amount, pay.currency, pay.shopperEmail, pay.accountHolderName
                    var paramPayment = new Payment { paymentRef = adyenResult.merchantReference };
                    result.Payment = orm.execObject<Result>(paramPayment, "api.user_payment_get").Payment;

                    result.Payment.sendReceiptEmail();
                }
             }
            catch (Exception exp)
            {
                errorResult(exp);
            }
            return formattedResult(result);
        }