php - Paypal Script Working, But No Money Transferred -



php - Paypal Script Working, But No Money Transferred -

i have integrated paypal payment gateway in script,

i have tested in paypal sandbox , worked perfectly. made script "paypal live", certainly changed variable named $environment.

it worked without error, problem that, no money got transferred paypal account..

i have checked paypal api's signatures, etc, , tottaly okay that..

but still no money got transferred..

i though may post here help

function paiement_succes() { // obtain token paypal. if(!array_key_exists('token', $_request)) exit('token not received.'); // set request-specific fields. $token = urlencode(htmlspecialchars($_request['token'])); // add together request-specific fields request string. $nvpstr = "&token=$token"; // execute api operation; see pphttppost function above. $httpparsedresponsear = $this->pphttppost('getexpresscheckoutdetails', $nvpstr); if("success" == strtoupper($httpparsedresponsear["ack"]) || "successwithwarning" == strtoupper($httpparsedresponsear["ack"])) { $this->load->model('payment_model'); $this->payment_model->paypal_payment(); $msg = "<label>thank !! payment done</label> <a href='".base_url()."envoie_de_photos/envoyer_vos_photos"."'>go photo uploading</a>"; echo $msg; } else { //exit('getexpresscheckoutdetails failed: ' . print_r($httpparsedresponsear, true)); echo "payment failed unknown reason"; } } function pay_by_paypal() { $environment = 'live'; $_session['item_name']=$this->input->post('item_name'); $_session['amount']=$this->input->post('amount'); $_session['currency_code']=$this->input->post('currency_code'); $_session['no_of_photo']=$this->input->post('no_of_photo'); $qty=urlencode("1"); $product_name=urldecode($_session['item_name']); $price=urlencode($_session['amount']); $currencyid = urlencode($_session['currency_code']); // or other currency code ('gbp', 'eur', 'jpy', 'cad', 'aud') $paymenttype = urlencode('order'); $nvpstr=""; $returnurl = (base_url()."paiement/paiement_succes"); $cancelurl = (base_url()."paiement/paiement_echec"); $i=0; $total_amount=0; $str = "&method=setexpresscheckout &returnurl=$returnurl &cancelurl=$cancelurl &l_paymentrequest_0_name0=$product_name &l_paymentrequest_0_number0=$qty &l_paymentrequest_0_amt0=$price &l_paymentrequest_0_desc0=$product_name &paymentrequest_0_amt=$price &paymentrequest_0_currencycode=$currencyid"; $nvpstr=$nvpstr.$str; $httpparsedresponsear = $this->pphttppost('setexpresscheckout', $nvpstr); if("success" == strtoupper($httpparsedresponsear["ack"]) || "successwithwarning" == strtoupper($httpparsedresponsear["ack"])) { // redirect paypal.com. $token = urldecode($httpparsedresponsear["token"]); $paypalurl = "https://www.paypal.com/webscr&cmd=_express-checkout&token=$token"; if("sandbox" === $environment) { $paypalurl = "https://www.$environment.paypal.com/webscr&cmd=_express-checkout&token=$token"; } header("location: $paypalurl"); exit; } else { exit('setexpresscheckout failed: ' . print_r($httpparsedresponsear, true)); } } /** setexpresscheckout nvp example; lastly modified 08may23. * * initiate express checkout transaction. */ /** * send http post request * * @param string api method name * @param string post message fields in &name=value pair format * @return array parsed http response body */ private function pphttppost($methodname_, $nvpstr_) { //global $environment; $environment = 'live'; // or 'beta-sandbox' or 'live' // set api credentials, paypal end point, , api version. $api_username = urlencode('exmaple_api1.sazet_rey.com'); $api_password = urlencode('bh89hx&*09$%bhy65'); $api_signature = urlencode('sdfr$%$vgbhhyt899999090-9987777'); $api_endpoint = "https://api-3t.paypal.com/nvp"; if("sandbox" === $environment) { $api_endpoint = "https://api-3t.$environment.paypal.com/nvp"; } $version = urlencode('65.0'); // set curl parameters. $ch = curl_init(); curl_setopt($ch, curlopt_url, $api_endpoint); curl_setopt($ch, curlopt_verbose, 1); // turn off server , peer verification (trustmanager concept). curl_setopt($ch, curlopt_ssl_verifypeer, false); curl_setopt($ch, curlopt_ssl_verifyhost, false); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_post, 1); // set api operation, version, , api signature in request. $nvpreq = "method=$methodname_&version=$version&pwd=$api_password&user=$api_username&signature=$api_signature$nvpstr_"; // set request post field curl. curl_setopt($ch, curlopt_postfields, $nvpreq); // response server. $httpresponse = curl_exec($ch); if(!$httpresponse) { exit("$methodname_ failed: ".curl_error($ch).'('.curl_errno($ch).')'); } // extract response details. $httpresponsear = explode("&", $httpresponse); $httpparsedresponsear = array(); foreach ($httpresponsear $i => $value) { $tmpar = explode("=", $value); if(sizeof($tmpar) > 1) { $httpparsedresponsear[$tmpar[0]] = $tmpar[1]; } } if((0 == sizeof($httpparsedresponsear)) || !array_key_exists('ack', $httpparsedresponsear)) { exit("invalid http response post request($nvpreq) $api_endpoint."); } homecoming $httpparsedresponsear; }

i wud appreciate help regarding this, , wud gratefull if happens

checking , create sure not passing on variable called "subject". pass over, cause api phone call effort passed on paypal business relationship pass on in subject. however, if did have permissions , got successful response back, money in business relationship , not 1 api credentials from. if don't have api permissions receive error indicating this. getting kind of response when create api call. if getting back?

php codeigniter paypal paypal-sandbox

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -