216 class RestAuthorizeRequest
extends AbstractRestRequest
221 'intent' =>
'authorize',
223 'payment_method' =>
'credit_card',
224 'funding_instruments' => array()
226 'transactions' => array(
242 foreach ($items as $n => $item) {
244 'name' => $item->getName(),
245 'description' => $item->getDescription(),
246 'quantity' => $item->getQuantity(),
247 'price' => $this->formatCurrency($item->getPrice()),
248 'currency' => $this->getCurrency()
251 $data[
'transactions'][0][
'item_list'][
"items"] = $itemList;
257 $data[
'payer'][
'funding_instruments'][] = array(
258 'credit_card_token' => array(
266 $data[
'payer'][
'funding_instruments'][] = array(
267 'credit_card' => array(
268 'number' => $this->
getCard()->getNumber(),
269 'type' => $this->
getCard()->getBrand(),
270 'expire_month' => $this->
getCard()->getExpiryMonth(),
271 'expire_year' => $this->
getCard()->getExpiryYear(),
272 'cvv2' => $this->
getCard()->getCvv(),
273 'first_name' => $this->
getCard()->getFirstName(),
274 'last_name' => $this->
getCard()->getLastName(),
275 'billing_address' => array(
276 'line1' => $this->
getCard()->getAddress1(),
278 'city' => $this->
getCard()->getCity(),
279 'state' => $this->
getCard()->getState(),
280 'postal_code' => $this->
getCard()->getPostcode(),
281 'country_code' => strtoupper($this->
getCard()->getCountry()),
288 $line2 = $this->
getCard()->getAddress2();
289 if (!empty($line2)) {
290 $data[
'payer'][
'funding_instruments'][0][
'credit_card'][
'billing_address'][
'line2'] = $line2;
293 $this->
validate(
'amount',
'returnUrl',
'cancelUrl');
295 unset($data[
'payer'][
'funding_instruments']);
297 $data[
'payer'][
'payment_method'] =
'paypal';
298 $data[
'redirect_urls'] = array(
325 return $this->
setParameter(
'experienceProfileId', $value);
339 $desc = parent::getDescription();
343 } elseif (empty($desc)) {
346 return "$id : $desc";
359 return parent::getEndpoint() .
'/payments/payment';