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;
            }
        }
Example #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);
 }
Example #3
0
 /// <remarks/>
 public void refundWithDataAsync(PaymentRequest request) {
     this.refundWithDataAsync(request, null);
 }
Example #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);
 }
Example #5
0
 /// <remarks/>
 public void checkFraudAsync(PaymentRequest paymentRequest) {
     this.checkFraudAsync(paymentRequest, null);
 }
Example #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);
 }
Example #7
0
 /// <remarks/>
 public void authoriseAsync(PaymentRequest paymentRequest) {
     this.authoriseAsync(paymentRequest, null);
 }