I want to add custom data in order payment extension attribute like below :-
"payment": {
"account_status": null,
"additional_information": [
"Credit Card",
"M",
"M",
"I",
"FXZDM9",
"1000",
"Approved",
"xxxx-1111",
"Visa"
],
"amount_authorized": 31.9,
"amount_ordered": 31.9,
"amount_paid": 31.9,
"base_amount_authorized": 31.9,
"base_amount_ordered": 31.9,
"base_amount_paid": 31.9,
"base_amount_paid_online": 31.9,
"base_shipping_amount": 9.95,
"base_shipping_captured": 9.95,
"cc_exp_month": "12",
"cc_exp_year": "2030",
"cc_last4": "1111",
"cc_trans_id": "m4ybzfr7",
"cc_type": "VI",
"entity_id": 70659,
"last_trans_id": "m4ybzfr7",
"method": "braintree",
"parent_id": 80005,
"shipping_amount": 9.95,
"shipping_captured": 9.95,
"extension_attributes": {
"vault_payment_token": {
"entity_id": 34386,
"customer_id": 76756,
"public_hash": "f0ad9e74cc52a78f499d318ee9e55fb479b0a757dbecb10849fbf960a5e84c5b",
"payment_method_code": "braintree",
"type": "card",
"created_at": "2017-11-15 13:20:54",
"expires_at": "2031-01-01 00:00:00",
"gateway_token": "7jfdwj",
"token_details": "{\"type\":\"VI\",\"maskedCC\":\"1111\",\"expirationDate\":\"12\\/2030\"}",
"is_active": true,
"is_visible": false
}
"custom_data": {
"key1" => "value1",
"key2" => "value2"
}
}
},
as above you can see, I want to add this
"custom_data": {
"key1" => "value1",
"key2" => "value2"
}
I have no idea how to do it, can anyone suggest me ?