afterpay-ruby 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +35 -1
- data/lib/afterpay/item.rb +1 -1
- data/lib/afterpay/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35c87bf45fddff8a49ff4951107cf6e9d7cf49f55249285b5961a484a3077de8
|
4
|
+
data.tar.gz: 41827691430e44940096eb977b4414e78d10a65a1fa97ad8bc3de1d5f960bbb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
data/lib/afterpay/item.rb
CHANGED
data/lib/afterpay/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2019-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|