40 protected $testEndpoint =
'https://api-3t.sandbox.paypal.com/nvp';
256 return $this->
setParameter(
'customerServiceNumber', $value);
266 return $this->
setParameter(
'sellerPaypalAccountId', $value);
290 $data[
'VERSION'] = static::API_VERSION;
296 if (!empty($bnCode)) {
297 $data[
'BUTTONSOURCE'] = $bnCode;
308 $data[
"PAYMENTREQUEST_0_ITEMAMT"] = 0;
309 foreach ($items as $n => $item) {
310 $data[
"L_PAYMENTREQUEST_0_NAME$n"] = $item->getName();
311 $data[
"L_PAYMENTREQUEST_0_DESC$n"] = $item->getDescription();
312 $data[
"L_PAYMENTREQUEST_0_QTY$n"] = $item->getQuantity();
313 $data[
"L_PAYMENTREQUEST_0_AMT$n"] = $this->
formatCurrency($item->getPrice());
315 $data[
"L_PAYMENTREQUEST_0_NUMBER$n"] = $item->getCode();
318 $data[
"PAYMENTREQUEST_0_ITEMAMT"] += $item->getQuantity() * $this->
formatCurrency($item->getPrice());
320 $data[
"PAYMENTREQUEST_0_ITEMAMT"] = $this->
formatCurrency($data[
"PAYMENTREQUEST_0_ITEMAMT"]);
328 $httpResponse = $this->httpClient->request(
'POST', $this->
getEndpoint(), [], http_build_query($data,
'',
'&'));
330 return $this->
createResponse($httpResponse->getBody()->getContents());
340 return $this->response =
new Response($this, $data);
350 if ($items && !$items instanceof
ItemBag) {