paypal create product php

Solutions on MaxInterview for paypal create product php by the best coders in the world

showing results for - "paypal create product php"
Jean-Baptiste
13 Apr 2019
1$ch = curl_init();curl_setopt($ch, CURLOPT_URL, 'https://api.sandbox.paypal.com/v1/catalogs/products');
2curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
3curl_setopt($ch, CURLOPT_POSTFIELDS, '{"name": "Test Recurring","type": "SERVICE}');
4curl_setopt($ch, CURLOPT_POST, 1);
5$headers = array();
6$headers[] = 'Content-Type: application/json';
7$headers[] = 'Authorization: '.$accessToken->token_type.' '.$accessToken->access_token.'';
8$headers[] = 'Paypal-Request-Id: <your client id>';
9curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
10$result = curl_exec($ch);
11if (curl_errno($ch)) {
12    echo 'Error:' . curl_error($ch);
13}
14curl_close($ch);
15$createProduct = json_decode($result);