Things don't appear to be working right now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am receiving the above issue every time I tried to take payments through my website. I have gone through every 'solution' found with in the community and still nothing has remidied the issue my website can't process any payments and I have tried to get in touch with PayPal mts but have had no response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Also this is the Module I'm using.
class PaypalModel extends PaymentDriverModel
{
public $payment_data = array(
'gid' => 'paypal',
'name' => 'Paypal',
'settings_data' => 'a:1:{s:9:"seller_id";s:0:"";}',
'logo' => 'logo_paypal.png',
);
public $settings = array(
"seller_id" => array("type" => "text", "content" => "string", "size" => "middle"),
);
protected $variables = array(
"business" => "seller_id",
"mc_gross" => "amount",
"mc_currency" => "currency",
"custom" => "id_payment",
"test_ipn" => "test_mode",
);
public function funcRequest($payment_data, $system_settings)
{
$return = array("errors" => array(), "info" => array(), "data" => $payment_data);
$send_data = array(
"business" => $system_settings["settings_data"]["seller_id"],
"amount" => $payment_data["amount"],
"currency_code" => $payment_data["currency_gid"],
"charset" => 'utf-8',
"custom" => $payment_data["id_payment"],
"test_ipn" => "0",
"rm" => "2",
"return" => site_url(),
"notify_url" => site_url() . "payments/responce/paypal",
"cancel_return" => site_url(),
"cmd" => "_xclick",
"item_name" => $payment_data["payment_data"]["name"],
);
$this->send_data("https://www.paypal.com/cgi-bin/webscr", $send_data, "post");
return $return;
}
public function funcResponce($payment_data, $system_settings)
{
$return = array("errors" => array(), "info" => array(), "data" => array(), "type" => "exit");
// verify
$verify = $this->verifyData($payment_data);
if (!$verify) {
exit;
}
foreach ($this->variables as $payment_var => $site_var) {
$return["data"][$site_var] = isset($payment_data[$payment_var]) ? $this->ci->input->xss_clean($payment_data[$payment_var]) : "";
}
$this->ci->load->model("Payments_model");
$site_payment_data = $this->ci->Payments_model->get_payment_by_id($return["data"]['id_payment']);
if (floatval($site_payment_data["amount"]) != floatval($return["data"]['amount']) ||
$site_payment_data["currency_gid"] != $return["data"]['currency']) {
$error = true;
}
//// get status
$return["data"]["status"] = 0;
if (isset($payment_data['payment_status'])) {
switch ($payment_data['payment_status']) {
case "Completed": $return["data"]["status"] = 1;
break;
case "Pending": $return["data"]["status"] = 0;
break;
default: $return["data"]["status"] = -1;
break;
}
}
return $return;
}
public function getSettingsMap()
{
foreach ($this->settings as $param_id => $param_data) {
$this->settings[$param_id]["name"] = l('system_field_' . $param_id, 'payments');
}
return $this->settings;
}
private function verifyData($payment_data)
{
$req = 'cmd=_notify-validate';
foreach ($payment_data as $key => $value) {
$req .= '&' . $key . '=' . urlencode(stripslashes($value));
}
$verify_url = 'www.paypal.com';
if (function_exists('curl_init')) {
$ch = curl_init('https://' . $verify_url . '/cgi-bin/webscr');
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));
$res = curl_exec($ch);
curl_close($ch);
} else {
$header = "POST /cgi-bin/webscr HTTP/1.1\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";
$fp = fsockopen('ssl://' . $verify_url, 443, $errno, $errstr, 10);
fputs($fp, $header . $req);
while (!feof($fp)) {
$res = fgets($fp, 1024);
break;
}
}
if (strcmp($res, "VERIFIED") == 0) {
return true;
} elseif (strcmp($res, "INVALID") == 0) {
}
return false;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you guys absolutely sure the code is getting output this like when rendered on a page? What if you just copy this form code to a basic html file and load it directly? Does it work for you then?
PayPal Partner and Certified Developer - Kudos are Greatly Appreciated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- « Previous page
- Next page »
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- IPN works in sandbox but not live in Sandbox Environment
- link my PayPal business account with my WordPress website , but it's not work ?! in PayPal Payments Standard
- Problems with accent characters when calling Paypal API (v2/invoicing/invoices). in REST APIs
- System error for my Paypal button after years of correct working in PayPal Payments Standard
- User is asked for shipping address when creating a credit card order in REST APIs