public function create_plan_paystack(){
$data = array(
"name"=> "Monthly retainer", "interval"=>"monthly", "amount"=>500,'currency'=>'NGN','description'=>'test'
);
$sendjson = array();
$opts = array(
'http'=>array(
'header'=> ["Authorization: Bearer ".$this->config->item('paystack_sk')."rn" ,"Content-Type: application/jsonrn"] ,
'method' => 'GET',
'content' => json_encode($data)// http_build_query($data),
)
);
print_r($opts);
$context = stream_context_create($opts);
$json = file_get_contents("https://api.paystack.co/plan/".'PLN_lp20ulqhzezihrc',false,$context);
$obj = json_decode($json);
print_r($obj);
}
Я хочу опубликовать $data
массив как json .
«https://developers.paystack.co/docs/create-plan» это путь, который они дали .plaese помогите мне.
Использовать curl
Или вы можете использовать любой из них
https://github.com/yabacon/paystack-php
https://github.com/MalikAbiola/paystack-php-lib