Version 4.2.0
This commit is contained in:
1 parent
0dc2aee5ed
commit
96997ddd8e
2074 files changed
+125454
-55780
No files matched your search
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief PayPal Gateway
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Community Suite
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @subpackage Nexus
|
||||
* @since 10 Feb 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\nexus\Gateway;
|
||||
@@ -115,7 +114,7 @@ class _PayPal extends \IPS\nexus\Gateway
|
||||
}
|
||||
break;
|
||||
case 'ILS':
|
||||
if ( $amount->amount->compare( new \IPS\Math\Number( '40000 ' ) ) !== -1 )
|
||||
if ( $amount->amount->compare( new \IPS\Math\Number( '40000' ) ) !== -1 )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -256,20 +255,20 @@ class _PayPal extends \IPS\nexus\Gateway
|
||||
/**
|
||||
* Payment Screen Fields
|
||||
*
|
||||
* @param \IPS\nexus\Invoice $invoice Invoice
|
||||
* @param \IPS\nexus\Money $amount The amount to pay now
|
||||
* @param \IPS\Member $member The member the payment screen is for (if in the ACP charging to a member's card) or NULL for currently logged in member
|
||||
* @param array $recurrings Details about recurring costs
|
||||
* @param \IPS\nexus\Invoice $invoice Invoice
|
||||
* @param \IPS\nexus\Money $amount The amount to pay now
|
||||
* @param \IPS\nexus\Customer $member The member the payment screen is for (if in the ACP charging to a member's card) or NULL for currently logged in member
|
||||
* @param array $recurrings Details about recurring costs
|
||||
* @return array
|
||||
*/
|
||||
public function paymentScreen( \IPS\nexus\Invoice $invoice, \IPS\nexus\Money $amount, \IPS\Member $member = NULL, $recurrings = array() )
|
||||
public function paymentScreen( \IPS\nexus\Invoice $invoice, \IPS\nexus\Money $amount, \IPS\nexus\Customer $member = NULL, $recurrings = array() )
|
||||
{
|
||||
$settings = json_decode( $this->settings, TRUE );
|
||||
if ( $settings['type'] === 'card' )
|
||||
{
|
||||
return array( 'card' => new \IPS\nexus\Form\CreditCard( $this->id . '_card', NULL, FALSE, array(
|
||||
'types' => array( \IPS\nexus\CreditCard::TYPE_VISA, \IPS\nexus\CreditCard::TYPE_MASTERCARD, \IPS\nexus\CreditCard::TYPE_DISCOVER, \IPS\nexus\CreditCard::TYPE_AMERICAN_EXPRESS ),
|
||||
'save' => ( $settings['vault'] and \IPS\Member::loggedIn()->member_id ) ? $this : NULL,
|
||||
'save' => $settings['vault'] ? $this : NULL,
|
||||
'member' => $member
|
||||
) ) );
|
||||
}
|
||||
@@ -346,6 +345,13 @@ class _PayPal extends \IPS\nexus\Gateway
|
||||
/* New Card */
|
||||
else
|
||||
{
|
||||
if ( $card->save and !$transaction->member->member_id )
|
||||
{
|
||||
$transaction->member = $transaction->invoice->createAccountForGuest();
|
||||
\IPS\Session::i()->setMember( $transaction->member );
|
||||
\IPS\Member\Device::loadOrCreate( $transaction->member, FALSE )->updateAfterAuthentication( NULL );
|
||||
}
|
||||
|
||||
if ( $maxMind )
|
||||
{
|
||||
$maxMind->setCard( $card );
|
||||
@@ -376,7 +382,7 @@ class _PayPal extends \IPS\nexus\Gateway
|
||||
'type' => $cardType,
|
||||
'expire_month' => intval( $card->expMonth ),
|
||||
'expire_year' => intval( $card->expYear ),
|
||||
'cvv2' => intval( $card->ccv ),
|
||||
'cvv2' => $card->ccv,
|
||||
'first_name' => $this->_getFirstName( $transaction ),
|
||||
'last_name' => $this->_getLastName( $transaction ),
|
||||
'billing_address' => $this->_getAddress( $transaction->invoice->billaddress, $transaction->member )
|
||||
@@ -402,7 +408,7 @@ class _PayPal extends \IPS\nexus\Gateway
|
||||
|
||||
/* Save the card first if the user wants */
|
||||
if ( $card->save )
|
||||
{
|
||||
{
|
||||
try
|
||||
{
|
||||
$storedCard = new \IPS\nexus\Gateway\PayPal\CreditCard;
|
||||
|
||||
Reference in new issue
Block a user