Overview
  • Namespace
  • Class

Namespaces

  • PayPal
    • Api
    • Auth
    • Cache
    • Common
    • Converter
    • Core
    • Exception
    • Handler
    • Log
    • Rest
    • Security
    • Transport
    • Validation

Classes

  • PayPal\Api\Address
  • PayPal\Api\Agreement
  • PayPal\Api\AgreementDetails
  • PayPal\Api\AgreementStateDescriptor
  • PayPal\Api\AgreementTransaction
  • PayPal\Api\AgreementTransactions
  • PayPal\Api\AlternatePayment
  • PayPal\Api\Amount
  • PayPal\Api\Authorization
  • PayPal\Api\BankAccount
  • PayPal\Api\BankAccountsList
  • PayPal\Api\BankToken
  • PayPal\Api\BaseAddress
  • PayPal\Api\Billing
  • PayPal\Api\BillingAgreementToken
  • PayPal\Api\BillingInfo
  • PayPal\Api\CancelNotification
  • PayPal\Api\Capture
  • PayPal\Api\CarrierAccount
  • PayPal\Api\CarrierAccountToken
  • PayPal\Api\CartBase
  • PayPal\Api\ChargeModel
  • PayPal\Api\Cost
  • PayPal\Api\CountryCode
  • PayPal\Api\CreateProfileResponse
  • PayPal\Api\Credit
  • PayPal\Api\CreditCard
  • PayPal\Api\CreditCardHistory
  • PayPal\Api\CreditCardList
  • PayPal\Api\CreditCardToken
  • PayPal\Api\CreditFinancingOffered
  • PayPal\Api\Currency
  • PayPal\Api\CurrencyConversion
  • PayPal\Api\CustomAmount
  • PayPal\Api\DetailedRefund
  • PayPal\Api\Details
  • PayPal\Api\Error
  • PayPal\Api\ErrorDetails
  • PayPal\Api\ExtendedBankAccount
  • PayPal\Api\ExternalFunding
  • PayPal\Api\FileAttachment
  • PayPal\Api\FlowConfig
  • PayPal\Api\FmfDetails
  • PayPal\Api\FundingDetail
  • PayPal\Api\FundingInstrument
  • PayPal\Api\FundingOption
  • PayPal\Api\FundingSource
  • PayPal\Api\FuturePayment
  • PayPal\Api\HyperSchema
  • PayPal\Api\Image
  • PayPal\Api\Incentive
  • PayPal\Api\InputFields
  • PayPal\Api\InstallmentInfo
  • PayPal\Api\InstallmentOption
  • PayPal\Api\Invoice
  • PayPal\Api\InvoiceAddress
  • PayPal\Api\InvoiceItem
  • PayPal\Api\InvoiceNumber
  • PayPal\Api\InvoiceSearchResponse
  • PayPal\Api\Item
  • PayPal\Api\ItemList
  • PayPal\Api\Links
  • PayPal\Api\Measurement
  • PayPal\Api\MerchantInfo
  • PayPal\Api\MerchantPreferences
  • PayPal\Api\Metadata
  • PayPal\Api\NameValuePair
  • PayPal\Api\Notification
  • PayPal\Api\OpenIdAddress
  • PayPal\Api\OpenIdError
  • PayPal\Api\OpenIdSession
  • PayPal\Api\OpenIdTokeninfo
  • PayPal\Api\OpenIdUserinfo
  • PayPal\Api\Order
  • PayPal\Api\OverrideChargeModel
  • PayPal\Api\Participant
  • PayPal\Api\Patch
  • PayPal\Api\PatchRequest
  • PayPal\Api\Payee
  • PayPal\Api\Payer
  • PayPal\Api\PayerInfo
  • PayPal\Api\Payment
  • PayPal\Api\PaymentCard
  • PayPal\Api\PaymentCardToken
  • PayPal\Api\PaymentDefinition
  • PayPal\Api\PaymentDetail
  • PayPal\Api\PaymentExecution
  • PayPal\Api\PaymentHistory
  • PayPal\Api\PaymentInstruction
  • PayPal\Api\PaymentOptions
  • PayPal\Api\PaymentSummary
  • PayPal\Api\PaymentTerm
  • PayPal\Api\Payout
  • PayPal\Api\PayoutBatch
  • PayPal\Api\PayoutBatchHeader
  • PayPal\Api\PayoutItem
  • PayPal\Api\PayoutItemDetails
  • PayPal\Api\PayoutSenderBatchHeader
  • PayPal\Api\Phone
  • PayPal\Api\Plan
  • PayPal\Api\PlanList
  • PayPal\Api\PotentialPayerInfo
  • PayPal\Api\Presentation
  • PayPal\Api\PrivateLabelCard
  • PayPal\Api\ProcessorResponse
  • PayPal\Api\RecipientBankingInstruction
  • PayPal\Api\RedirectUrls
  • PayPal\Api\Refund
  • PayPal\Api\RefundDetail
  • PayPal\Api\RefundRequest
  • PayPal\Api\RelatedResources
  • PayPal\Api\Sale
  • PayPal\Api\Search
  • PayPal\Api\ShippingAddress
  • PayPal\Api\ShippingCost
  • PayPal\Api\ShippingInfo
  • PayPal\Api\Tax
  • PayPal\Api\Template
  • PayPal\Api\TemplateData
  • PayPal\Api\Templates
  • PayPal\Api\TemplateSettings
  • PayPal\Api\TemplateSettingsMetadata
  • PayPal\Api\Terms
  • PayPal\Api\Transaction
  • PayPal\Api\TransactionBase
  • PayPal\Api\Transactions
  • PayPal\Api\VerifyWebhookSignature
  • PayPal\Api\VerifyWebhookSignatureResponse
  • PayPal\Api\Webhook
  • PayPal\Api\WebhookEvent
  • PayPal\Api\WebhookEventList
  • PayPal\Api\WebhookEventType
  • PayPal\Api\WebhookEventTypeList
  • PayPal\Api\WebhookList
  • PayPal\Api\WebProfile
  • PayPal\Auth\OAuthTokenCredential
  • PayPal\Cache\AuthorizationCache
  • PayPal\Common\ArrayUtil
  • PayPal\Common\PayPalModel
  • PayPal\Common\PayPalResourceModel
  • PayPal\Common\PayPalUserAgent
  • PayPal\Common\ReflectionUtil
  • PayPal\Converter\FormatConverter
  • PayPal\Core\PayPalConfigManager
  • PayPal\Core\PayPalConstants
  • PayPal\Core\PayPalCredentialManager
  • PayPal\Core\PayPalHttpConfig
  • PayPal\Core\PayPalHttpConnection
  • PayPal\Core\PayPalLoggingManager
  • PayPal\Handler\OauthHandler
  • PayPal\Handler\RestHandler
  • PayPal\Log\PayPalDefaultLogFactory
  • PayPal\Log\PayPalLogger
  • PayPal\Rest\ApiContext
  • PayPal\Security\Cipher
  • PayPal\Transport\PayPalRestCall
  • PayPal\Validation\ArgumentValidator
  • PayPal\Validation\JsonValidator
  • PayPal\Validation\NumericValidator
  • PayPal\Validation\UrlValidator

