Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. /**
  2. * Payment code.
  3. *
  4. * @var string
  5. */
  6. protected $_code = 'ced_braintree';
  7.  
  8. protected $request;
  9. protected $_canAuthorize = true;
  10. protected $_canCapture = true;
  11. protected $_canUseInternal = false;
  12. protected $_logger;
  13. protected $_catalogSession;
  14.  
  15. public function __construct(
  16. MagentoFrameworkModelContext $context,
  17. MagentoFrameworkApiExtensionAttributesFactory $extensionFactory,
  18. MagentoFrameworkApiAttributeValueFactory $customAttributeFactory,
  19. MagentoPaymentHelperData $paymentData,
  20. MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
  21. MagentoPaymentModelMethodLogger $logger,
  22. array $data = []
  23. ) {
  24. parent::__construct(
  25. $context,
  26. $registry,
  27. $extensionFactory,
  28. $customAttributeFactory,
  29. $paymentData,
  30. $scopeConfig,
  31. $logger,
  32. null,
  33. null,
  34. $data
  35. );
  36.  
  37. }
  38.  
  39. public function assignData(DataObject $data)
  40. {
  41. print_r($data);die;
  42. //getting null value of card number,exp date and cvv
  43. if (!($data instanceof DataObject)) {
  44. $data = new DataObject($data);
  45. }
  46. $Cardinfo = $this->getInfoInstance();
  47. $Cardinfo->setCcType($data['additional_data']['cc_type'])
  48. ->setCcLast4(substr($data['additional_data']['cc_number'], -4))
  49. ->setCcNumber($data['additional_data']['cc_number'])
  50. ->setCcCid($data['additional_data']['cc_cid'])
  51. ->setCcExpMonth($data['additional_data']['cc_exp_month'])
  52. ->setCcExpYear($data['additional_data']['cc_exp_year']);
  53.  
  54. return $this;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement