Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $apiUrl= "http://103.16.138.19:8000/Transactions/trx.xml";
- $username = "tns14110001";
- $password = "1234";
- $key= "k6a4qeer1piwqfc";
- $product_id = "30";
- $trx_date = date("YmdHis");
- // $trx_type = "2200";
- $trx_type = "2100";
- $trx_id ="54000000021";
- $hp = '08567896361';
- $account_no = '0817170820';
- $nominal = 100;
- $signature = md5($username.$password.$product_id.$trx_date.$key);
- $post_data = array(
- 'trx_date' => $trx_date,
- 'trx_type' => $trx_type,
- 'trx_id' => $trx_id,
- 'cust_msisdn' => $hp,
- 'cust_account_no' => $account_no,
- 'product_id' => $product_id,
- 'product_nomination' => $nominal );
- $post_data = http_build_query($post_data,'', '&');
- $curl = curl_init($apiUrl);
- curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($curl, CURLOPT_POST, true);
- curl_setopt($curl, CURLOPT_URL, $apiUrl);
- curl_setopt($curl, CURLOPT_HEADER, 0);
- curl_setopt($curl, CURLOPT_HTTPHEADER, array(
- 'Authorization: '.'PELANGIREST username='.$username.'&password='.$password.'&signature='.$signature
- ));
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
- $response = curl_exec($curl);
- $info = curl_getinfo($curl);
- curl_close($curl);
- var_dump($curl);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement