Search the Community
Showing results for tags 'paypal'.
-
This is more of a Paypal question, but I'm using php on the listener and hopefully someone has run into this problem. I'm having trouble finding the correct POST name to use to get the OPTION SELECT for the item on my listener page. I tried: $option = $_POST['os0']; But, I'm not getting anything using that. I've also tried os0_x, on0, and on0_x. This is what I'm posting to Paypal: <input type="hidden" name="on0" value="Term"> <select name="os0"> <option value="1 Year">1 Year</option> <option value="3 Years">3 Years</option> <option value="5 Years">5 Years</option> </select>
-
Using Joomla 2.5 and Virtuemart 3. I've had a client tell us that they're getting e-mails (admin order confirmation email) that are different orders from the same person at the same time. After some test orders I've seen that what happens is when PayPal is used, and the customer is being redirected or has been, they then press the back button in the browser, amend the order and send it again. This sends 2 e-mails to the shop and causes confusion. Is there a way to stop this? (Other than a big bold message warning not to do it)
-
- joomla
- virtuemart
-
(and 3 more)
Tagged with:
-
I have a website which shows lots of products by PHP/mysql database. Currently only cash payments are available. I want to add PayPal in, which I've never done before. Having looked at the integration guides, I found the PayPal payments standard bit but with this you need PayPal's buttons. If you have the add to cart buttons, apparently you need to write out each product into PayPal which shouldn't happen as the products are generated by a while loop so I should only paste the code once, but it looks like this needs to be posted individually for each product. Ideally I'd have the PayPal code only happen if the user chooses PayPal at the cart, and then send them to PayPal. The cart products, prices, options and option prices are all in session arrays. Is this possible? Is there a better way?
- 7 replies
-
- paypal
- integration
-
(and 1 more)
Tagged with:
-
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(); } ...