Interfaces

  • PayPal\Handler\IPayPalHandler
  • PayPal\Log\PayPalLogFactory
  • PayPal\Rest\IResource

Exceptions

  • PayPal\Exception\PayPalConfigurationException
  • PayPal\Exception\PayPalConnectionException
  • PayPal\Exception\PayPalInvalidCredentialException
  • PayPal\Exception\PayPalMissingCredentialException
  1 <?php
  2 
  3 namespace PayPal\Api;
  4 
  5 use PayPal\Common\PayPalModel;
  6 use PayPal\Validation\UrlValidator;
  7 
  8 /**
  9  * Class CurrencyConversion
 10  *
 11  * Object used to store the currency conversion rate.
 12  *
 13  * @package PayPal\Api
 14  *
 15  * @property string conversion_date
 16  * @property string from_currency
 17  * @property string from_amount
 18  * @property string to_currency
 19  * @property string to_amount
 20  * @property string conversion_type
 21  * @property bool conversion_type_changeable
 22  * @property \PayPal\Api\Links[] links
 23  */
 24 class CurrencyConversion extends PayPalModel
 25 {
 26     /**
 27      * Date of validity for the conversion rate.
 28      *
 29      * @param string $conversion_date
 30      * 
 31      * @return $this
 32      */
 33     public function setConversionDate($conversion_date)
 34     {
 35         $this->conversion_date = $conversion_date;
 36         return $this;
 37     }
 38 
 39     /**
 40      * Date of validity for the conversion rate.
 41      *
 42      * @return string
 43      */
 44     public function getConversionDate()
 45     {
 46         return $this->conversion_date;
 47     }
 48 
 49     /**
 50      * 3 letter currency code
 51      *
 52      * @param string $from_currency
 53      * 
 54      * @return $this
 55      */
 56     public function setFromCurrency($from_currency)
 57     {
 58         $this->from_currency = $from_currency;
 59         return $this;
 60     }
 61 
 62     /**
 63      * 3 letter currency code
 64      *
 65      * @return string
 66      */
 67     public function getFromCurrency()
 68     {
 69         return $this->from_currency;
 70     }
 71 
 72     /**
 73      * Amount participating in currency conversion, set to 1 as default 
 74      *
 75      * @param string $from_amount
 76      * 
 77      * @return $this
 78      */
 79     public function setFromAmount($from_amount)
 80     {
 81         $this->from_amount = $from_amount;
 82         return $this;
 83     }
 84 
 85     /**
 86      * Amount participating in currency conversion, set to 1 as default 
 87      *
 88      * @return string
 89      */
 90     public function getFromAmount()
 91     {
 92         return $this->from_amount;
 93     }
 94 
 95     /**
 96      * 3 letter currency code
 97      *
 98      * @param string $to_currency
 99      * 
100      * @return $this
101      */
102     public function setToCurrency($to_currency)
103     {
104         $this->to_currency = $to_currency;
105         return $this;
106     }
107 
108     /**
109      * 3 letter currency code
110      *
111      * @return string
112      */
113     public function getToCurrency()
114     {
115         return $this->to_currency;
116     }
117 
118     /**
119      * Amount resulting from currency conversion.
120      *
121      * @param string $to_amount
122      * 
123      * @return $this
124      */
125     public function setToAmount($to_amount)
126     {
127         $this->to_amount = $to_amount;
128         return $this;
129     }
130 
131     /**
132      * Amount resulting from currency conversion.
133      *
134      * @return string
135      */
136     public function getToAmount()
137     {
138         return $this->to_amount;
139     }
140 
141     /**
142      * Field indicating conversion type applied.
143      * Valid Values: ["PAYPAL", "VENDOR"]
144      *
145      * @param string $conversion_type
146      * 
147      * @return $this
148      */
149     public function setConversionType($conversion_type)
150     {
151         $this->conversion_type = $conversion_type;
152         return $this;
153     }
154 
155     /**
156      * Field indicating conversion type applied.
157      *
158      * @return string
159      */
160     public function getConversionType()
161     {
162         return $this->conversion_type;
163     }
164 
165     /**
166      * Allow Payer to change conversion type.
167      *
168      * @param bool $conversion_type_changeable
169      * 
170      * @return $this
171      */
172     public function setConversionTypeChangeable($conversion_type_changeable)
173     {
174         $this->conversion_type_changeable = $conversion_type_changeable;
175         return $this;
176     }
177 
178     /**
179      * Allow Payer to change conversion type.
180      *
181      * @return bool
182      */
183     public function getConversionTypeChangeable()
184     {
185         return $this->conversion_type_changeable;
186     }
187 
188     /**
189      * Base URL to web applications endpoint
190      * Valid Values: ["https://www.paypal.com/{country_code}/webapps/xocspartaweb/webflow/sparta/proxwebflow", "https://www.paypal.com/{country_code}/proxflow"]
191      * @deprecated Not publicly available
192      * @param string $web_url
193      * @throws \InvalidArgumentException
194      * @return $this
195      */
196     public function setWebUrl($web_url)
197     {
198         UrlValidator::validate($web_url, "WebUrl");
199         $this->web_url = $web_url;
200         return $this;
201     }
202 
203     /**
204      * Base URL to web applications endpoint
205      * @deprecated Not publicly available
206      * @return string
207      */
208     public function getWebUrl()
209     {
210         return $this->web_url;
211     }
212 
213     /**
214      * Sets Links
215      *
216      * @param \PayPal\Api\Links[] $links
217      * 
218      * @return $this
219      */
220     public function setLinks($links)
221     {
222         $this->links = $links;
223         return $this;
224     }
225 
226     /**
227      * Gets Links
228      *
229      * @return \PayPal\Api\Links[]
230      */
231     public function getLinks()
232     {
233         return $this->links;
234     }
235 
236     /**
237      * Append Links to the list.
238      *
239      * @param \PayPal\Api\Links $links
240      * @return $this
241      */
242     public function addLink($links)
243     {
244         if (!$this->getLinks()) {
245             return $this->setLinks(array($links));
246         } else {
247             return $this->setLinks(
248                 array_merge($this->getLinks(), array($links))
249             );
250         }
251     }
252 
253     /**
254      * Remove Links from the list.
255      *
256      * @param \PayPal\Api\Links $links
257      * @return $this
258      */
259     public function removeLink($links)
260     {
261         return $this->setLinks(
262             array_diff($this->getLinks(), array($links))
263         );
264     }
265 
266 }
267 
API documentation generated by ApiGen