예제 #1
0
 private static void ValidateResponse(AtomicResponse <DetailedTransaction> response)
 {
     if (response.Errors.Any())
     {
         throw new TransactionResponseHasErrorsException("Transaction response has errors. Check the Errors property");
     }
 }
예제 #2
0
 public static async Task <AtomicResponse <DetailedTransaction> > CancelAsync(this AtomicResponse <DetailedTransaction> response)
 {
     ValidateResponse(response);
     return(await response.Data.CancelAsync());
 }
예제 #3
0
 public static AtomicResponse <DetailedTransaction> Cancel(this AtomicResponse <DetailedTransaction> response)
 {
     ValidateResponse(response);
     return(response.Data.Cancel());
 }
예제 #4
0
 public static async Task <AtomicResponse <DetailedTransaction> > RefundAsync(this AtomicResponse <DetailedTransaction> response, int?amount = null)
 {
     ValidateResponse(response);
     return(await response.Data.RefundAsync(amount));
 }
예제 #5
0
 public static AtomicResponse <DetailedTransaction> Refund(this AtomicResponse <DetailedTransaction> response, int?amount = null)
 {
     ValidateResponse(response);
     return(response.Data.Refund(amount));
 }
예제 #6
0
 public static async Task <AtomicResponse <DetailedSubscription> > CancelAsync(this AtomicResponse <DetailedSubscription> subscription)
 {
     ValidateResponse(subscription);
     return(await subscription.Data.CancelAsync());
 }
예제 #7
0
 public static AtomicResponse <DetailedSubscription> Cancel(this AtomicResponse <DetailedSubscription> subscription)
 {
     ValidateResponse(subscription);
     return(subscription.Data.Cancel());
 }
예제 #8
0
 public static async Task <AtomicResponse <DetailedTransaction> > AuthorizeAsync(this AtomicResponse <DetailedSubscription> subscription, int amount, string orderId)
 {
     ValidateResponse(subscription);
     return(await subscription.Data.AuthorizeAsync(amount, orderId));
 }
예제 #9
0
 public static AtomicResponse <DetailedTransaction> Authorize(this AtomicResponse <DetailedSubscription> subscription, int amount, string orderId)
 {
     ValidateResponse(subscription);
     return(subscription.Data.Authorize(amount, orderId));
 }