Note that there are some explanatory texts on larger screens.

plurals
  1. POPaypal Script Working, But No Money Transferred
    primarykey
    data
    text
    <p>i have integrated paypal payment gateway in my script,</p> <p>i have tested it in paypal sandbox and it worked perfectly. Then i made the script for "paypal live", surely just changed the variable named $environment.</p> <p>It worked completely without any error, but the problem is that, no money got transferred to the paypal account..</p> <p>i have checked the paypal api's signatures, etc, and its tottaly okay with that..</p> <p>but still no money got transferred..</p> <p>i though i may post it here for some help</p> <pre><code>function paiement_succes() { // Obtain the token from PayPal. if(!array_key_exists('token', $_REQUEST)) exit('Token is not received.'); // Set request-specific fields. $token = urlencode(htmlspecialchars($_REQUEST['token'])); // Add request-specific fields to the request string. $nvpStr = "&amp;TOKEN=$token"; // Execute the API operation; see the PPHttpPost function above. $httpParsedResponseAr = $this-&gt;PPHttpPost('GetExpressCheckoutDetails', $nvpStr); if("SUCCESS" == strtoupper($httpParsedResponseAr["ACK"]) || "SUCCESSWITHWARNING" == strtoupper($httpParsedResponseAr["ACK"])) { $this-&gt;load-&gt;model('payment_model'); $this-&gt;payment_model-&gt;paypal_payment(); $msg = "&lt;label&gt;Thank you !! your payment is successfully done&lt;/label&gt; &lt;a href='".base_url()."envoie_de_photos/envoyer_vos_photos"."'&gt;Go To Photo Uploading&lt;/a&gt;"; echo $msg; } else { //exit('GetExpressCheckoutDetails failed: ' . print_r($httpParsedResponseAr, true)); echo "Payment failed for unknown reason"; } } function pay_by_paypal() { $environment = 'live'; $_SESSION['item_name']=$this-&gt;input-&gt;post('item_name'); $_SESSION['amount']=$this-&gt;input-&gt;post('amount'); $_SESSION['currency_code']=$this-&gt;input-&gt;post('currency_code'); $_SESSION['no_of_photo']=$this-&gt;input-&gt;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 = "&amp;METHOD=SetExpressCheckout &amp;RETURNURL=$returnURL &amp;CANCELURL=$cancelURL &amp;L_PAYMENTREQUEST_0_NAME0=$product_name &amp;L_PAYMENTREQUEST_0_NUMBER0=$qty &amp;L_PAYMENTREQUEST_0_AMT0=$price &amp;L_PAYMENTREQUEST_0_DESC0=$product_name &amp;PAYMENTREQUEST_0_AMT=$price &amp;PAYMENTREQUEST_0_CURRENCYCODE=$currencyID"; $nvpStr=$nvpStr.$str; $httpParsedResponseAr = $this-&gt;PPHttpPost('SetExpressCheckout', $nvpStr); if("SUCCESS" == strtoupper($httpParsedResponseAr["ACK"]) || "SUCCESSWITHWARNING" == strtoupper($httpParsedResponseAr["ACK"])) { // Redirect to paypal.com. $token = urldecode($httpParsedResponseAr["TOKEN"]); $payPalURL = "https://www.paypal.com/webscr&amp;cmd=_express-checkout&amp;token=$token"; if("sandbox" === $environment) { $payPalURL = "https://www.$environment.paypal.com/webscr&amp;cmd=_express-checkout&amp;token=$token"; } header("Location: $payPalURL"); exit; } else { exit('SetExpressCheckout failed: ' . print_r($httpParsedResponseAr, true)); } } /** SetExpressCheckout NVP example; last modified 08MAY23. * * Initiate an Express Checkout transaction. */ /** * Send HTTP POST Request * * @param string The API method name * @param string The POST Message fields in &amp;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 up your API credentials, PayPal end point, and API version. $API_UserName = urlencode('exmaple_api1.sazet_rey.com'); $API_Password = urlencode('BH89Hx&amp;*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 the curl parameters. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $API_Endpoint); curl_setopt($ch, CURLOPT_VERBOSE, 1); // Turn off the server and 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 the API operation, version, and API signature in the request. $nvpreq = "METHOD=$methodName_&amp;VERSION=$version&amp;PWD=$API_Password&amp;USER=$API_UserName&amp;SIGNATURE=$API_Signature$nvpStr_"; // Set the request as a POST FIELD for curl. curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq); // Get response from the server. $httpResponse = curl_exec($ch); if(!$httpResponse) { exit("$methodName_ failed: ".curl_error($ch).'('.curl_errno($ch).')'); } // Extract the response details. $httpResponseAr = explode("&amp;", $httpResponse); $httpParsedResponseAr = array(); foreach ($httpResponseAr as $i =&gt; $value) { $tmpAr = explode("=", $value); if(sizeof($tmpAr) &gt; 1) { $httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1]; } } if((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) { exit("Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint."); } return $httpParsedResponseAr; } </code></pre> <p>i wud appreciate some help regarding this, and i wud be gratefull if anything happens</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload