Jump to content

Search the Community

Showing results for tags 'paypal'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

  1. I'm developing website for online shopping in which i have integrate paypal as payment method. but, i want each transaction must be confirmed by merchant so that merchant can accept or reject(decline-deny) each transaction. payments for the rejected transaction will be refunded to payer. and accepted transaction will we processed as confirmed order. is their any way to do this ? please help me on this. thanks in advance
  2. I am using a web video script that has Paypal integrated. Upon attempting a live transaction to test, the process proceeds to Paypal, shows the transaction amount and returns to the web site successfully, however, no amount is added to the website and no amount is deducted from the paypal user account. I see no errors at paypal or on the website. After communicating with Paypal Merchant Support they said: "You do need to work with your developer and request them to find out why the capture request would not be invoked after the order is created and approved and fix it accordingly". However, the developer is unavailable, so I am attempting to find/fix the issue. Can you tell me if you see anything that might cause an issue with the code below? Or any clues I might look into? I look forward to any suggestions. <?php if (IS_LOGGED == false && $first != 'success_fortumo' && $first != 'success_aamarpay' && $first != 'cashfree_paid' && $first != 'iyzipay_paid' && $first != 'success_yoomoney') { $data = array( 'status' => 400, 'error' => 'Not logged in' ); echo json_encode($data); exit(); } require 'assets/includes/paypal_config.php'; $payment_currency = $pt->config->payment_currency; $paypal_currency = $pt->config->paypal_currency; if ($first == 'replenish') { $data = array('status' => 400); $request = (!empty($_POST['amount']) && is_numeric($_POST['amount'])); if ($request === true) { $price = PT_Secure($_POST['amount']); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url . '/v2/checkout/orders'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, '{ "intent": "CAPTURE", "purchase_units": [ { "items": [ { "name": "Wallet Replenishment", "description": "Pay For ' . $pt->config->name.'", "quantity": "1", "unit_amount": { "currency_code": "'.$pt->config->paypal_currency.'", "value": "'.$price.'" } } ], "amount": { "currency_code": "'.$pt->config->paypal_currency.'", "value": "'.$price.'", "breakdown": { "item_total": { "currency_code": "'.$pt->config->paypal_currency.'", "value": "'.$price.'" } } } } ], "application_context":{ "shipping_preference":"NO_SHIPPING", "return_url": "'.PT_Link("aj/wallet/get_paid?status=success&amount=").$price.'", "cancel_url": "'.PT_Link("aj/wallet/get_paid?status=false").'" } }'); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$pt->paypal_access_token; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); if (curl_errno($ch)) { echo 'Error:' . curl_error($ch); } curl_close($ch); $result = json_decode($result); if (!empty($result) && !empty($result->links) && !empty($result->links[1]) && !empty($result->links[1]->href)) { $data = array( 'status' => 200, 'type' => 'SUCCESS', 'url' => $result->links[1]->href ); } elseif(!empty($result->message)){ $data = array( 'type' => 'ERROR', 'details' => $result->message ); } echo json_encode($data); exit(); } } if ($first == 'get_paid') { $data['status'] = 500; if (!empty($_GET['amount']) && is_numeric($_GET['amount']) && !empty($_GET['token'])) { $amount = (int)PT_Secure($_GET['amount']); $token = PT_Secure($_GET['token']); include_once('assets/includes/paypal.php'); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url . '/v2/checkout/orders/'.$token.'/capture'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer '.$pt->paypal_access_token; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); if (curl_errno($ch)) { header("Location: " . PT_Link('wallet')); exit(); } curl_close($ch); if (!empty($result)) { $result = json_decode($result); if (!empty($result->status) && $result->status == 'COMPLETED') { $update = array('wallet' => ($user->wallet_or += $amount)); $db->where('id',$user->id)->update(T_USERS,$update); $payment_data = array( 'user_id' => $user->id, 'paid_id' => $user->id, 'admin_com' => 0, 'currency' => $pt->config->paypal_currency, 'time' => time(), 'amount' => $amount, 'type' => 'ad' ); $db->insert(T_VIDEOS_TRSNS,$payment_data); $_SESSION['upgraded'] = true; $url = PT_Link('wallet'); if (!empty($_COOKIE['redirect_page'])) { $redirect_page = preg_replace('/on[^<>=]+=[^<>]*/m', '', $_COOKIE['redirect_page']); $url = preg_replace('/\((.*?)\)/m', '', $redirect_page); } header("Location: $url"); exit(); } } } header("Location: " . PT_Link('wallet')); exit(); } ...
  3. We have a small Wordpress based site and we're using the WP E-commerce plugin to sell digital downloads. Everything is working, except the PayPal IPN function so when the customer pays he never receives the download e-mail until we change the transaction's status manually. Unfortunately it's not an option here because it's a digital download store so we have to fix the IPN somehow. My PHP knowledge is almost zero, so i'm here to ask some help from you guys. Store URL: http://brainwaveentrainment.eu WordPress version: 3.6.1 WP e-Commerce version: 3.8.12.1 Theme: Xyloto by Storefrontthemes I did this: Enabled IPN in Paypal with the store URL (http://brainwaveentrainment.eu) Enabled IPN in the PayPal Standard module. Send shipping details: No, Allow owerride: No. Currently i'm testing with a Sandbox account but it's not working with a live account either. I set up paypal to accept payments automatically also. I expected WP e-Commerce to do this: Modify the "Incomplete sale" status to "Accepted payment" Instead it did this: It's not changing the orders' status. It's pretty annoying. I tried everything, changed every setting, currency, IPN URL, etc but nothing helps. We want to start the store but we can't until it's not working. We purchased this theme and it's only working with this shopping cart so i can't just simply switch to a different e-commerce plugin. One IPN log from paypal: Notification URL http://brainwaveentrainment.eu/?wpsc...aypal_standard HTTP response code What's this? 200 Delivery status Sent No. of retries 0 Transaction ID 7W214573HJ105310Y IPN type Transaction made mc_gross=7.00&invoice=4151379432588&protection_eligibility=Eligible&address_status=confirmed&item_number1=531&tax=0.00&item_number2=568&payer_id=LYXHGVEQ4ASFN&address_street=1 Main St&payment_date=08:42:47 Sep 17, 2013 PDT&payment_status=Completed&charset=windows-1252&address_zip=95131&mc_shipping=0.00&mc_handling=0.00&first_name=Ferenc&mc_fee=0.50&address_country_code=US&address_name=Ferenc Szepesi's Test Store&notify_version=3.7&custom=&payer_status=verified&business=beatofficial@gmail.com&address_country=United States&num_cart_items=2&mc_handling1=0.00&mc_handling2=0.00&address_city=San Jose&verify_sign=AiPC9BjkCyDFQXbSkoZcgqH3hpacA.v.7UClmMzrTiiKgIJVSBufA1UT&payer_email=ferenc@szepesiweb.com&mc_shipping1=0.00&mc_shipping2=0.00&tax1=0.00&tax2=0.00&txn_id=7W214573HJ105310Y&payment_type=instant&payer_business_name=Ferenc Szepesi's Test Store&last_name=Szepesi&address_state=CA&item_name1=Gamma Energizer (Wind background), 45 minutes&receiver_email=beatofficial@gmail.com&item_name2=15 minutes relaxation Break (Wind chimes background)&payment_fee=0.50&quantity1=1&quantity2=1&receiver_id=5YKCMZKL6G46G&txn_type=cart&mc_gross_1=3.50&mc_currency=USD&mc_gross_2=3.50&residence_country=US&test_ipn=1&transaction_subject=&payment_gross=7.00&ipn_track_id=8542bf47e444e So it seems everything is working fine on the PayPal's side. I didn't gave up so i found this: The Paypal IPN log shows this URL in my case: http://brainwaveentrainment.eu/?wpsc...aypal_standard I tried to open this and i got this error message: "Fatal error: Cannot use object of type WP_Error as array in C:\xampp\htdocs\brainwaveentrainment.eu\wp-content\plugins\wp-e-commerce\wpsc-merchants\paypal-standard.merchant.php on line 400" On line 400 i found this: if ( 'VERIFIED' == $response['body'] ) { I googled for the error message and i found this fix: https://getsatisfaction.com/tweet_bl...error_as_array So i changed that line to look like this: if ( 'VERIFIED' == $response->body ) { Result: The error message is gone when i open that page! But... the IPN is still not working. I don't have PHP skills so i'm sure this single modification is not enough. Maybe somebody can help me with this here. I uploaded the original "paypal-standard.merchant.php" file's content to pastebin so you can check what's wrong with it: http://pastebin.com/9Dcd75LM Please help me if you can. I'm clueless and we really have to make this work somehow. I asked in the plugin's support forum too, but it's abandoned as a desert.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.