コード例 #1
0
        /// <summary>
        /// Submits a payment
        /// </summary>
        /// <param name="client">A RippleRestClient used for this request.</param>
        /// <param name="payment">Payment object</param>
        /// <returns>Original Payment object with Client Resource Id filled</returns>
        /// <exception cref="RippleRestException">Request failed.</exception>
        public Payment SubmitPayment(RippleRestClient client, Payment payment)
        {
            payment.ClientResourceId = client.GenerateUUID();
            payment.SourceAccount = this.Address;
            var data = new SubmitPaymentRequest
            {
                Payment = payment,
                Secret = this.Secret,
                ClientResourceId = payment.ClientResourceId
            };

            var result = client.RestClient.Execute<SubmitPaymentResponse>(client.CreatePostRequest(data, "v1/payments", Address));
            client.HandleRestResponseErrors(result);
            payment.ClientResourceId = result.Data.ClientResourceId;
            return payment;
        }
コード例 #2
0
 /// <summary>
 /// Submits a payment
 /// </summary>
 /// <param name="payment">Payment object</param>
 /// <returns>Original Payment object with Client Resource Id filled</returns>
 /// <exception cref="RippleRestException">Request failed.</exception>
 public Payment SubmitPayment(Payment payment)
 {
     return SubmitPayment(RippleRestClient.GetDefaultInstanceOrThrow(), payment);
 }