afterpay-ruby 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1b138c6354737a0b52de2dea005597e8836b5fda092584a572b93953fb4954f5
4
- data.tar.gz: fc7e8360debb62136e4048a84821ae6fd9833460ce84cc0b68a02181d30bf05d
3
+ metadata.gz: 35c87bf45fddff8a49ff4951107cf6e9d7cf49f55249285b5961a484a3077de8
4
+ data.tar.gz: 41827691430e44940096eb977b4414e78d10a65a1fa97ad8bc3de1d5f960bbb1
5
5
  SHA512:
6
- metadata.gz: 9084a554247fa82cbe50b1653d099cdf2e2ba8a1b85a154e01a079e7c30d70ebf208dc83c72a12fde226e92bcabe0a3b2bef8e309eb2e70b96cc5638adf5ae88
7
- data.tar.gz: 9f6e7b012de323610ef6895905fa3f574b23df743ca999e78d4bfdb5fec3d0cfbd6b9cd2db5895c5da1c78f07c7639d43663947a549556bd394a78cf134193e5
6
+ metadata.gz: f3a6b0d027b0a5170a30aa03ca19ba773a71ce9622afbdbfa7ae3c4de64692412c78b77ab450dcbb19e4ecca487e50b6b999b2a5e40518c059849e351b18b1b9
7
+ data.tar.gz: a0dc7665d2a42960c90c48feb28f6d30de8152da4a55ec75083c60187003fb65bf38f26d9bd9eab4e9af42392a84d311173630b2a25c11576a19c5ee6faa21fd
data/README.md CHANGED
@@ -40,7 +40,11 @@ Afterpay.configure do |config|
40
40
  end
41
41
  ```
42
42
 
43
- ### Creating an Order - [api docs](https://docs.afterpay.com/au-online-api-v1.html#create-order)
43
+ ### Creating an Order
44
+
45
+ [api docs](https://docs.afterpay.com/au-online-api-v1.html#create-order)
46
+
47
+ Order accepts a [Consumer](https://github.com/bluethumbart/afterpay-ruby#consumer-object) and an array of [Item](https://github.com/bluethumbart/afterpay-ruby#item-object) object which are required.
44
48
 
45
49
  ```ruby
46
50
  order = Afterpay::Order.create(
@@ -92,6 +96,36 @@ payment.status
92
96
  => APPROVED
93
97
  ```
94
98
 
99
+ ### Consumer Object
100
+
101
+ [api docs](https://docs.afterpay.com/au-online-api-v1.html#consumer-object)
102
+
103
+ Consumer contains the details of the payee which will be serialized to API's format.
104
+
105
+ ```ruby
106
+ Afterpay::Consumer.new(
107
+ email: <String>,
108
+ phone: <String>,
109
+ first_name: <String>,
110
+ last_name: <String>,
111
+ )
112
+ ```
113
+
114
+ ### Item Object
115
+
116
+ [api docs](https://docs.afterpay.com/au-online-api-v1.html#item-object)
117
+
118
+ Item holds the details of purchace per item.
119
+
120
+ ```ruby
121
+ Afterpay::Item.new(
122
+ name: <String>,
123
+ price: <Money>,
124
+ sku: <String | optional>,
125
+ quantity: <Number | defaults to 1>,
126
+ )
127
+ ```
128
+
95
129
  ## Development
96
130
 
97
131
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -6,7 +6,7 @@ module Afterpay
6
6
  class Item
7
7
  attr_accessor :name, :sku, :quantity, :price
8
8
 
9
- def initialize(name:, sku:, price:, quantity: 1)
9
+ def initialize(name:, price:, sku: nil, quantity: 1)
10
10
  @name = name
11
11
  @sku = sku
12
12
  @quantity = quantity
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Afterpay
4
- VERSION = "0.1.0".freeze
4
+ VERSION = "0.1.1".freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: afterpay-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eli
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-09 00:00:00.000000000 Z
11
+ date: 2019-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler