Version 4.3.0
This commit is contained in:
1 parent
96997ddd8e
commit
fe1acf984a
1349 files changed
+116159
-67711
No files matched your search
@@ -113,7 +113,7 @@ class _CreditCard extends \IPS\nexus\Customer\CreditCard
|
||||
$this->member->cm_profiles = $profiles;
|
||||
$this->member->save();
|
||||
}
|
||||
|
||||
|
||||
/* Add the card */
|
||||
$xml = $this->createAuthenticationXml( 'createCustomerPaymentProfileRequest' );
|
||||
$xml->addChild( 'customerProfileId', $profiles[ $this->method->id ] );
|
||||
@@ -133,6 +133,12 @@ class _CreditCard extends \IPS\nexus\Customer\CreditCard
|
||||
throw new \UnexpectedValueException;
|
||||
}
|
||||
|
||||
/* Check it doesn't already exist */
|
||||
if ( count( \IPS\Db::i()->select( 'card_data', 'nexus_customer_cards', array( 'card_member=? AND card_method=? AND card_data=?', $this->member->member_id, $this->method->id, (string) $response->customerPaymentProfileId ) ) ) )
|
||||
{
|
||||
throw new \DomainException( \IPS\Member::loggedIn()->language()->addToStack('card_is_duplicate') );
|
||||
}
|
||||
|
||||
/* Save */
|
||||
$this->data = (string) $response->customerPaymentProfileId;
|
||||
$this->save();
|
||||
|
||||
Reference in new issue
Block a user