2

I am adding a token in payment additional data

 getData: function () {
            return {
                'method': "pay_cc",
                'additional_data': {
                    'token_code': this.getToken(),
                }
            };
        },

setting this 'token_code' with function

            getToken:function(){
            return this.paymentToken;
        },

before place order I am generating token and setting setting this before calling 'self.plcaseOrder()' function

this.paymentToken = response[0];
console.log("TOKEN CODE");
console.log(this.paymentToken);
self.placeOrder();
return true;

When I access this in magento payment method authorize function I am getting null.

How Can I set this token_code??

0

For security reasons, Magento dev team removed "auto-saving" additional data into payment and you need to set the payment token from additional_data to additional_information. This dev guide describes how to do it.

As an example, Magento Vault uses the publish hash received from the front end to store it in a payment information.

  • I am implementing custom payment method, even though I am not able to pass my additional data? – Charlie Aug 28 '17 at 11:57
  • You should not use additional data on the backend, use additional information instead. – joni jones Aug 28 '17 at 12:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.