Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Payment code.
- *
- * @var string
- */
- protected $_code = 'ced_braintree';
- protected $request;
- protected $_canAuthorize = true;
- protected $_canCapture = true;
- protected $_canUseInternal = false;
- protected $_logger;
- protected $_catalogSession;
- public function __construct(
- MagentoFrameworkModelContext $context,
- MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
- MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
- MagentoPaymentHelperData $paymentData,
- MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
- MagentoPaymentModelMethodLogger $logger,
- array $data = []
- ) {
- parent::__construct(
- $context,
- $registry,
- $extensionFactory,
- $customAttributeFactory,
- $paymentData,
- $scopeConfig,
- $logger,
- null,
- null,
- $data
- );
- }
- public function assignData(DataObject $data)
- {
- print_r($data);die;
- //getting null value of card number,exp date and cvv
- if (!($data instanceof DataObject)) {
- $data = new DataObject($data);
- }
- $Cardinfo = $this->getInfoInstance();
- $Cardinfo->setCcType($data['additional_data']['cc_type'])
- ->setCcLast4(substr($data['additional_data']['cc_number'], -4))
- ->setCcNumber($data['additional_data']['cc_number'])
- ->setCcCid($data['additional_data']['cc_cid'])
- ->setCcExpMonth($data['additional_data']['cc_exp_month'])
- ->setCcExpYear($data['additional_data']['cc_exp_year']);
- return $this;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement