Jump to content

Search the Community

Showing results for tags 'sdk'.

  • 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

Found 3 results

  1. Hello everyone, I'm new here My website was working fine until a few days ago, Up until then my str_replace('s130x130', 's800x800') and str_replace('_s', '_o') solved the picture thing. Now the images are broken (or very small) and I can find no documentation on how to enlarge the pictures. Thus my question: how do I retrieve larger pictures from the Facebook PHP SDK? Code foreach($pagefeed['data'] as $post) { if ($post['type'] == 'status' || $post['type'] == 'link' || $post['type'] == 'photo') { if ($post['type'] == 'photo') { echo "<div class='col-md-6 col-sm-6'>"; echo "<div class='thumbnail'>"; echo "<img src=" . str_replace('s130x130', 's800x800', str_replace('_s', '_o', $post['picture'])) . " />"; echo "<div class='caption'>"; echo "<sup>Geplaatst op: " . date("d-m-Y, (strtotime($post['created_time']))) . "</sup>"; if (empty($post['message']) === false) { echo "<p><span class='glyphicon glyphicon-comment'></span> " . $post['message'] . "</p>";} echo "</div>"; echo "</div>"; echo "</div>"; $i++; } } } Thanks in advance!
  2. Basically what I can see is that I am failing to create the apiContext object. Can anyone see where the error is? Please tell me how I can improve the question. Here is the error: Fatal error: Uncaught exception 'PayPal\Exception\PPConnectionException' with message 'Got Http response code 400 when accessing https://api.sandbox.paypal.com/v1/payments/payment.' in /vendor/paypal/sdk-core-php/lib/PayPal/Core/PPHttpConnection.php:104 Stack trace: #0 /vendor/paypal/sdk-core-php/lib/PayPal/Transport/PPRestCall.php(44): PayPal\Core\PPHttpConnection->execute('{"intent":"sale...') #1 /vendor/paypal/rest-api-sdk-php/lib/PayPal/Api/Payment.php(246): PayPal\Transport\PPRestCall->execute(Array, '/v1/payments/pa...', 'POST', '{"intent":"sale...') #2 /pymt.php(38): PayPal\Api\Payment->create(Object(PayPal\Rest\ApiContext)) #3 {main} thrown in /vendor/paypal/sdk-core-php/lib/PayPal/Core/PPHttpConnection.php on line 104 This is the PHP sample I'm using. I am trying to run it off my server. If a customer clicks the pay with paypal button, it runs the following sample script: <?php require __DIR__ . '/../bootstrap.php'; use PayPal\Api\Address; use PayPal\Api\Amount; use PayPal\Api\Payer; use PayPal\Api\Payment; use PayPal\Api\FundingInstrument; use PayPal\Api\RedirectUrls; use PayPal\Api\Transaction; session_start(); $payer = new Payer(); $payer->setPayment_method('paypal'); $amount = new Amount(); $amount->setCurrency('USD'); $amount->setTotal('1.00'); $transaction = new Transaction(); $transaction->setAmount($amount); $transaction->setDescription('This is the payment description.'); $baseUrl = getBaseUrl(); $redirectUrls = new RedirectUrls(); $redirectUrls->setReturn_url('baseUrl/sale.php'); $redirectUrls->setCancel_url('baseUrl/saleFail.php'); $payment = new Payment(); $payment->setIntent('sale'); $payment->setPayer($payer); $payment->setRedirect_urls($redirectUrls); $payment->setTransactions(array($transaction)); try { $payment->create($apiContext); } catch (\PPConnectionException $ex) { echo 'Exception: ' . $ex->getMessage() . PHP_EOL; var_dump($ex->getData()); exit(1); } foreach ($payment->getLinks() as $link) { if ($link->getRel() == 'approval_url') { $redirectUrl = $link->getHref(); } } $_SESSION['paymentId'] = $payment->getId(); if(isset($redirectUrl)) { header('Location: $redirectUrl'); exit; } ?> Here's the redacted bootstrap.php: <?php /* * Sample bootstrap file. */ // Include the composer autoloader if(!file_exists(__DIR__ .'/vendor/autoload.php')) { echo "The 'vendor' folder is missing. You must run 'composer update --no-dev' to resolve application dependencies.\nPlease see the README for more information.\n"; exit(1); } require __DIR__ . '/vendor/autoload.php'; require __DIR__ . '/common.php'; use PayPal\Rest\ApiContext; use PayPal\Auth\OAuthTokenCredential; $apiContext = getApiContext(); /** Helper method for getting an APIContext for all calls * * @return PayPal\Rest\ApiContext */ function getApiContext() { // ### Api context // Use an ApiContext object to authenticate // API calls. The clientId and clientSecret for the // OAuthTokenCredential class can be retrieved from // developer.paypal.com $apiContext = new ApiContext( new OAuthTokenCredential( 'MY CLIENT ID', 'MY SECRET' ) ); // Register the sdk_config.ini file in current directory // as the configuration source. if(!defined("PP_CONFIG_PATH")) { define("PP_CONFIG_PATH", __DIR__); } return $apiContext; } ?> Can anyone help? Let me know if you need more info. Thanks up front.
  3. This is a theoretical question. So I won't need any code. Here is an example situation: User signs up for website with a username and password. User connects facebook account. Can I make it so everytime they log in, their facebook logs in too? Am I completely getting it wrong? Thanks, Nick
×
×
  • 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.