Exemplo n.º 1
0
        private PaymentRequest buildPaymentRequest()
        {
            try
            {
                var request = new PaymentRequest
                    {
                        merchantAccount = Globals.Instance.settings["AdyenMerchantAccount"],
                        amount = new Amount {currency = payment.currency, value = payment.amount},
                        reference = payment.paymentRef
                    };
                    if (payment.useSavedDetails)
                    {
                        request.card = new Card {cvc = payment.cvs};
                        request.selectedRecurringDetailReference =
                            new RecurringDetailsEndPoint().getRecurringDetail(payment.shopperRef);
                    }
                    else
                    {
                        request.card = new Card
                            {
                                brand = payment.method.ToLower(),
                                cvc = payment.cvs,
                                expiryMonth = payment.expiryMonth,
                                expiryYear = payment.expiryYear,
                                holderName = payment.holder,
                                number = payment.number
                            };
                    }

                    request.recurring = new Recurring() {contract = "ONECLICK"};
                    request.shopperReference = payment.shopperRef;
                    request.shopperEmail = payment.shopperRef;

                    return request;
                }

            catch
                (Exception exp)
            {
                log.Error(exp);
                throw;
            }
        }
Exemplo n.º 2
0
 /// <remarks/>
 public void refundWithDataAsync(PaymentRequest request, object userState) {
     if ((this.refundWithDataOperationCompleted == null)) {
         this.refundWithDataOperationCompleted = new System.Threading.SendOrPostCallback(this.OnrefundWithDataOperationCompleted);
     }
     this.InvokeAsync("refundWithData", new object[] {
                 request}, this.refundWithDataOperationCompleted, userState);
 }
Exemplo n.º 3
0
 /// <remarks/>
 public void refundWithDataAsync(PaymentRequest request) {
     this.refundWithDataAsync(request, null);
 }
Exemplo n.º 4
0
 /// <remarks/>
 public void checkFraudAsync(PaymentRequest paymentRequest, object userState) {
     if ((this.checkFraudOperationCompleted == null)) {
         this.checkFraudOperationCompleted = new System.Threading.SendOrPostCallback(this.OncheckFraudOperationCompleted);
     }
     this.InvokeAsync("checkFraud", new object[] {
                 paymentRequest}, this.checkFraudOperationCompleted, userState);
 }
Exemplo n.º 5
0
 /// <remarks/>
 public void checkFraudAsync(PaymentRequest paymentRequest) {
     this.checkFraudAsync(paymentRequest, null);
 }
Exemplo n.º 6
0
 /// <remarks/>
 public void authoriseAsync(PaymentRequest paymentRequest, object userState) {
     if ((this.authoriseOperationCompleted == null)) {
         this.authoriseOperationCompleted = new System.Threading.SendOrPostCallback(this.OnauthoriseOperationCompleted);
     }
     this.InvokeAsync("authorise", new object[] {
                 paymentRequest}, this.authoriseOperationCompleted, userState);
 }
Exemplo n.º 7
0
 /// <remarks/>
 public void authoriseAsync(PaymentRequest paymentRequest) {
     this.authoriseAsync(paymentRequest, null);
 }