· 5 years ago · Sep 07, 2020, 02:00 PM
1function getStripeAccount($email){
2 $endpoint = 'https://api.stripe.com/v1/customers';
3 $args = array(
4 'body' => array('email' => $email),
5 'timeout' => '5',
6 'redirection' => '5',
7 'httpversion' => '1.0',
8 'blocking' => true,
9 'headers' => array(
10 'Authorization' => 'Bearer secret_key',
11 ),
12 'cookies' => array()
13 );
14 $response = wp_remote_get($endpoint,$args);
15
16 return json_decode($response['body']);
17 }