nebulab / afterpay-ruby Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
https://developers.afterpay.com/afterpay-online/reference#request-headers
lib/afterpay.rb add user_agent attribute
lib/afterpay/http_service/request.rb add faraday_options
User-Agent header must be supplied with all Merchant API requests prior to placing any live transactions.
For example:
MyAfterpayModule/1.0.0 (E-Commerce Platform Name/1.0.0; PHP/7.0.0; Merchant/600032000) https://merchant.example.com
Description | Example Data Above | Other Merchant Examples |
---|---|---|
Afterpay Plugin | MyAfterpayModule/1.0.0 | • Custom Plugin/1.0• Shopify Plugin/3.5.1• AfterpayCartridge/1.0• AfterpayExtension/2.9 |
Platform | E-Commerce Platform Name/1.0.0 | • Websphere Commerce/8.1• Commerce Cloud/1.1• Magento/2.3.0 |
System Information | PHP/7.0.0 | • PHP/7.2.18• Ruby/2.5.3• Java/8.3 |
Merchant ID | Merchant/600032000 | • Merchant/101113200• Merchant/101931210 |
Merchant Website URL | https://merchant.example.com | http://www.merchantwebsite.com |
https://developers.afterpay.com/afterpay-online/reference#capture-payment
Here we need to find a way to differentiate it from the Immediate Capture already implemented here.
Afterpay::API::Payment::DeferredCapture
, maybe? Or we can create a Deferred
namespace and move all the new deferred APIs under it. Afterpay::API::Payment::Deferred::Capture
, Afterpay::API::Payment::Deferred::Void ...
Afterpay::Components::Order.new(items: [Afterpay::Components::Item.new(name: 'Test')]).as_json
=> {
"amount"=>nil,
"consumer"=>nil,
"billing"=>nil,
"shipping"=>nil,
"courier"=>nil,
"items"=>[
#<Afterpay::Components::Item:0x00007fe8fc5ae370 @categories=nil, @estimated_shipment_date=nil, @image_url=nil, @name="Test", @page_url=nil, @price=nil, @quantity=nil, @sku=nil>
],
"discounts"=>nil,
"merchant"=>nil,
"paymentType"=>nil,
"merchantReference"=>nil,
"taxAmount"=>nil,
"shippingAmount"=>nil
}
I think the bug is here because the represent
method doesn't handle the arrays (it should loop through the array and call the #as_json
method on each value)
We should get the specs running green and through CircleCI.
We should simply upgrade the existing code. More features will be added only after the solidus-afterpay extension is available.
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.