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