Magneto 2 Payment module - cannot get credit card number Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!

What initially awakened the Balrog?

Do wooden building fires get hotter than 600°C?

Morning, Afternoon, Night Kanji

Why does the remaining Rebel fleet at the end of Rogue One seem dramatically larger than the one in A New Hope?

Trademark violation for app?

How to install press fit bottom bracket into new frame

Is grep documentation about ignoring case wrong, since it doesn't ignore case in filenames?

What is the difference between globalisation and imperialism?

Converted a Scalar function to a TVF function for parallel execution-Still running in Serial mode

Is it a good idea to use CNN to classify 1D signal?

How does light 'choose' between wave and particle behaviour?

Most bit efficient text communication method?

What is a fractional matching?

AppleTVs create a chatty alternate WiFi network

Why should I vote and accept answers?

What does it mean that physics no longer uses mechanical models to describe phenomena?

How to write the following sign?

If Windows 7 doesn't support WSL, then what does Linux subsystem option mean?

Significance of Cersei's obsession with elephants?

Crossing US/Canada Border for less than 24 hours

Is there hard evidence that the grant peer review system performs significantly better than random?

How to compare two different files line by line in unix?

What is the appropriate index architecture when forced to implement IsDeleted (soft deletes)?

What is "gratricide"?



Magneto 2 Payment module - cannot get credit card number



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I have the following code but cannot get the credit card information to come through. I echo it and it just shows blank. Not sure why. Any help is appreciated





namespace CytruslogicSubscriptionsModel;
use StripeStripe;
/**
* Pay In Store payment method model
*/
class StripeSubscriptions extends MagentoPaymentModelMethodAbstractMethod


/**
* Payment code
*
* @var string
*/

CONST CODE = 'stripesubscriptions';
protected $_code = self::CODE;

/**
* Availability option
*
* @var bool
*/
protected $_isOffline = false;

protected $_isGateway = true;
protected $_canCapture = true;
protected $_canAuthorize = true;




public function capture(MagentoPaymentModelInfoInterface $Payment, $Amount)


echo $Payment->getCcType();
throw new MagentoFrameworkExceptionLocalizedException(__('Testing'));

// echo $payment->getCcNumber();

/** @var MagentoSalesModelOrderAddress $billing */
/*
$billing = $order->getBillingAddress();

try
$requestData = [
'amount' => $amount * 100,
'currency' => strtolower($order->getBaseCurrencyCode()),
'description' => sprintf('#%s, %s', $order->getIncrementId(), $order->getCustomerEmail()),
'card' => [
'number' => $payment->getCcNumber(),
'exp_month' => sprintf('%02d',$payment->getCcExpMonth()),
'exp_year' => $payment->getCcExpYear(),
'cvc' => $payment->getCcCid(),
'name' => $billing->getName(),
'address_line1' => $billing->getStreetLine(1),
'address_line2' => $billing->getStreetLine(2),
'address_city' => $billing->getCity(),
'address_zip' => $billing->getPostcode(),
'address_state' => $billing->getRegion(),
'address_country' => $billing->getCountryId(),
// To get full localized country name, use this instead:
// 'address_country' => $this->_countryFactory->create()->loadByCode($billing->getCountryId())->getName(),
]
];

$charge = StripeCharge::create($requestData);
$payment
->setTransactionId($charge->id)
->setIsTransactionClosed(0);
catch (Exception $e)
$this->debugData(['request' => $requestData, 'exception' => $e->getMessage()]);
$this->_logger->error(__('Payment capturing error.'));
throw new MagentoFrameworkValidatorException(__('Payment capturing error.'));

*/
return $this;


public function authorize(MagentoPaymentModelInfoInterface $Payment, $Amount)

echo 'authorize';

$Order = $Payment->getOrder();

print_r($Payment->getCcNumber());


public function getConfigPaymentAction()

return self::ACTION_AUTHORIZE_CAPTURE;


/**
* Test method to handle an API call for authorization request.
*
* @param $request
* @return array
* @throws MagentoFrameworkExceptionLocalizedException
*/
public function makeAuthRequest($request)

$response = ['transactionId' => 123]; //todo implement API call for auth request.

if(!$response)
throw new MagentoFrameworkExceptionLocalizedException(__('Failed auth request.'));


return $response;


/**
* Test method to handle an API call for capture request.
*
* @param $request
* @return array
* @throws MagentoFrameworkExceptionLocalizedException
*/
public function makeCaptureRequest($request)

$response = ['success']; //todo implement API call for capture request.

if(!$response)
throw new MagentoFrameworkExceptionLocalizedException(__('Failed capture request.'));


return $response;













