Skip to main content

PayPal Community

  • Dashboard
  • Send and Request
  • Wallet
  • Business
  • Help
Log in

Le Forum de la communauté n’est pas disponible pour les nouveaux messages ou les réponses; les articles précédents restent disponibles pour vérification. Afin de connaître les options d’assistance complètes, rendez-vous sur PayPal.com/HelpCenter

Si vous souhaitez signaler du contenu illégal et contraire au Règlement sur les services numériques de l’Union Européenne (DSA), veuillez cliquer ici.

since ‎Oct-30-2020
Country: United States
Type: Personal
stevedevtech
stevedevtech Contributor
Contributor
2
Posts
0
Kudos
0
Solutions
Your PayPal Anniversary
The Return
Active
View all
Latest Contributions by stevedevtech
  • Topics stevedevtech has Participated In
  • Latest Contributions by stevedevtech

How to charge customers with international phone n...

by stevedevtech Contributor in Merchant Products and Services Archives
‎May-26-2021 03:59 PM
‎May-26-2021 03:59 PM
Hi community,   I have a smart buttons implementation, and when charging users via credit card (not the Paypal login route), I ran into an issue where an international customer's phone number wasn't accepted (the phone number field starts with +1 by default and cant be changed as far as I can see). Is there an ability to add additional country codes for the API to accept? If you refer to the documentation in an answer, please include a link. Thanks so much.  ... View more
Labels:
  • Labels:
  • PayPal Buttons

Paypal Buttons Define Price With Serverside Integr...

by stevedevtech Contributor in REST APIs
‎Oct-30-2020 03:27 PM
‎Oct-30-2020 03:27 PM
Hi there, hopefully someone can help me.    I've had the paypal smart payments buttons client side integration working on my site for a while now.    However, I'm wanting to handle some of the processes on the server side now (PHP 7.1), basically so there is no chance someone on the client side could render the buttons at a different price than I want.    I was looking at the sdk documentation (https://developer.paypal.com/docs/business/checkout/server-side-api-calls/create-order/) to create an order. I have the sdk installed with composer and I have a post request from the paypal buttons createOrder method reaching the CreateOrder class its createOrder function.   I set up some additional error logs, and when the server tries to execute the request, I get this error {"error":"invalid_client","error_description":"Client Authentication failed"}   I have my sandbox credentials in place properly. That's not an issue.    First part of my client side js paypal buttons code   paypal.Buttons({ createOrder: function(data, actions) { console.log(data, actions); return fetch('/createReservationOrder', { method: 'post', headers: { 'content-type': 'application/json' } }).then(function(res) { return res.json(); }).then(function(data) { return data.orderID; // Use the same key name for order ID on the client and server }); },       The paypal create order class reached via REST API Post at /createReservationOrder. Im currently passing the price as 10 (for $10) as a test amount.    <?php namespace Sample\CaptureIntentExamples; require 'vendor/autoload.php'; //1. Import the PayPal SDK client that was created in `Set up Server-Side SDK`. use Sample\PayPalClient; use PayPalCheckoutSdk\Orders\OrdersCreateRequest; class CreateOrder { // 2. Set up your server to receive a call from the client /** *This is the sample function to create an order. It uses the *JSON body returned by buildRequestBody() to create an order. */ public static function createOrder($price, $debug=false) { $request = new OrdersCreateRequest(); $request->prefer('return=representation'); $request->body = self::buildRequestBody($price); // 3. Call PayPal to set up a transaction $client = PayPalClient::client(); $response = $client->execute($request); // 4. Return a successful response to the client. return $response; } /** * Setting up the JSON request body for creating the order with minimum request body. The intent in the * request body should be "AUTHORIZE" for authorize intent flow. * */ private static function buildRequestBody($price) { return array( 'intent' => 'CAPTURE', 'application_context' => array( 'brand_name' => "Camp Avalon Reservation Suggested Donation", 'shipping_preference' => "NO_SHIPPING", 'return_url' => 'https://campavalon.org/reserve', 'cancel_url' => 'https://campavalon.org/reserve' ), 'purchase_units' => array( 0 => array( 'amount' => array( 'currency_code' => 'USD', 'value' => "$price" ) ) ) ); } } /** *This is the driver function that invokes the createOrder function to create *a sample order. */ if (!count(debug_backtrace())) { CreateOrder::createOrder(true); }       Any help is appreciated. Many thanks.   ... View more
Labels:
  • Labels:
  • Invoicing REST APIs
  • Payments REST APIs
Paypal Logo
  • Help
  • Contact Us
  • Security
  • Fees
  • © 1999-2025 PayPal, Inc. All rights reserved.
  • Privacy
  • Legal
  • Cookies
  • Policy Updates

The money in your balance is eligible for pass-through FDIC insurance.

The PayPal Cash Mastercard is issued by The Bancorp Bank pursuant to a license by Mastercard International Incorporated. The Bancorp Bank; Member FDIC.

Powered by Khoros