PATH:
home
/
letacommog
/
laindinois
/
wp-content
/
plugins
/
wiloke-listing-tools
/
app
/
Framework
/
Payment
/
PayPal
<?php namespace WilokeListingTools\Framework\Payment\PayPal; use WilokeListingTools\Framework\Payment\Invoice\PrePareInvoiceFormatInterface; use WilokeListingTools\Framework\Payment\Invoice\RecurringPaymentPrepareInvoiceFormatAbstract; final class PayPalRecurringPrepareInvoiceFormat extends RecurringPaymentPrepareInvoiceFormatAbstract implements PrePareInvoiceFormatInterface { /** * @var PayPalWebhook */ private $oPayPalWebhook; /** * PayPalNonRecurringPrepareInvoiceFormat constructor. * * @param PayPalWebhook $oPayPalWebhook */ public function __construct(PayPalWebhook $oPayPalWebhook) { $this->oPayPalWebhook = $oPayPalWebhook; } public function setCurrency() { $this->aParams['currency'] = strtolower($this->oPayPalWebhook->oEvent->resource->amount->currency); return $this; } public function setTotal() { $this->aParams['total'] = floatval($this->oPayPalWebhook->oEvent->resource->amount->total); return $this; } public function setTax() { $this->aParams['tax'] = floatval($this->oPayPalWebhook->aPaymentMeta['tax']); return $this; } public function setSubTotal() { $total = floatval($this->oPayPalWebhook->oEvent->resource->amount->details->subtotal); if ($total === 0) { $this->aParams['subTotal'] = 0; } else { $this->aParams['subTotal'] = floatval($this->oPayPalWebhook->aPaymentMeta['subTotal']); } return $this; } /** * We would not put discount price to Stripe directly, We save to Payment Meta instead. This is also reason * why we won't have to reConvertedZeroDecimal * * @return $this */ public function setDiscount() { $this->aParams['discount'] = 0; return $this; } public function setToken() { $this->aParams['token'] = $this->oPayPalWebhook->oEvent->id; return $this; } public function prepareInvoiceParam() { $this->setCurrency()->setToken()->setTotal()->setTax()->setDiscount()->setSubTotal(); return $this; } }
[+]
..
[-] PayPalConfiguration.php
[edit]
[-] PayPalRefundNonRecurringPayment.php
[edit]
[-] Webhook.php
[edit]
[-] PayPalRecurringPaymentMethod.php
[edit]
[-] PayPalExecuteRecurringPayment.php
[edit]
[-] PayPalProceededRecurringPaymentHook.php
[edit]
[-] PayPalCancelPlan.php
[edit]
[-] PayPalHelps.php
[edit]
[-] PayPalWebhook.php
[edit]
[-] PayPalGetBillingAgreement.php
[edit]
[-] PayPalAuthentication.php
[edit]
[-] PayPalSuspendPlan.php
[edit]
[-] PayPalValidations.php
[edit]
[-] cert_key.pem
[edit]
[-] PayPalExecuteInterface.php
[edit]
[-] PayPalRecurringPrepareInvoiceFormat.php
[edit]
[-] ConvertPayPalStatusToWilokeStatus.php
[edit]
[-] PayPalChangePlan.php
[edit]
[-] PayPalSetupAPIContext.php
[edit]
[-] PayPalNonRecurringPrepareInvoiceFormat.php
[edit]
[-] PayPalNonRecurringPaymentMethod.php
[edit]
[-] PayPalCancelRecurringPayment.php
[edit]
[-] PayPalExecutePaymentAbstract.php
[edit]
[-] PayPalProceededNonRecurringPaymentHook.php
[edit]
[-] PayPalNonRecurringCreatedPaymentHook.php
[edit]
[-] RemainingItemsInNonRecurringPayPal.php
[edit]
[-] PaypalUpdateBillingAgreement.php
[edit]
[-] ChangePlan.php
[edit]
[-] PayPalReactivePlan.php
[edit]
[-] PayPalExecutePromotionPayment.php
[edit]
[-] PayPalGetSubscriptionStatus.php
[edit]
[-] PayPalRecurringCreatedPaymentHook.php
[edit]
[-] PayPalGenerateUrls.php
[edit]
[-] PayPalExecuteNonRecurringPayment.php
[edit]