share|improve this question






















  • Hi, Welcome to Stack Overflow. Help us help you, by providing a detailed explanation of what is going on. What are you echo'ing? What value do you expect to see? Where do you expect to see these values from? How can you test that this is or is not working? "I echo it and it just shows blank. Not sure why." Isn't much help for the community to help you. Expand on your answer and I'm sure you'll have better luck receiving some help.

    – domdambrogia
    Mar 8 at 21:14











  • Thee values come from the payment form in the magento checkout. I expect $Payment->getCcType() to return a valid credit card type. I see this in the console in the frontend when I click on place order.

    – user3098629
    Mar 8 at 22:29

















0















I have the following code but cannot get the credit card information to come through. I echo it and it just shows blank. Not sure why. Any help is appreciated





namespace CytruslogicSubscriptionsModel;
use StripeStripe;
/**
* Pay In Store payment method model
*/
class StripeSubscriptions extends MagentoPaymentModelMethodAbstractMethod


/**
* Payment code
*
* @var string
*/

CONST CODE = 'stripesubscriptions';
protected $_code = self::CODE;

/**
* Availability option
*
* @var bool
*/
protected $_isOffline = false;

protected $_isGateway = true;
protected $_canCapture = true;
protected $_canAuthorize = true;




public function capture(MagentoPaymentModelInfoInterface $Payment, $Amount)


echo $Payment->getCcType();
throw new MagentoFrameworkExceptionLocalizedException(__('Testing'));

// echo $payment->getCcNumber();

/** @var MagentoSalesModelOrderAddress $billing */
/*
$billing = $order->getBillingAddress();

try
$requestData = [
'amount' => $amount * 100,
'currency' => strtolower($order->getBaseCurrencyCode()),
'description' => sprintf('#%s, %s', $order->getIncrementId(), $order->getCustomerEmail()),
'card' => [
'number' => $payment->getCcNumber(),
'exp_month' => sprintf('%02d',$payment->getCcExpMonth()),
'exp_year' => $payment->getCcExpYear(),
'cvc' => $payment->getCcCid(),
'name' => $billing->getName(),
'address_line1' => $billing->getStreetLine(1),
'address_line2' => $billing->getStreetLine(2),
'address_city' => $billing->getCity(),
'address_zip' => $billing->getPostcode(),
'address_state' => $billing->getRegion(),
'address_country' => $billing->getCountryId(),
// To get full localized country name, use this instead:
// 'address_country' => $this->_countryFactory->create()->loadByCode($billing->getCountryId())->getName(),
]
];

$charge = StripeCharge::create($requestData);
$payment
->setTransactionId($charge->id)
->setIsTransactionClosed(0);
catch (Exception $e)
$this->debugData(['request' => $requestData, 'exception' => $e->getMessage()]);
$this->_logger->error(__('Payment capturing error.'));
throw new MagentoFrameworkValidatorException(__('Payment capturing error.'));

*/
return $this;


public function authorize(MagentoPaymentModelInfoInterface $Payment, $Amount)

echo 'authorize';

$Order = $Payment->getOrder();

print_r($Payment->getCcNumber());


public function getConfigPaymentAction()

return self::ACTION_AUTHORIZE_CAPTURE;


/**
* Test method to handle an API call for authorization request.
*
* @param $request
* @return array
* @throws MagentoFrameworkExceptionLocalizedException
*/
public function makeAuthRequest($request)

$response = ['transactionId' => 123]; //todo implement API call for auth request.

if(!$response)
throw new MagentoFrameworkExceptionLocalizedException(__('Failed auth request.'));


return $response;


/**
* Test method to handle an API call for capture request.
*
* @param $request
* @return array
* @throws MagentoFrameworkExceptionLocalizedException
*/
public function makeCaptureRequest($request)

$response = ['success']; //todo implement API call for capture request.

if(!$response)
throw new MagentoFrameworkExceptionLocalizedException(__('Failed capture request.'));


return $response;













share|improve this question






















  • Hi, Welcome to Stack Overflow. Help us help you, by providing a detailed explanation of what is going on. What are you echo'ing? What value do you expect to see? Where do you expect to see these values from? How can you test that this is or is not working? "I echo it and it just shows blank. Not sure why." Isn't much help for the community to help you. Expand on your answer and I'm sure you'll have better luck receiving some help.

    – domdambrogia
    Mar 8 at 21:14











  • Thee values come from the payment form in the magento checkout. I expect $Payment->getCcType() to return a valid credit card type. I see this in the console in the frontend when I click on place order.

    – user3098629
    Mar 8 at 22:29













0












0








0








I have the following code but cannot get the credit card information to come through. I echo it and it just shows blank. Not sure why. Any help is appreciated





