/// <summary>
        /// Castecne zruseni platby
        /// </summary>
        ///
        /// <param name="paymentSessionId">identifikator platby</param>
        /// <param name="targetGoId">identifikator prijemnce - GoId</param>
        /// <param name="secureKey">kryptovaci klic prideleny GoPay</param>
        ///
        /// <returns>result</returns>
        public static string RefundPaymentPartially(
            long paymentSessionId,
            long amount,
            String currency,
            String description,
            long targetGoId,
            string secureKey)
        {
            try
            {
                // Inicializace providera pro WS
                AxisEPaymentProviderV2Service provider = new AxisEPaymentProviderV2Service(GopayConfig.Ws);
                EPaymentResult paymentResult;

                string encryptedSignature = GopayHelper.Encrypt(
                    GopayHelper.Hash(
                        GopayHelper.ConcatRefundRequest(
                            targetGoId,
                            paymentSessionId,
                            amount,
                            currency,
                            description,
                            secureKey)
                        ), secureKey);

                ERefundRequest eRefundRequest = new ERefundRequest();
                eRefundRequest.targetGoId         = targetGoId;
                eRefundRequest.paymentSessionId   = paymentSessionId;
                eRefundRequest.amount             = amount;
                eRefundRequest.currency           = currency;
                eRefundRequest.description        = description;
                eRefundRequest.encryptedSignature = encryptedSignature;

                paymentResult = provider.refundPayment(eRefundRequest);

                if (paymentResult.result == GopayHelper.CALL_RESULT_FAILED)
                {
                    throw new GopayException("payment not refunded [" + paymentResult.resultDescription + "]");
                }

                return(paymentResult.result);
            }
            catch (Exception ex)
            {
                //
                // Chyba pri komunikaci s WS
                //
                throw new GopayException(ex.ToString());
            }
        }
Beispiel #2
0
        /// <summary>
        /// Castecne zruseni platby
        /// </summary>
        /// 
        /// <param name="paymentSessionId">identifikator platby</param>
        /// <param name="targetGoId">identifikator prijemnce - GoId</param>
        /// <param name="secureKey">kryptovaci klic prideleny GoPay</param>
        ///
        /// <returns>result</returns>
        public static string RefundPaymentPartially(
                    long paymentSessionId,
                    long amount,
                    String currency,
                    String description,
                    long targetGoId,
                    string secureKey)
        {
            try
            {

                // Inicializace providera pro WS
                AxisEPaymentProviderV2Service provider = new AxisEPaymentProviderV2Service(GopayConfig.Ws);
                EPaymentResult paymentResult;

                string encryptedSignature = GopayHelper.Encrypt(
                        GopayHelper.Hash(
                            GopayHelper.ConcatRefundRequest(
                                targetGoId,
                                paymentSessionId,
                                amount,
                                currency,
                                description,
                                secureKey)
                        ), secureKey);

                ERefundRequest eRefundRequest = new ERefundRequest();
                eRefundRequest.targetGoId = targetGoId;
                eRefundRequest.paymentSessionId = paymentSessionId;
                eRefundRequest.amount = amount;
                eRefundRequest.currency = currency;
                eRefundRequest.description = description;
                eRefundRequest.encryptedSignature = encryptedSignature;

                paymentResult = provider.refundPayment(eRefundRequest);

                if (paymentResult.result == GopayHelper.CALL_RESULT_FAILED)
                {
                    throw new GopayException("payment not refunded [" + paymentResult.resultDescription + "]");

                }

                return paymentResult.result;

            }
            catch (Exception ex)
            {
                //
                // Chyba pri komunikaci s WS
                //
                throw new GopayException(ex.ToString());
            }
        }
Beispiel #3
0
 /// <remarks/>
 public void partiallyRefundPaymentAsync(ERefundRequest refundRequest, object userState) {
     if ((this.partiallyRefundPaymentOperationCompleted == null)) {
         this.partiallyRefundPaymentOperationCompleted = new System.Threading.SendOrPostCallback(this.OnpartiallyRefundPaymentOperationCompleted);
     }
     this.InvokeAsync("partiallyRefundPayment", new object[] {
                 refundRequest}, this.partiallyRefundPaymentOperationCompleted, userState);
 }
Beispiel #4
0
 /// <remarks/>
 public void partiallyRefundPaymentAsync(ERefundRequest refundRequest) {
     this.partiallyRefundPaymentAsync(refundRequest, null);
 }
Beispiel #5
0
 /// <remarks/>
 public System.IAsyncResult BeginpartiallyRefundPayment(ERefundRequest refundRequest, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("partiallyRefundPayment", new object[] {
                 refundRequest}, callback, asyncState);
 }
Beispiel #6
0
 public EPaymentResult partiallyRefundPayment(ERefundRequest refundRequest) {
     object[] results = this.Invoke("partiallyRefundPayment", new object[] {
                 refundRequest});
     return ((EPaymentResult)(results[0]));
 }
Beispiel #7
0
 /// <remarks/>
 public void refundPayment1Async(ERefundRequest refundRequest) {
     this.refundPayment1Async(refundRequest, null);
 }