clearhaus / aliquot Goto Github PK
View Code? Open in Web Editor NEWGoogle Token Handler/Decrypter.
License: MIT License
Google Token Handler/Decrypter.
License: MIT License
Hi!
Thanks a lot for this gem! I've one question about it. How do You calculate shared secret? I try something like that:
ec = OpenSSL::PKey::EC.new('prime256v1')
bn = OpenSSL::BN.new(Base64.decode64(ephemeral_public_key), 2)
point = OpenSSL::PKey::EC::Point.new(ec.group, bn)
shared_secret = Base64.strict_encode64(private_key.dh_compute_key(point))
But it does not work. I do not know where I'm making a mistake.
Google Pay docs demand that processors verify the gatewayMerchantId
value in the Encrypted Message payload.
The current implementation of Aliquot strips away this crucial parameter since it isn't defined in Aliquot::Validator::EncryptedMessageContract
.
Here is a snippet:
output = Aliquot::Validator::EncryptedMessageSchema.call(
{
"gatewayMerchantId"=>"some:value", # this parameter has to be checked
"messageExpiration"=>"3246346346",
"messageId"=>"2323434534434fgdgdfg",
"paymentMethod"=>"CARD",
"paymentMethodDetails"=> {
"expirationYear"=>2032,
"expirationMonth"=>9,
"pan"=>"019742579823658273",
"authMethod"=>"CRYPTOGRAM_3DS",
"cryptogram"=>"sikdhgiuwegtf78623rt"
}
}
).to_h
# and yet it is removed
output[:gatewayMerchantId] #=> nil
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.