namespace CytruslogicSubscriptionsModel;
use StripeStripe;
/**
* Pay In Store payment method model
*/
class StripeSubscriptions extends MagentoPaymentModelMethodAbstractMethod


/**
* Payment code
*
* @var string
*/

CONST CODE = 'stripesubscriptions';
protected $_code = self::CODE;

/**
* Availability option
*
* @var bool
*/
protected $_isOffline = false;

protected $_isGateway = true;
protected $_canCapture = true;
protected $_canAuthorize = true;




public function capture(MagentoPaymentModelInfoInterface $Payment, $Amount)


echo $Payment->getCcType();
throw new MagentoFrameworkExceptionLocalizedException(__('Testing'));

// echo $payment->getCcNumber();

/** @var MagentoSalesModelOrderAddress $billing */
/*
$billing = $order->getBillingAddress();

try
$requestData = [
'amount' => $amount * 100,
'currency' => strtolower($order->getBaseCurrencyCode()),
'description' => sprintf('#%s, %s', $order->getIncrementId(), $order->getCustomerEmail()),
'card' => [
'number' => $payment->getCcNumber(),
'exp_month' => sprintf('%02d',$payment->getCcExpMonth()),
'exp_year' => $payment->getCcExpYear(),
'cvc' => $payment->getCcCid(),
'name' => $billing->getName(),
'address_line1' => $billing->getStreetLine(1),
'address_line2' => $billing->getStreetLine(2),
'address_city' => $billing->getCity(),
'address_zip' => $billing->getPostcode(),
'address_state' => $billing->getRegion(),
'address_country' => $billing->getCountryId(),
// To get full localized country name, use this instead:
// 'address_country' => $this->_countryFactory->create()->loadByCode($billing->getCountryId())->getName(),
]
];

$charge = StripeCharge::create($requestData);
$payment
->setTransactionId($charge->id)
->setIsTransactionClosed(0);
catch (Exception $e)
$this->debugData(['request' => $requestData, 'exception' => $e->getMessage()]);
$this->_logger->error(__('Payment capturing error.'));
throw new MagentoFrameworkValidatorException(__('Payment capturing error.'));

*/
return $this;


public function authorize(MagentoPaymentModelInfoInterface $Payment, $Amount)

echo 'authorize';

$Order = $Payment->getOrder();

print_r($Payment->getCcNumber());


public function getConfigPaymentAction()

return self::ACTION_AUTHORIZE_CAPTURE;


/**
* Test method to handle an API call for authorization request.
*
* @param $request
* @return array
* @throws MagentoFrameworkExceptionLocalizedException
*/
public function makeAuthRequest($request)

$response = ['transactionId' => 123]; //todo implement API call for auth request.

if(!$response)
throw new MagentoFrameworkExceptionLocalizedException(__('Failed auth request.'));


return $response;


/**
* Test method to handle an API call for capture request.
*
* @param $request
* @return array
* @throws MagentoFrameworkExceptionLocalizedException
*/
public function makeCaptureRequest($request)

$response = ['success']; //todo implement API call for capture request.

if(!$response)
throw new MagentoFrameworkExceptionLocalizedException(__('Failed capture request.'));


return $response;













share|improve this question














I have the following code but cannot get the credit card information to come through. I echo it and it just shows blank. Not sure why. Any help is appreciated





namespace CytruslogicSubscriptionsModel;
use StripeStripe;
/**
* Pay In Store payment method model
*/
class StripeSubscriptions extends MagentoPaymentModelMethodAbstractMethod


/**
* Payment code
*
* @var string
*/

CONST CODE = 'stripesubscriptions';
protected $_code = self::CODE;

/**
* Availability option
*
* @var bool
*/
protected $_isOffline = false;

protected $_isGateway = true;
protected $_canCapture = true;
protected $_canAuthorize = true;




public function capture(MagentoPaymentModelInfoInterface $Payment, $Amount)


echo $Payment->getCcType();
throw new MagentoFrameworkExceptionLocalizedException(__('Testing'));

// echo $payment->getCcNumber();

