Skip to content
This repository was archived by the owner on Sep 29, 2023. It is now read-only.

Commit d6a6538

Browse files
author
Steve Coffey
authored
Merge pull request #700 from paypal/payments-v1.9
Update payments API to v1.9
2 parents 7c5ea8b + cbff552 commit d6a6538

File tree

102 files changed

+2228
-1105
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+2228
-1105
lines changed

lib/PayPal/Api/Address.php

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
* @package PayPal\Api
1111
*
1212
* @property string phone
13+
* @property string type
1314
*/
1415
class Address extends BaseAddress
1516
{
1617
/**
17-
* Phone number in E.123 format.
18+
* Phone number in E.123 format. 50 characters max.
1819
*
1920
* @param string $phone
2021
*
@@ -27,7 +28,7 @@ public function setPhone($phone)
2728
}
2829

2930
/**
30-
* Phone number in E.123 format.
31+
* Phone number in E.123 format. 50 characters max.
3132
*
3233
* @return string
3334
*/
@@ -36,4 +37,26 @@ public function getPhone()
3637
return $this->phone;
3738
}
3839

40+
/**
41+
* Type of address (e.g., HOME_OR_WORK, GIFT etc).
42+
*
43+
* @param string $type
44+
*
45+
* @return $this
46+
*/
47+
public function setType($type)
48+
{
49+
$this->type = $type;
50+
return $this;
51+
}
52+
53+
/**
54+
* Type of address (e.g., HOME_OR_WORK, GIFT etc).
55+
*
56+
* @return string
57+
*/
58+
public function getType()
59+
{
60+
return $this->type;
61+
}
3962
}

lib/PayPal/Api/AlternatePayment.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
*
1212
* @package PayPal\Api
1313
*
14+
* @deprecated Used for limited release only.
15+
*
1416
* @property string alternate_payment_account_id
1517
* @property string external_customer_id
1618
* @property string alternate_payment_provider_id

