/// <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()); } }
/// <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()); } }
/// <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); }
/// <remarks/> public void partiallyRefundPaymentAsync(ERefundRequest refundRequest) { this.partiallyRefundPaymentAsync(refundRequest, null); }
/// <remarks/> public System.IAsyncResult BeginpartiallyRefundPayment(ERefundRequest refundRequest, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("partiallyRefundPayment", new object[] { refundRequest}, callback, asyncState); }
public EPaymentResult partiallyRefundPayment(ERefundRequest refundRequest) { object[] results = this.Invoke("partiallyRefundPayment", new object[] { refundRequest}); return ((EPaymentResult)(results[0])); }
/// <remarks/> public void refundPayment1Async(ERefundRequest refundRequest) { this.refundPayment1Async(refundRequest, null); }