/** @var MagentoSalesModelOrderAddress $billing */
/*
$billing = $order->getBillingAddress();

try
$requestData = [
'amount' => $amount * 100,
'currency' => strtolower($order->getBaseCurrencyCode()),
'description' => sprintf('#%s, %s', $order->getIncrementId(), $order->getCustomerEmail()),
'card' => [
'number' => $payment->getCcNumber(),
'exp_month' => sprintf('%02d',$payment->getCcExpMonth()),
'exp_year' => $payment->getCcExpYear(),
'cvc' => $payment->getCcCid(),
'name' => $billing->getName(),
'address_line1' => $billing->getStreetLine(1),
'address_line2' => $billing->getStreetLine(2),
'address_city' => $billing->getCity(),
'address_zip' => $billing->getPostcode(),
'address_state' => $billing->getRegion(),
'address_country' => $billing->getCountryId(),
// To get full localized country name, use this instead:
// 'address_country' => $this->_countryFactory->create()->loadByCode($billing->getCountryId())->getName(),
]
];

$charge = StripeCharge::create($requestData);
$payment
->setTransactionId($charge->id)
->setIsTransactionClosed(0);
catch (Exception $e)
$this->debugData(['request' => $requestData, 'exception' => $e->getMessage()]);
$this->_logger->error(__('Payment capturing error.'));
throw new MagentoFrameworkValidatorException(__('Payment capturing error.'));

*/
return $this;


public function authorize(MagentoPaymentModelInfoInterface $Payment, $Amount)

echo 'authorize';

$Order = $Payment->getOrder();

print_r($Payment->getCcNumber());


public function getConfigPaymentAction()

return self::ACTION_AUTHORIZE_CAPTURE;


/**
* Test method to handle an API call for authorization request.
*
* @param $request
* @return array
* @throws MagentoFrameworkExceptionLocalizedException
*/
public function makeAuthRequest($request)

$response = ['transactionId' => 123]; //todo implement API call for auth request.

if(!$response)
throw new MagentoFrameworkExceptionLocalizedException(__('Failed auth request.'));


return $response;


/**
* Test method to handle an API call for capture request.
*
* @param $request
* @return array
* @throws MagentoFrameworkExceptionLocalizedException
*/
public function makeCaptureRequest($request)

$response = ['success']; //todo implement API call for capture request.

if(!$response)
throw new MagentoFrameworkExceptionLocalizedException(__('Failed capture request.'));


return $response;










magento-2.3






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 8 at 20:32









user3098629user3098629

2314




2314












  • Hi, Welcome to Stack Overflow. Help us help you, by providing a detailed explanation of what is going on. What are you echo'ing? What value do you expect to see? Where do you expect to see these values from? How can you test that this is or is not working? "I echo it and it just shows blank. Not sure why." Isn't much help for the community to help you. Expand on your answer and I'm sure you'll have better luck receiving some help.

    – domdambrogia
    Mar 8 at 21:14











  • Thee values come from the payment form in the magento checkout. I expect $Payment->getCcType() to return a valid credit card type. I see this in the console in the frontend when I click on place order.

    – user3098629
    Mar 8 at 22:29

















  • Hi, Welcome to Stack Overflow. Help us help you, by providing a detailed explanation of what is going on. What are you echo'ing? What value do you expect to see? Where do you expect to see these values from? How can you test that this is or is not working? "I echo it and it just shows blank. Not sure why." Isn't much help for the community to help you. Expand on your answer and I'm sure you'll have better luck receiving some help.

    – domdambrogia
    Mar 8 at 21:14











  • Thee values come from the payment form in the magento checkout. I expect $Payment->getCcType() to return a valid credit card type. I see this in the console in the frontend when I click on place order.

    – user3098629
    Mar 8 at 22:29
















Hi, Welcome to Stack Overflow. Help us help you, by providing a detailed explanation of what is going on. What are you echo'ing? What value do you expect to see? Where do you expect to see these values from? How can you test that this is or is not working? "I echo it and it just shows blank. Not sure why." Isn't much help for the community to help you. Expand on your answer and I'm sure you'll have better luck receiving some help.

– domdambrogia
Mar 8 at 21:14





Hi, Welcome to Stack Overflow. Help us help you, by providing a detailed explanation of what is going on. What are you echo'ing? What value do you expect to see? Where do you expect to see these values from? How can you test that this is or is not working? "I echo it and it just shows blank. Not sure why." Isn't much help for the community to help you. Expand on your answer and I'm sure you'll have better luck receiving some help.

– domdambrogia
Mar 8 at 21:14













Thee values come from the payment form in the magento checkout. I expect $Payment->getCcType() to return a valid credit card type. I see this in the console in the frontend when I click on place order.

– user3098629
Mar 8 at 22:29





Thee values come from the payment form in the magento checkout. I expect $Payment->getCcType() to return a valid credit card type. I see this in the console in the frontend when I click on place order.

– user3098629
Mar 8 at 22:29












0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55070592%2fmagneto-2-payment-module-cannot-get-credit-card-number%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55070592%2fmagneto-2-payment-module-cannot-get-credit-card-number%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

1928 у кіно

Захаров Федір Захарович

Ель Греко