protected PaymentInstrumentBase(IPaymentInstrument payment) { Amount = payment.Amount; VatAmount = payment.VatAmount; RemainingCaptureAmount = payment.RemainingCaptureAmount; RemainingCancellationAmount = payment.RemainingCancellationAmount; RemainingReversalAmount = payment.RemainingReversalAmount; Created = payment.Created; Updated = payment.Updated; Currency = payment.Currency; Description = payment.Description; Id = payment.Id; Instrument = payment.Instrument; Language = payment.Language; Number = payment.Number; Operation = payment.Operation; PayeeInfo = payment.PayeeInfo; PayerReference = payment.PayerReference; InitiatingSystemUserAgent = payment.InitiatingSystemUserAgent; Prices = payment.Prices; State = payment.State; Urls = payment.Urls; UserAgent = payment.UserAgent; Metadata = payment.Metadata; Cancellations = payment.Cancellations; Captures = payment.Captures; Reversals = payment.Reversals; Transactions = payment.Transactions; Intent = payment.Intent; }
/// <summary> /// Sends a request to Globally Paid API to updated a payment instrument, as an asynchronous operation /// </summary> /// <param name="IPaymentInstrument">A <see cref="IPaymentInstrument"/> entity to be updated</param> /// <param name="requestOptions">Used to reconfigure Globally Paid SDK setting for this particular call</param> /// <param name="cancellationToken">The cancellation token to cancel operation</param> /// <returns>A <see cref="IPaymentInstrument"/> Task entity, representing the asynchronous operation</returns> public async Task <IPaymentInstrument> UpdateAsync(IPaymentInstrument paymentInstrument, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) { TryReconfigureClient(paymentInstrument, requestOptions); return(await Client.PutAsync <IPaymentInstrument, IPaymentInstrument>($"{BasePath}/{paymentInstrument.CustomerId}/{paymentInstrument.Id}", paymentInstrument, checkResponseCode : false, cancellationToken)); }
/// <summary> /// Sends a request to Globally Paid API to updated a payment instrument /// </summary> /// <param name="IPaymentInstrument">A <see cref="IPaymentInstrument"/> entity to be updated</param> /// <param name="requestOptions">Used to reconfigure Globally Paid SDK setting for this particular call</param> /// <returns>A <see cref="IPaymentInstrument"/> entity</returns> public IPaymentInstrument Update(IPaymentInstrument paymentInstrument, RequestOptions requestOptions = null) { TryReconfigureClient(paymentInstrument, requestOptions); return(Client.Put <IPaymentInstrument, IPaymentInstrument>($"{BasePath}/{paymentInstrument.CustomerId}/{paymentInstrument.Id}", paymentInstrument)); }