Limit payment options only to PayPal accounts (no credit card)

7

I'm integrating the PayPal Express Checkout API.

When the payer actually goes to the Paypal website to enter your details in order to make the payment, you are presented with the following options:

  • PayPal account payment
  • Payment by Credit Card

Problem

In this particular integration, payments to be made via PayPal should be limited to PayPal accounts, ie the credit card option should be unavailable or not appear at all.

In the API documentation (English) I did not find no reference to this subject and no option to indicate that I do not want the credit card option to appear.

Parameters sent to the API

In the function below, the various parameters that indicate to the API what is intended to be presented to the payer as well as the page layout on the PayPal side are prepared:

/**
 * CALL SHORTCUT EXPRESS CHECKOUT
 *
 * Prepares the parameters for the SetExpressCheckout API Call.
 *
 * @param string $token             Internal security token
 * @param string $cartLinesArr      The cart lines to build the url string.
 * @param string $cartTotalsArr     The cart products and delivery total.
 *
 * @return array                    Response array from Paypal
 */
public function callShortcutExpressCheckout($token, $cartLinesArr, $cartTotalsArr) {

  //get all details about this transaction
  $transactionArr = $this->getClientData($cartTotalsArr);

  /*
   * Buyers Address and Contacts
   */
  $shiptoAddress = "&SHIPTONAME="        . urlencode($transactionArr["firstName"]." ".$transactionArr["lastName"]);
  $shiptoAddress.= "&SHIPTOSTREET="      . urlencode($transactionArr["address"]);
  $shiptoAddress.= "&SHIPTOSTREET2="     . urlencode($transactionArr["address2"]);
  $shiptoAddress.= "&SHIPTOCITY="        . urlencode($transactionArr["city"]);
  $shiptoAddress.= "&SHIPTOSTATE="       . urlencode($transactionArr["state"]);
  $shiptoAddress.= "&SHIPTOCOUNTRYCODE=" . urlencode($transactionArr["countryCode"]);
  $shiptoAddress.= "&SHIPTOZIP="         . urlencode($transactionArr["zipCode"]);
  $shiptoAddress.= "&SHIPTOPHONENUM="    . urlencode($transactionArr["contact"]);

  /*
   * Cart Items
   */
  $PAYPAL_CART_ITEMS = "";
  $c = 0;

  if ($cartLinesArr) {

    foreach ($cartLinesArr as $cartLine) {

      $PAYPAL_CART_ITEMS.= "&L_PAYMENTREQUEST_0_NUMBER" . $c . "=" . urlencode($cartLine["id"]);
      $PAYPAL_CART_ITEMS.= "&L_PAYMENTREQUEST_0_NAME"   . $c . "=" . urlencode($cartLine["name"]);
      $PAYPAL_CART_ITEMS.= "&L_PAYMENTREQUEST_0_AMT"    . $c . "=" . urlencode($cartLine["price"]);
      $PAYPAL_CART_ITEMS.= "&L_PAYMENTREQUEST_0_QTY"    . $c . "=" . urlencode($cartLine["quantity"]);
      $c++;
    }
  }

  /*
   * Construct the parameter string that describes the
   * SetExpressCheckout API call in the shortcut implementation
   */
  $nvpstr = "&PAYMENTREQUEST_0_AMT="           . urlencode(numberFormat($transactionArr["shippingVal"]+$transactionArr["chargeValue"]));
  $nvpstr.= "&PAYMENTREQUEST_0_ITEMAMT="       . urlencode($transactionArr["chargeValue"]);
  $nvpstr.= "&PAYMENTREQUEST_0_SHIPPINGAMT="   . urlencode($transactionArr["shippingVal"]);
  $nvpstr.= "&PAYMENTREQUEST_0_PAYMENTACTION=" . urlencode(PAYPAL_PAYMENT_TYPE);
  $nvpstr.= "&PAYMENTREQUEST_0_CURRENCYCODE="  . urlencode(PAYPAL_CURRENCY_CODE_TYPE);
  $nvpstr.= "&RETURNURL="                      . urlencode(PAYPAL_RETURN_URL.$token);
  $nvpstr.= "&CANCELURL="                      . urlencode(PAYPAL_CANCEL_URL.$token);
  $nvpstr.= "&ADDRESSOVERRIDE=1";
  $nvpstr.= $shiptoAddress;
  $nvpstr.= "&ALLOWNOTE="                      . urlencode(PAYPAL_ALLOWNOTE);
  $nvpstr.= "&HDRIMG="                         . urlencode(PAYPAL_USE_LOGOTYPE);
  $nvpstr.= "&LOCALECODE="                     . urlencode(PAYPAL_LOCAL_CODE);
  $nvpstr.= "&EMAIL="                          . urlencode($transactionArr["email"]);
  $nvpstr.= $PAYPAL_CART_ITEMS;
  $nvpstr.= "&LANDINGPAGE="                    . urlencode(PAYPAL_LANDING_PAGE);
  $nvpstr.= "&NOTETOBUYER="                    . urlencode(I18N_ESHOP_PAYPAL_NOTES);


  /*
   * Make the API call to PayPal
   */
  return $this->hash_call("SetExpressCheckout", $nvpstr);
}

Question

How do I pass a parameter to the PayPal API so that it limits the payment options that are presented to the payer, where it is only intended to accept payments through PayPal accounts?

    
asked by anonymous 06.02.2014 / 20:39

2 answers

3

Paypal does not allow such a lock, the only locks available are:

  • Block payments from United States people with no confirmed email address
  • Block payments in currencies other than your account's
  • Block accidental payments (same invoice number paid more than once)
  • Block payments from people with non-US Paypal accounts
  • Block outgoing payments ("Send money to someone")
  • Block payments via eCheck

It would be a good feature to add

Source: link

    
06.02.2014 / 21:01
0

In Api SetExpressCheckout just add: solutiontype=mark

    
07.02.2014 / 16:29