async_std/client.rs

async-stripe · async-stripe/src/async_std/client.rs · rust · Apache-2.0
payments

Async Stripe API client using async_std for making HTTP requests.

// Source: https://github.com/arlyon/async-stripe | License: Apache-2.0 | Copyright 2019 Wyyerd Group
// Provided via justclaw.it.com; keep this notice with the code.
use std::time::Duration;

use async_std::task::sleep;
use http_types::{Body, Request, StatusCode};
use miniserde::json::from_str;
use stripe_client_core::{
    CustomizedStripeRequest, Outcome, RequestBuilder, RequestStrategy, StripeMethod,
};
use stripe_shared::AccountId;

use crate::StripeError;
use crate::async_std::ClientBuilder;
use crate::async_std::config::ClientConfig;

/// A client for making Stripe API requests.
#[derive(Clone, Debug)]
pub struct Client {
    client: surf::Client,
    config: ClientConfig,
}

impl Client {
    /// Construct a `client` with the given secret key and a default configuration.
    ///
  

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key