Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP7 Decoder for ionCube Encoder)
- *
- * @ Version : 4.1.0.1
- * @ Author : DeZender
- * @ Release on : 29.08.2020
- * @ Official site : http://DeZender.Net
- *
- */
- function paypal_config()
- {
- return [
- 'FriendlyName' => ['Type' => 'System', 'Value' => 'PayPal Basic'],
- 'UsageNotes' => ['Type' => 'System', 'Value' => 'Please ensure Instant Payment Notification (IPN) is enabled under Selling Preferences within your PayPal account. Paypal requires the Notification URL to be set to a valid URL, we recommend setting it to: ' . App::getSystemUrl()],
- 'email' => ['FriendlyName' => 'PayPal Email', 'Type' => 'text', 'Size' => '40'],
- 'forceonetime' => ['FriendlyName' => 'Force One Time Payments', 'Type' => 'yesno', 'Description' => 'Never show the subscription payment button'],
- 'forcesubscriptions' => ['FriendlyName' => 'Force Subscriptions', 'Type' => 'yesno', 'Description' => 'Hide the one time payment button when a subscription can be created'],
- 'requireshipping' => ['FriendlyName' => 'Require Shipping Address', 'Type' => 'yesno', 'Description' => 'Tick this box to request a shipping address from a user on PayPal\'s site'],
- 'overrideaddress' => ['FriendlyName' => 'Client Address Matching', 'Type' => 'yesno', 'Description' => 'Tick this box to force using client profile information entered into WHMCS at PayPal'],
- 'apiusername' => ['FriendlyName' => 'API Username', 'Type' => 'text', 'Size' => '40', 'Description' => 'API Details are required for Refunds and Subscription cancellations'],
- 'apipassword' => ['FriendlyName' => 'API Password', 'Type' => 'text', 'Size' => '40'],
- 'apisignature' => ['FriendlyName' => 'API Signature', 'Type' => 'text', 'Size' => '70'],
- 'sandbox' => ['FriendlyName' => 'Sandbox Mode', 'Type' => 'yesno', 'Description' => 'Tick to use PayPal’s Virtual Sandbox Test Environment - requires a separate Sandbox Test Account']
- ];
- }
- function paypal_link($params)
- {
- if (isset($params['sandbox']) && $params['sandbox']) {
- $url = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
- }
- else {
- $url = 'https://www.paypal.com/cgi-bin/webscr';
- }
- $invoiceid = $params['invoiceid'];
- $paypalemails = $params['email'];
- $paypalemails = explode(',', $paypalemails);
- $paypalemail = trim($paypalemails[0]);
- $upgrade = false;
- $recurrings = getRecurringBillingValues($invoiceid);
- if (!$recurrings) {
- try {
- $recurrings = getUpgradeRecurringValues($invoiceid);
- if ($recurrings) {
- $upgrade = true;
- }
- }
- catch (Exception $e) {
- }
- }
- $primaryserviceid = $recurrings['primaryserviceid'];
- if ($upgrade) {
- $primaryserviceid = 'U' . $primaryserviceid;
- }
- $firstpaymentamount = $recurrings['firstpaymentamount'];
- $firstcycleperiod = $recurrings['firstcycleperiod'];
- $firstcycleunits = strtoupper(substr($recurrings['firstcycleunits'], 0, 1));
- $recurringamount = $recurrings['recurringamount'];
- $recurringcycleperiod = $recurrings['recurringcycleperiod'];
- $recurringcycleunits = strtoupper(substr($recurrings['recurringcycleunits'], 0, 1));
- $firstpaymentamount = WHMCS\View\Formatter\Price::adjustDecimals($firstpaymentamount, $params['currency']);
- $recurringamount = WHMCS\View\Formatter\Price::adjustDecimals($recurringamount, $params['currency']);
- $params['amount'] = WHMCS\View\Formatter\Price::adjustDecimals($params['amount'], $params['currency']);
- if (($params['clientdetails']['country'] == 'US') || ($params['clientdetails']['country'] == 'CA')) {
- $phonenumber = preg_replace('/[^0-9]/', '', $params['clientdetails']['phonenumber']);
- $phone1 = substr($phonenumber, 0, 3);
- $phone2 = substr($phonenumber, 3, 3);
- $phone3 = substr($phonenumber, 6);
- }
- else {
- $phone1 = $params['clientdetails']['phonecc'];
- $phone2 = $params['clientdetails']['phonenumber'];
- }
- $subnotpossible = false;
- if (!$recurrings) {
- $subnotpossible = true;
- }
- if ($recurrings['overdue']) {
- $subnotpossible = true;
- }
- if (isset($params['forceonetime']) && $params['forceonetime']) {
- $subnotpossible = true;
- }
- if ($recurringamount <= 0) {
- $subnotpossible = true;
- }
- if ((90 < $firstcycleperiod) && ($firstcycleunits == 'D')) {
- $subnotpossible = true;
- .............................................................................
- ............................................
- .................
Add Comment
Please, Sign In to add comment