lib/PayPal/Api/Amount.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
*
1414
* @package PayPal\Api
1515
*
16-
* @property string currency
17-
* @property string total
16+
* @property string currency
17+
* @property string total
1818
* @property \PayPal\Api\Details details
1919
*/
2020
class Amount extends PayPalModel
@@ -23,7 +23,7 @@ class Amount extends PayPalModel
2323
* 3-letter [currency code](https://developer.paypal.com/docs/integration/direct/rest_api_payment_country_currency_support/). PayPal does not support all currencies.
2424
*
2525
* @param string $currency
26-
*
26+
*
2727
* @return $this
2828
*/
2929
public function setCurrency($currency)
@@ -46,7 +46,7 @@ public function getCurrency()
4646
* Total amount charged from the payer to the payee. In case of a refund, this is the refunded amount to the original payer from the payee. 10 characters max with support for 2 decimal places.
4747
*
4848
* @param string|double $total
49-
*
49+
*
5050
* @return $this
5151
*/
5252
public function setTotal($total)
@@ -71,7 +71,7 @@ public function getTotal()
7171
* Additional details of the payment amount.
7272
*
7373
* @param \PayPal\Api\Details $details
74-
*
74+
*
7575
* @return $this
7676
*/
7777
public function setDetails($details)

lib/PayPal/Api/Authorization.php

Lines changed: 89 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace PayPal\Api;
44

55
use PayPal\Common\PayPalResourceModel;
6-
use PayPal\Rest\ApiContext;
76
use PayPal\Validation\ArgumentValidator;
7+
use PayPal\Rest\ApiContext;
88

99
/**
1010
* Class Authorization
@@ -13,29 +13,31 @@
1313
*
1414
* @package PayPal\Api
1515
*
16-
* @property string id
17-
* @property \PayPal\Api\Amount amount
18-
* @property string payment_mode
19-
* @property string state
20-
* @property string reason_code
21-
* @property string pending_reason
22-
* @property string protection_eligibility
23-
* @property string protection_eligibility_type
16+
* @property string id
17+
* @property \PayPal\Api\Amount amount
18+
* @property string payment_mode
19+
* @property string state
20+
* @property string reason_code
21+
* @property string pending_reason
22+
* @property string protection_eligibility
23+
* @property string protection_eligibility_type
2424
* @property \PayPal\Api\FmfDetails fmf_details
25-
* @property string parent_payment
25+
* @property string parent_payment
2626
* @property \PayPal\Api\ProcessorResponse processor_response
27-
* @property string valid_until
28-
* @property string create_time
29-
* @property string update_time
30-
* @property \PayPal\Api\Links[] links
27+
* @property string valid_until
28+
* @property string create_time
29+
* @property string update_time
30+
* @property string reference_id
31+
* @property string receipt_id
32+
* @property \PayPal\Api\Links[] links
3133
*/
3234
class Authorization extends PayPalResourceModel
3335
{
3436
/**
3537
* ID of the authorization transaction.
3638
*
3739
* @param string $id
38-
*
40+
*
3941
* @return $this
4042
*/
4143
public function setId($id)
@@ -58,7 +60,7 @@ public function getId()
5860
* Amount being authorized.
5961
*
6062
* @param \PayPal\Api\Amount $amount
61-
*
63+
*
6264
* @return $this
6365
*/
6466
public function setAmount($amount)
@@ -82,7 +84,7 @@ public function getAmount()
8284
* Valid Values: ["INSTANT_TRANSFER"]
8385
*
8486
* @param string $payment_mode
85-
*
87+
*
8688
* @return $this
8789
*/
8890
public function setPaymentMode($payment_mode)
@@ -106,7 +108,7 @@ public function getPaymentMode()
106108
* Valid Values: ["pending", "authorized", "partially_captured", "captured", "expired", "voided"]
107109
*
108110
* @param string $state
109-
*
111+
*
110112
* @return $this
111113
*/
112114
public function setState($state)
@@ -130,7 +132,7 @@ public function getState()
130132
* Valid Values: ["AUTHORIZATION"]
131133
*
132134
* @param string $reason_code
133-
*
135+
*
134136
* @return $this
135137
*/
136138
public function setReasonCode($reason_code)
@@ -154,7 +156,7 @@ public function getReasonCode()
154156
* Valid Values: ["AUTHORIZATION"]
155157
*
156158
* @param string $pending_reason
157-
*
159+
*
158160
* @return $this
159161
*/
160162
public function setPendingReason($pending_reason)
@@ -178,7 +180,7 @@ public function getPendingReason()
178180
* Valid Values: ["ELIGIBLE", "PARTIALLY_ELIGIBLE", "INELIGIBLE"]
179181
*
180182
* @param string $protection_eligibility
181-
*
183+
*
182184
* @return $this
183185
*/
184186
public function setProtectionEligibility($protection_eligibility)
@@ -202,7 +204,7 @@ public function getProtectionEligibility()
202204
* Valid Values: ["ITEM_NOT_RECEIVED_ELIGIBLE", "UNAUTHORIZED_PAYMENT_ELIGIBLE", "ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE"]
203205
*
204206
* @param string $protection_eligibility_type
205-
*
207+
*
206208
* @return $this
207209
*/
208210
public function setProtectionEligibilityType($protection_eligibility_type)
@@ -225,7 +227,7 @@ public function getProtectionEligibilityType()
225227
* Fraud Management Filter (FMF) details applied for the payment that could result in accept, deny, or pending action. Returned in a payment response only if the merchant has enabled FMF in the profile settings and one of the fraud filters was triggered based on those settings. See [Fraud Management Filters Summary](https://developer.paypal.com/docs/classic/fmf/integration-guide/FMFSummary/) for more information.
226228
*
227229
* @param \PayPal\Api\FmfDetails $fmf_details
228-
*
230+
*
229231
* @return $this
230232
*/
231233
public function setFmfDetails($fmf_details)
@@ -248,7 +250,7 @@ public function getFmfDetails()
248250
* ID of the Payment resource that this transaction is based on.
249251
*
250252
* @param string $parent_payment
251-
*
253+
*
252254
* @return $this
253255
*/
254256
public function setParentPayment($parent_payment)
@@ -294,7 +296,7 @@ public function getProcessorResponse()
294296
* Authorization expiration time and date as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
295297
*
296298
* @param string $valid_until
297-
*
299+
*
298300
* @return $this
299301
*/
300302
public function setValidUntil($valid_until)
@@ -317,7 +319,7 @@ public function getValidUntil()
317319
* Time of authorization as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
318320
*
319321
* @param string $create_time
320-
*
322+
*
321323
* @return $this
322324
*/
323325
public function setCreateTime($create_time)
@@ -340,7 +342,7 @@ public function getCreateTime()
340342
* Time that the resource was last updated.
341343
*
342344
* @param string $update_time
343-
*
345+
*
344346
* @return $this
345347
*/
346348
public function setUpdateTime($update_time)
@@ -360,11 +362,57 @@ public function getUpdateTime()
360362
}
361363

362364
/**
363-
* Retrieve details about a previously created authorization by passing the authorization_id in the request URI.
365+
* Identifier to the purchase or transaction unit corresponding to this authorization transaction.
366+
*
367+
* @param string $reference_id
368+
*
369+
* @return $this
370+
*/
371+
public function setReferenceId($reference_id)
372+
{
373+
$this->reference_id = $reference_id;
374+
return $this;
375+
}
376+
377+
/**
378+
* Identifier to the purchase or transaction unit corresponding to this authorization transaction.
379+
*
380+
* @return string
381+
*/
382+
public function getReferenceId()
383+
{
384+
return $this->reference_id;
385+
}
386+
387+
/**
388+
* Receipt id is 16 digit number payment identification number returned for guest users to identify the payment.
389+
*
390+
* @param string $receipt_id
391+
*
392+
* @return $this
393+
*/
394+
public function setReceiptId($receipt_id)
395+
{
396+
$this->receipt_id = $receipt_id;
397+
return $this;
398+
}
399+
400+
/**
401+
* Receipt id is 16 digit number payment identification number returned for guest users to identify the payment.
402+
*
403+
* @return string
404+
*/
405+
public function getReceiptId()
406+
{
407+
return $this->receipt_id;
408+
}
409+
410+
/**
411+
* Shows details for an authorization, by ID.
364412
*
365-
* @param string $authorizationId
366-
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
367-
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
413+
* @param string $authorizationId
414+
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
415+
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
368416
* @return Authorization
369417
*/
370418
public static function get($authorizationId, $apiContext = null, $restCall = null)
@@ -385,11 +433,11 @@ public static function get($authorizationId, $apiContext = null, $restCall = nul
385433
}
386434

387435
/**
388-
* Capture and process a previously created authorization by passing the authorization_id in the request URI. To use this request, the original payment call must have the intent set to authorize.
436+
* Captures and processes an authorization, by ID. To use this call, the original payment call must specify an intent of `authorize`.
389437
*
390-
* @param Capture $capture
391-
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
392-
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
438+
* @param Capture $capture
439+
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
440+
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
393441
* @return Capture
394442
*/
395443
public function capture($capture, $apiContext = null, $restCall = null)
@@ -411,10 +459,10 @@ public function capture($capture, $apiContext = null, $restCall = null)
411459
}
412460

413461
/**
414-
* Void (cancel) a previously authorized payment by passing the authorization_id in the request URI. Note that a fully captured authorization cannot be voided.
462+
* Voids, or cancels, an authorization, by ID. You cannot void a fully captured authorization.
415463
*
416-
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
417-
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
464+
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
465+
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
418466
* @return Authorization
419467
*/
420468
public function void($apiContext = null, $restCall = null)
@@ -434,10 +482,10 @@ public function void($apiContext = null, $restCall = null)
434482
}
435483

436484
/**
437-
* Reauthorize a PayPal account payment by passing the authorization_id in the request URI. You should reauthorize a payment after the initial 3-day honor period to ensure that funds are still available. Request supports only amount field
485+
* Reauthorizes a PayPal account payment, by authorization ID. To ensure that funds are still available, reauthorize a payment after the initial three-day honor period. Supports only the `amount` request parameter.
438486
*
439-
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
440-
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
487+
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
488+
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
441489
* @return Authorization
442490
*/
443491
public function reauthorize($apiContext = null, $restCall = null)

0 commit comments

Comments
 (0)