I have a problem with a paypal sandbox test buy
I am doing e-commerce on shopify.And I finished mine website.And trying add payment methods.Finally I intergrated Paypal express check-out on shopify.
And I wanna test paypal its working correctly. And I create sandbox account.I can login smoothly www.sandbox.paypal.com but when I am trying test buy on my website paypal login says "Check your email adress and password and try again" but I am sure with mail adress and password are corrects.
See also questions close to this topic
-
Python call to PHP - malformed header from script Bad header: Array
Very strange - I've been using a python script that scrapes data and then passes it to a php-script - Worked like charm for weeks, until today something happened.
I got the following message from apache2 errorlog:
malformed header from script 'pytest.py': Bad header: Array
So it seems to be derived from this python script, the php-script is called but there is a server 500 error and the error log tells about a malformed header from python
python script
#!/home/john/mydir/my_venv/bin/python3 # enable debugging import cgitb from bs4 import BeautifulSoup from urllib.request import urlopen, Request import os cgitb.enable() print ("Content-type: text/html\r\n\r\n") url = "https://www.xxxx.." soup = BeautifulSoup(urlopen(url).read()) stockNames = [] stockClose = [] stockHigh = [] stockLow = [] stockTurnover = [] for tag in soup.select('td[data-title="Namn"]'): name = tag.get_text(strip=True, separator='\n') stockNames.append(name) for tag in soup.select('td[data-title="Senast"]'): close = tag.get_text(strip=True, separator='\n') stockClose.append(close) os.system('php /var/www/html/omx/dataparser.php %s %s'%(stockNames, stockClose))
the php script (snippet)
<?php if (isset($argc)) { unset($argv["0"]); // remove first argument i.e. filename ... }
Any Idea whats wrong, why this suddenly happened? Could a packetsniffer be in place to see whats going on?
-
How to have only 3 checkboxes per line with dinamic checkbox number
How to have only 3 checkboxes per line with dinamic checkbox number, for example I have 21 checkboxes (read checkbox name form a database) This is my code
<div class='form-group'> <div class="col-lg-12"> <?php $sql = "SELECT id, posizione, nome FROM user_livelli"; $result = $conn->query($sql); if (!empty($result) && $result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { $id = $row['id']; $posizione = $row['posizione']; $nome = $row['nome']; echo "<input type='checkbox' name='nome_posiz[]'>" ." " .$nome ." "; } } ?> </div> </div>
I have the following situation
But I would like to have only 3 checkboxes per line, for example the 3 with black dot on the first line, the 3 with the red dot on another line, the 3 with the green dot on another line and so on. Something like this done using PAINT
-
How can I redirect all users via a single page based on admin rights?
I'm trying to set up a login for website, where a user can have one of three states. I have this set in a connected file called 'authenticate.php' which on login checks my DB for the value "version" where the values can be 1,2 or 3 depending on access level. This file is then set up to redirect set up to one of three different pages, for instance home1.php, home2.php, home3.php. I am happy with having 3 separate pages, as I want this control.
In the same directory as these files, there is a folder of content which users will only be able to see some of the pages from. For example:
- website (FOLDER)
- authenticate.php
- index.html
- home1.php
- home2.php
- home3.php
- content (FOLDER)
- news1.html
- news2.html
- news3.html
The problem is, that with my current implementation, when the user is on any one of these content pages, I can't link them back to the right version of the home page they're meant to be seeing.
As a solution, I was thinking of using a new file 'home.php' to always direct to, and then redirect the user to where they need to go, as opposed to dealing with all of this in the authentication.php file like I'm doing currently. This would allow me to send the user to home.php, and then they'd be redirected to the version they're meant to see.
I have used what's happening in the original authenticate.php and I have tried replicating the check to the DB to get the value of "version", but this doesn't seem to be working. As I'm sure is obvious from my code, I am not experienced in PHP I am also unsure whether it's necessary to reconnect to the DB once this has already been made in the session.
Any help would be really appreciated, as I'm sure there's a better way to do this.
Thank you!
Code:
Authenticate.php
session_start(); $DATABASE_HOST = 'localhost'; $DATABASE_USER = 'john' $DATABASE_PASS = 'password'; $DATABASE_NAME = 'users'; $con = mysqli_connect($DATABASE_HOST, $DATABASE_USER, $DATABASE_PASS, $DATABASE_NAME); if ( mysqli_connect_errno() ) { exit('Failed to connect to MySQL: ' . mysqli_connect_error()); } if ( !isset($_POST['username'], $_POST['password']) ) { exit('Please fill both the username and password fields!'); } if ($stmt = $con->prepare('SELECT id, password FROM accounts WHERE username = ?')) { $stmt->bind_param('s', $_POST['username']); $stmt->execute(); $stmt->store_result(); if ($stmt->num_rows > 0) { $stmt->bind_result($id, $password); $stmt->fetch(); if ($_POST['password'] === $password) { session_regenerate_id(); $_SESSION['loggedin'] = TRUE; $_SESSION['name'] = $_POST['username']; $_SESSION['id'] = $id; header('Location: home.php'); } else { echo 'Incorrect username and/or password!'; } } else { echo 'Incorrect username and/or password!'; } $stmt->close(); }
Home.php
<?php session_start(); if (!isset($_SESSION['version'] == 1 )) { header('Location: home1.php'); exit; } if (!isset($_SESSION['version'] == 2 )) { header('Location: home2.php'); exit; } if (!isset($_SESSION['version'] == 3 )) { header('Location:home3.php'); exit; }
- website (FOLDER)
-
Could you suggest plugin for PayPal Donations?
Good afternoon. Maybe someone has used PayPal donation plugin (paid or free) that meets the requirements:
- User fills in Email, Amount, and Comment fields
- Clicks on Pay that goes to PayPal payment.
- The visitor gets a custom Receipt after the payment is already made.
- Receipts have to be editable in admin-panel.
Thanks!
-
Accept credit card and debit card payment using paypal in nodejs rest api
I have used paypal-rest-sdk in my code the payment using paypal login working smoothly but now I want to pay using credit card and debit card without login to paypal.
I have also on the "PayPal Account Optional" to "on" stil I am not able to pay with credit and debit cards
Below is the image of login window of paypal. I want to pay with pay with debit card and credit card button.
I have create two routes for create payment and execute payment. I have used nodejs for back-end and angular8 for front-end.
Can you please help me here
-
How do I redirect a user to a website after a purchase using PayPal smart buttons?
onApprove: function(data, actions) { return actions.order.capture().then(function(details) { alert('Transaction completed by ' + details.payer.name.given_name + '!'); location.href("mywebsite"); }); },
I have been trying to find out how to do this for awhile, I have tried "location.replace" as well, but it still didn't work. This is just the basic code that you get when you create a PayPal smart button, all I added was "location.href", but it won't redirect me. I will try my best to answer any questions! Any help on this matter is appreciated!
-
How to integrate PayPal Payouts AAC?
I have been trying to integrate PayPal Payouts (https://developer.paypal.com/docs/payouts/) but it does not seem to work even with a simple setup just to display the Login with Paypal button. I'm trying to setup this https://developer.paypal.com/docs/payouts/features/set-up-assisted-account-creation to get the
payer_id
. I'll store thepayer_id
in the database then I'll process these ids with PayPal Payouts batch processing to pay the users.This is the simplest setup -
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>PayPal Payouts</title> <script src="https://www.paypalobjects.com/payouts/js/payouts_aac.js"></script> <script> paypal.PayoutsAAC.render({ // Use sandbox for testing env: 'sandbox', clientId: { // production: '<production clientId>', sandbox: '**************************************************************' }, merchantId: '*************', pageType: 'login', onLogin: function (response) { if (response.err) { console.log(response.err) } else { console.log(response.body.code) } } }, '#paypal') </script> </head> <body> <div id="paypal"></div> </body> </html>
It just appearing momentarily. Only on first page loads it appears then it is disappearing. After disappearance it is yielding an error on the console -
main.js:596 Uncaught TypeError: Parameter `locale` must be a string, not undefined `undefined` at o (main.js:596) at i (main.js:596) at new t (main.js:596) at Object.createHandler (main.js:614) at t.init (main.js:1389) at Object../bootstrap.js (main.js:1257) at i (main.js:1) at Object../render.js (main.js:1353) at i (main.js:1) at HTMLDocument.<anonymous> (main.js:1323)
-
Any Option for Custom Paypal Login template
Any Option for Custom Paypal Login template in paypal Dashboard Any option for change Paypal logo in paypal connect enter image description here
-
Allow WordPress to send PayPal payments direct less a percentage
Thanks for reading this. I work in influencer marketing for UK firms. I run a influencer network of bloggers and want to set up a payment gateway that sends payments directly to the bloggers.
I connect businesses wanting guest posts, niche links and product reviews with influencers in a specified niche.
What I an setting up is a directory showing the bloggers, their sites, prices and seo metrics.
Is there a way on WordPress to allow business customers visiting those pages to pay for a service so bloggers get paid directly less a percentage to my account?
So, payment goes direct from the page to the bloggers less a percentage of their advertised fee. Since Adaptive Payments was removed, I am not sure how to go about splitting payments at the time of the order.
Also any advice on how to create the directory appreciated. I am thinking along the lines of a classifieds section at present where bloggers add their own profiles, prices, etc. Thanks in advance for any help.
-
Paypal Smart Payments - USD Currency problem & Redirect
I installed on two pages of the same website Paypal Smart Buttons Page 1 - the first one is with AUD currency and the transactions work Page 2 - the second one is with USD currency, and the pop-up opens up. I am able to input card details. But nothing happens and the pop-up restarts.
Would you be able to help me with it?
Also is there any way to replace the confirmation pop up and set a redirection to thank you page instead?
I believe that I have to change something here: onApprove: async function (data, actions)
<div id="smart-button-container"> <div style="text-align: center"><label for="description">Invoice Number </label><input type="text" name="descriptionInput" id="description" maxlength="127" value=""></div> <p id="descriptionError" style="visibility: hidden; color:red; text-align: center;">Please enter a description</p> <div style="text-align: center"><label for="amount">Payment Amount </label><input name="amountInput" type="number" id="amount" value="" ><span> USD</span></div> <p id="priceLabelError" style="visibility: hidden; color:red; text-align: center;">Please enter a price</p> <div id="invoiceidDiv" style="text-align: center; display: none;"><label for="invoiceid">Contact / Full Name </label><input name="invoiceid" maxlength="127" type="text" id="invoiceid" value="" ></div> <p id="invoiceidError" style="visibility: hidden; color:red; text-align: center;">Please enter an Invoice ID</p> <div style="text-align: center; margin-top: 0.625rem;" id="paypal-button-container"></div> </div> <script src="https://www.paypal.com/sdk/js?client-id=client-id¤cy=USD" data-sdk-integration-source="button-factory"></script> <script> function initPayPalButton() { var description = document.querySelector('#smart-button-container #description'); var amount = document.querySelector('#smart-button-container #amount'); var descriptionError = document.querySelector('#smart-button-container #descriptionError'); var priceError = document.querySelector('#smart-button-container #priceLabelError'); var invoiceid = document.querySelector('#smart-button-container #invoiceid'); var invoiceidError = document.querySelector('#smart-button-container #invoiceidError'); var invoiceidDiv = document.querySelector('#smart-button-container #invoiceidDiv'); var elArr = [description, amount]; if (invoiceidDiv.firstChild.innerHTML.length > 1) { invoiceidDiv.style.display = "block"; } var purchase_units = []; purchase_units[0] = {}; purchase_units[0].amount = {}; function validate(event) { return event.value.length > 0; } paypal.Buttons({ style: { color: 'gold', shape: 'rect', label: 'paypal', layout: 'vertical', }, onInit: function (data, actions) { actions.disable(); if(invoiceidDiv.style.display === "block") { elArr.push(invoiceid); } elArr.forEach(function (item) { item.addEventListener('keyup', function (event) { var result = elArr.every(validate); if (result) { actions.enable(); } else { actions.disable(); } }); }); }, onClick: function () { if (description.value.length < 1) { descriptionError.style.visibility = "visible"; } else { descriptionError.style.visibility = "hidden"; } if (amount.value.length < 1) { priceError.style.visibility = "visible"; } else { priceError.style.visibility = "hidden"; } if (invoiceid.value.length < 1 && invoiceidDiv.style.display === "block") { invoiceidError.style.visibility = "visible"; } else { invoiceidError.style.visibility = "hidden"; } purchase_units[0].description = description.value; purchase_units[0].amount.value = amount.value; if(invoiceid.value !== '') { purchase_units[0].invoice_id = invoiceid.value; } }, createOrder: function (data, actions) { return actions.order.create({ purchase_units: purchase_units, }); }, onApprove: function (data, actions) { return actions.order.capture().then(function (details) { alert('Transaction completed by ' + details.payer.name.given_name + '!'); }); }, onError: function (err) { console.log(err); } }).render('#paypal-button-container'); } initPayPalButton(); </script>
-
How do I set up payments on my PayPal business account?
Can anyone help me set up payments for my PayPal business account? I need to set up recurring payments (subscription) once a month, set up standard payments, set up payment for services.
-
Paypal API get authorisation code from code
I've implemented a Paypal Connect button. This returns a
code
parameter in the query string.I'm unsure as to how to then turn this into an access code. The following code returns a
(400) Bad Request
error on theCreateFromAuthorizationCode()
line:var config = ConfigManager.Instance.GetProperties(); var oAuthCredential = new OAuthTokenCredential( Code.Settings.AssetStore.AssetStorePaypalAccountClientID, Code.Settings.AssetStore.AssetStorePaypalAccountSecret, config); var accessToken = oAuthCredential.GetAccessToken(); var apiContext = new APIContext(accessToken); var n = new CreateFromAuthorizationCodeParameters(); n.SetCode(paypalLoginCode); n.setClientId(Code.Settings.AssetStore.AssetStorePaypalAccountClientID); n.setClientSecret(Code.Settings.AssetStore.AssetStorePaypalAccountSecret); n.SetGrantType("authorization_code"); n.SetRedirectUri("https://www.constructdev.net/en/game-assets/seller-account/cashout/create"); var info = Tokeninfo.CreateFromAuthorizationCode(apiContext, n); Response.Write(info.access_token); Response.End();
The Paypal API's seem a bit of a mess, any help on how to get the code at this point would be much appreciated.
-
Connect With PayPal : Get status 400 (Bad Request)
I am facing 400 bad request response from PayPal during getting access token based on access code. I go through below reference link https://developer.paypal.com/docs/connect-with-paypal/integrate/#1-create-the-app
I follow 5 steps perfectly but getting the issue with step no. 6. See my code below:
Request Part:
$curl = curl_init(); $base_token = "{client_id:secret}"; $data = array( CURLOPT_URL => "https://api.sandbox.paypal.com/v1/oauth2/token", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => array( 'grant_type' => 'authorization_code', 'code' => '{authorization_code}' ), CURLOPT_HTTPHEADER => array( "Authorization: Basic ".$base_token, ), ); curl_setopt_array($curl,$data ); $response = curl_exec($curl); curl_close($curl);
Response Part:
stdClass Object ( [name] => Bad Request [debug_id] => 5837077aa8787 [message] => java.lang.IllegalArgumentException [details] => Array ( ) )