zip_money 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/Gemfile.lock +69 -0
  4. data/README.md +128 -0
  5. data/Rakefile +8 -0
  6. data/docs/Address.md +15 -0
  7. data/docs/Authority.md +9 -0
  8. data/docs/CaptureChargeRequest.md +8 -0
  9. data/docs/Charge.md +17 -0
  10. data/docs/ChargeCollection.md +8 -0
  11. data/docs/ChargeOrder.md +11 -0
  12. data/docs/ChargesApi.md +307 -0
  13. data/docs/Checkout.md +18 -0
  14. data/docs/CheckoutConfiguration.md +8 -0
  15. data/docs/CheckoutFeatures.md +8 -0
  16. data/docs/CheckoutFeaturesTokenisation.md +8 -0
  17. data/docs/CheckoutOrder.md +13 -0
  18. data/docs/CheckoutsApi.md +119 -0
  19. data/docs/CreateChargeRequest.md +14 -0
  20. data/docs/CreateCheckoutRequest.md +13 -0
  21. data/docs/CreateCheckoutRequestFeatures.md +8 -0
  22. data/docs/CreateCheckoutRequestFeaturesTokenisation.md +8 -0
  23. data/docs/CreateRefundRequest.md +11 -0
  24. data/docs/CreateTokenRequest.md +8 -0
  25. data/docs/Customer.md +15 -0
  26. data/docs/CustomersApi.md +96 -0
  27. data/docs/ErrorResponse.md +8 -0
  28. data/docs/ErrorResponseError.md +10 -0
  29. data/docs/ErrorResponseErrorDetails.md +9 -0
  30. data/docs/InlineResponse200.md +8 -0
  31. data/docs/Metadata.md +7 -0
  32. data/docs/OrderItem.md +16 -0
  33. data/docs/OrderShipping.md +10 -0
  34. data/docs/OrderShippingTracking.md +10 -0
  35. data/docs/Refund.md +13 -0
  36. data/docs/RefundsApi.md +181 -0
  37. data/docs/SettlementsApi.md +96 -0
  38. data/docs/Shopper.md +17 -0
  39. data/docs/ShopperStatistics.md +16 -0
  40. data/docs/Token.md +11 -0
  41. data/docs/TokensApi.md +66 -0
  42. data/lib/zip_money.rb +68 -0
  43. data/lib/zip_money/api/charges_api.rb +301 -0
  44. data/lib/zip_money/api/checkouts_api.rb +120 -0
  45. data/lib/zip_money/api/customers_api.rb +116 -0
  46. data/lib/zip_money/api/refunds_api.rb +181 -0
  47. data/lib/zip_money/api/settlements_api.rb +116 -0
  48. data/lib/zip_money/api/tokens_api.rb +70 -0
  49. data/lib/zip_money/api_client.rb +386 -0
  50. data/lib/zip_money/api_error.rb +31 -0
  51. data/lib/zip_money/configuration.rb +238 -0
  52. data/lib/zip_money/models/address.rb +413 -0
  53. data/lib/zip_money/models/authority.rb +235 -0
  54. data/lib/zip_money/models/capture_charge_request.rb +206 -0
  55. data/lib/zip_money/models/charge.rb +369 -0
  56. data/lib/zip_money/models/charge_collection.rb +188 -0
  57. data/lib/zip_money/models/charge_order.rb +250 -0
  58. data/lib/zip_money/models/checkout.rb +344 -0
  59. data/lib/zip_money/models/checkout_configuration.rb +187 -0
  60. data/lib/zip_money/models/checkout_features.rb +181 -0
  61. data/lib/zip_money/models/checkout_features_tokenisation.rb +184 -0
  62. data/lib/zip_money/models/checkout_order.rb +299 -0
  63. data/lib/zip_money/models/create_charge_request.rb +289 -0
  64. data/lib/zip_money/models/create_checkout_request.rb +272 -0
  65. data/lib/zip_money/models/create_checkout_request_features.rb +181 -0
  66. data/lib/zip_money/models/create_checkout_request_features_tokenisation.rb +189 -0
  67. data/lib/zip_money/models/create_refund_request.rb +246 -0
  68. data/lib/zip_money/models/create_token_request.rb +186 -0
  69. data/lib/zip_money/models/customer.rb +310 -0
  70. data/lib/zip_money/models/error_response.rb +181 -0
  71. data/lib/zip_money/models/error_response_error.rb +211 -0
  72. data/lib/zip_money/models/error_response_error_details.rb +190 -0
  73. data/lib/zip_money/models/inline_response_200.rb +188 -0
  74. data/lib/zip_money/models/metadata.rb +172 -0
  75. data/lib/zip_money/models/order_item.rb +333 -0
  76. data/lib/zip_money/models/order_shipping.rb +200 -0
  77. data/lib/zip_money/models/order_shipping_tracking.rb +247 -0
  78. data/lib/zip_money/models/refund.rb +252 -0
  79. data/lib/zip_money/models/shopper.rb +339 -0
  80. data/lib/zip_money/models/shopper_statistics.rb +295 -0
  81. data/lib/zip_money/models/token.rb +228 -0
  82. data/lib/zip_money/version.rb +8 -0
  83. data/spec/api/charges_api_spec.rb +114 -0
  84. data/spec/api/checkouts_api_spec.rb +54 -0
  85. data/spec/api/customers_api_spec.rb +51 -0
  86. data/spec/api/refunds_api_spec.rb +67 -0
  87. data/spec/api/settlements_api_spec.rb +51 -0
  88. data/spec/api/tokens_api_spec.rb +41 -0
  89. data/spec/api_client_spec.rb +219 -0
  90. data/spec/configuration_spec.rb +50 -0
  91. data/spec/models/address_spec.rb +77 -0
  92. data/spec/models/authority_spec.rb +45 -0
  93. data/spec/models/capture_charge_request_spec.rb +35 -0
  94. data/spec/models/charge_collection_spec.rb +35 -0
  95. data/spec/models/charge_order_spec.rb +53 -0
  96. data/spec/models/charge_spec.rb +93 -0
  97. data/spec/models/checkout_configuration_spec.rb +35 -0
  98. data/spec/models/checkout_features_spec.rb +35 -0
  99. data/spec/models/checkout_features_tokenisation_spec.rb +35 -0
  100. data/spec/models/checkout_order_spec.rb +65 -0
  101. data/spec/models/checkout_spec.rb +103 -0
  102. data/spec/models/create_charge_request_spec.rb +75 -0
  103. data/spec/models/create_checkout_request_features_spec.rb +35 -0
  104. data/spec/models/create_checkout_request_features_tokenisation_spec.rb +35 -0
  105. data/spec/models/create_checkout_request_spec.rb +69 -0
  106. data/spec/models/create_refund_request_spec.rb +53 -0
  107. data/spec/models/create_token_request_spec.rb +35 -0
  108. data/spec/models/customer_spec.rb +81 -0
  109. data/spec/models/error_response_error_details_spec.rb +41 -0
  110. data/spec/models/error_response_error_spec.rb +47 -0
  111. data/spec/models/error_response_spec.rb +35 -0
  112. data/spec/models/inline_response_200_spec.rb +35 -0
  113. data/spec/models/metadata_spec.rb +29 -0
  114. data/spec/models/order_item_spec.rb +87 -0
  115. data/spec/models/order_shipping_spec.rb +47 -0
  116. data/spec/models/order_shipping_tracking_spec.rb +47 -0
  117. data/spec/models/refund_spec.rb +65 -0
  118. data/spec/models/shopper_spec.rb +92 -0
  119. data/spec/models/shopper_statistics_spec.rb +86 -0
  120. data/spec/models/token_spec.rb +52 -0
  121. data/spec/payload_helper.rb +96 -0
  122. data/spec/spec_helper.rb +104 -0
  123. data/zip_money.gemspec +38 -0
  124. metadata +380 -0
@@ -0,0 +1,18 @@
1
+ # ZipMoney::Checkout
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **id** | **String** | The checkout id |
7
+ **uri** | **String** | The uri to redirect the user to in order to approve this checkout. |
8
+ **type** | **String** | The type of checkout | [optional] [default to "standard"]
9
+ **shopper** | [**Shopper**](Shopper.md) | | [optional]
10
+ **order** | [**CheckoutOrder**](CheckoutOrder.md) | | [optional]
11
+ **features** | [**CheckoutFeatures**](CheckoutFeatures.md) | | [optional]
12
+ **config** | [**CheckoutConfiguration**](CheckoutConfiguration.md) | | [optional]
13
+ **created** | **DateTime** | Date the checkout was created |
14
+ **state** | **String** | Current state of the checkout |
15
+ **customer_id** | **String** | The id of the customer who has approved this checkout request. Only present if approved. | [optional]
16
+ **metadata** | [**Metadata**](Metadata.md) | | [optional]
17
+
18
+
@@ -0,0 +1,8 @@
1
+ # ZipMoney::CheckoutConfiguration
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **redirect_uri** | **String** | The URI to redirect after the checkout is complete. This must be provided, even if using in-context checkout. If using redirection we will automatically redirect to this url with the result and checkoutId. If using in-context we will not automatically redirect to this URI. |
7
+
8
+
@@ -0,0 +1,8 @@
1
+ # ZipMoney::CheckoutFeatures
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **tokenisation** | [**CheckoutFeaturesTokenisation**](CheckoutFeaturesTokenisation.md) | | [optional]
7
+
8
+
@@ -0,0 +1,8 @@
1
+ # ZipMoney::CheckoutFeaturesTokenisation
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **required** | **BOOLEAN** | States if the tokenisation is required to proceed with the checkout. | [optional] [default to true]
7
+
8
+
@@ -0,0 +1,13 @@
1
+ # ZipMoney::CheckoutOrder
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **reference** | **String** | The order id in the eCommerce system | [optional]
7
+ **amount** | **Float** | The total amount of the order |
8
+ **currency** | **String** | The ISO-4217 currency code. See https://en.wikipedia.org/wiki/ISO_4217 |
9
+ **shipping** | [**OrderShipping**](OrderShipping.md) | |
10
+ **items** | [**Array<OrderItem>**](OrderItem.md) | The order item breakdown | [optional]
11
+ **cart_reference** | **String** | The shopping cart reference id | [optional]
12
+
13
+
@@ -0,0 +1,119 @@
1
+ # ZipMoney::CheckoutsApi
2
+
3
+ All URIs are relative to *https://api.sandbox.zipmoney.com.au/merchant/v1*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**checkouts_create**](CheckoutsApi.md#checkouts_create) | **POST** /checkouts | Create a checkout
8
+ [**checkouts_get**](CheckoutsApi.md#checkouts_get) | **GET** /checkouts/{id} | Retrieve a checkout
9
+
10
+
11
+ # **checkouts_create**
12
+ > Checkout checkouts_create(opts)
13
+
14
+ Create a checkout
15
+
16
+ Creates a zipMoney checkout. During the checkout process a customer can apply for credit decisioning in real-time. This means the checkout needs to represent a good picture of known customer details along with order information and the checkout entity represents this as a resource. For more information on how to checkout with zipMoney see the #model:Z2QcrzRGHACY8wM6G guide.
17
+
18
+ ### Example
19
+ ```ruby
20
+ # load the gem
21
+ require 'zip_money'
22
+ # setup authorization
23
+ ZipMoney.configure do |config|
24
+ # Configure API key authorization: Authorization
25
+ config.api_key['Authorization'] = 'YOUR API KEY'
26
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
27
+ #config.api_key_prefix['Authorization'] = 'Bearer'
28
+ end
29
+
30
+ api_instance = ZipMoney::CheckoutsApi.new
31
+
32
+ opts = {
33
+ body: ZipMoney::CreateCheckoutRequest.new # CreateCheckoutRequest |
34
+ }
35
+
36
+ begin
37
+ #Create a checkout
38
+ result = api_instance.checkouts_create(opts)
39
+ p result
40
+ rescue ZipMoney::ApiError => e
41
+ puts "Exception when calling CheckoutsApi->checkouts_create: #{e}"
42
+ end
43
+ ```
44
+
45
+ ### Parameters
46
+
47
+ Name | Type | Description | Notes
48
+ ------------- | ------------- | ------------- | -------------
49
+ **body** | [**CreateCheckoutRequest**](CreateCheckoutRequest.md)| | [optional]
50
+
51
+ ### Return type
52
+
53
+ [**Checkout**](Checkout.md)
54
+
55
+ ### Authorization
56
+
57
+ [Authorization](../README.md#Authorization)
58
+
59
+ ### HTTP request headers
60
+
61
+ - **Content-Type**: application/json
62
+ - **Accept**: application/json
63
+
64
+
65
+
66
+ # **checkouts_get**
67
+ > Checkout checkouts_get(id)
68
+
69
+ Retrieve a checkout
70
+
71
+ Retrieves a previously created checkout by id.
72
+
73
+ ### Example
74
+ ```ruby
75
+ # load the gem
76
+ require 'zip_money'
77
+ # setup authorization
78
+ ZipMoney.configure do |config|
79
+ # Configure API key authorization: Authorization
80
+ config.api_key['Authorization'] = 'YOUR API KEY'
81
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
82
+ #config.api_key_prefix['Authorization'] = 'Bearer'
83
+ end
84
+
85
+ api_instance = ZipMoney::CheckoutsApi.new
86
+
87
+ id = "id_example" # String |
88
+
89
+
90
+ begin
91
+ #Retrieve a checkout
92
+ result = api_instance.checkouts_get(id)
93
+ p result
94
+ rescue ZipMoney::ApiError => e
95
+ puts "Exception when calling CheckoutsApi->checkouts_get: #{e}"
96
+ end
97
+ ```
98
+
99
+ ### Parameters
100
+
101
+ Name | Type | Description | Notes
102
+ ------------- | ------------- | ------------- | -------------
103
+ **id** | **String**| |
104
+
105
+ ### Return type
106
+
107
+ [**Checkout**](Checkout.md)
108
+
109
+ ### Authorization
110
+
111
+ [Authorization](../README.md#Authorization)
112
+
113
+ ### HTTP request headers
114
+
115
+ - **Content-Type**: application/json
116
+ - **Accept**: application/json
117
+
118
+
119
+
@@ -0,0 +1,14 @@
1
+ # ZipMoney::CreateChargeRequest
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **authority** | [**Authority**](Authority.md) | |
7
+ **reference** | **String** | The reference for this charge (unique payment reference in your store) | [optional]
8
+ **amount** | **Float** | The amount of the charge |
9
+ **currency** | **String** | The currency |
10
+ **capture** | **BOOLEAN** | If true this will be a direct capture, pass false to perform an authorisation only | [optional] [default to true]
11
+ **order** | [**ChargeOrder**](ChargeOrder.md) | | [optional]
12
+ **metadata** | **Object** | | [optional]
13
+
14
+
@@ -0,0 +1,13 @@
1
+ # ZipMoney::CreateCheckoutRequest
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **type** | **String** | The checkout type. | [optional] [default to "standard"]
7
+ **shopper** | [**Shopper**](Shopper.md) | | [optional]
8
+ **order** | [**CheckoutOrder**](CheckoutOrder.md) | |
9
+ **features** | [**CreateCheckoutRequestFeatures**](CreateCheckoutRequestFeatures.md) | | [optional]
10
+ **metadata** | [**Metadata**](Metadata.md) | | [optional]
11
+ **config** | [**CheckoutConfiguration**](CheckoutConfiguration.md) | |
12
+
13
+
@@ -0,0 +1,8 @@
1
+ # ZipMoney::CreateCheckoutRequestFeatures
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **tokenisation** | [**CreateCheckoutRequestFeaturesTokenisation**](CreateCheckoutRequestFeaturesTokenisation.md) | | [optional]
7
+
8
+
@@ -0,0 +1,8 @@
1
+ # ZipMoney::CreateCheckoutRequestFeaturesTokenisation
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **required** | **BOOLEAN** | States if tokenisation is required for the checkout to proceed. | [default to false]
7
+
8
+
@@ -0,0 +1,11 @@
1
+ # ZipMoney::CreateRefundRequest
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **charge_id** | **String** | The id relating to the original charge that is to be refunded |
7
+ **reason** | **String** | The reason for the refund |
8
+ **amount** | **Float** | The amount to refund, can be less than or equal to the previously captured amount |
9
+ **metadata** | **Object** | Additional metadata if required | [optional]
10
+
11
+
@@ -0,0 +1,8 @@
1
+ # ZipMoney::CreateTokenRequest
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **authority** | [**Authority**](Authority.md) | |
7
+
8
+
@@ -0,0 +1,15 @@
1
+ # ZipMoney::Customer
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **title** | **String** | Customer's title | [optional]
7
+ **first_name** | **String** | Customer's first name |
8
+ **middle_name** | **String** | Customer's middle name | [optional]
9
+ **last_name** | **String** | Customer's last name |
10
+ **phone** | **String** | Customer's phone number |
11
+ **email** | **String** | Customer's email |
12
+ **birth_date** | **Date** | Customer's date of birth |
13
+ **gender** | **String** | Customer's gender | [optional]
14
+
15
+
@@ -0,0 +1,96 @@
1
+ # ZipMoney::CustomersApi
2
+
3
+ All URIs are relative to *https://api.sandbox.zipmoney.com.au/merchant/v1*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**customers_get**](CustomersApi.md#customers_get) | **GET** /customers/{id} | Retrieve customer
8
+ [**customers_list**](CustomersApi.md#customers_list) | **GET** /customers | List customers
9
+
10
+
11
+ # **customers_get**
12
+ > customers_get(id)
13
+
14
+ Retrieve customer
15
+
16
+ Retrieves the details of a customer by id. This will only return customer details for customers who have transacted previously via the zip Merchant API.
17
+
18
+ ### Example
19
+ ```ruby
20
+ # load the gem
21
+ require 'zip_money'
22
+
23
+ api_instance = ZipMoney::CustomersApi.new
24
+
25
+ id = "id_example" # String |
26
+
27
+
28
+ begin
29
+ #Retrieve customer
30
+ api_instance.customers_get(id)
31
+ rescue ZipMoney::ApiError => e
32
+ puts "Exception when calling CustomersApi->customers_get: #{e}"
33
+ end
34
+ ```
35
+
36
+ ### Parameters
37
+
38
+ Name | Type | Description | Notes
39
+ ------------- | ------------- | ------------- | -------------
40
+ **id** | **String**| |
41
+
42
+ ### Return type
43
+
44
+ nil (empty response body)
45
+
46
+ ### Authorization
47
+
48
+ No authorization required
49
+
50
+ ### HTTP request headers
51
+
52
+ - **Content-Type**: application/javascript
53
+ - **Accept**: application/javascript
54
+
55
+
56
+
57
+ # **customers_list**
58
+ > customers_list
59
+
60
+ List customers
61
+
62
+ Returns a list of all customers who have transacted previously with your merchant account.
63
+
64
+ ### Example
65
+ ```ruby
66
+ # load the gem
67
+ require 'zip_money'
68
+
69
+ api_instance = ZipMoney::CustomersApi.new
70
+
71
+ begin
72
+ #List customers
73
+ api_instance.customers_list
74
+ rescue ZipMoney::ApiError => e
75
+ puts "Exception when calling CustomersApi->customers_list: #{e}"
76
+ end
77
+ ```
78
+
79
+ ### Parameters
80
+ This endpoint does not need any parameter.
81
+
82
+ ### Return type
83
+
84
+ nil (empty response body)
85
+
86
+ ### Authorization
87
+
88
+ No authorization required
89
+
90
+ ### HTTP request headers
91
+
92
+ - **Content-Type**: application/javascript
93
+ - **Accept**: application/javascript
94
+
95
+
96
+
@@ -0,0 +1,8 @@
1
+ # ZipMoney::ErrorResponse
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **error** | [**ErrorResponseError**](ErrorResponseError.md) | | [optional]
7
+
8
+
@@ -0,0 +1,10 @@
1
+ # ZipMoney::ErrorResponseError
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **code** | **String** | |
7
+ **message** | **String** | |
8
+ **details** | [**Array<ErrorResponseErrorDetails>**](ErrorResponseErrorDetails.md) | | [optional]
9
+
10
+
@@ -0,0 +1,9 @@
1
+ # ZipMoney::ErrorResponseErrorDetails
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **name** | **String** | | [optional]
7
+ **message** | **String** | | [optional]
8
+
9
+
@@ -0,0 +1,8 @@
1
+ # ZipMoney::InlineResponse200
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **items** | [**Array<Refund>**](Refund.md) | |
7
+
8
+
@@ -0,0 +1,7 @@
1
+ # ZipMoney::Metadata
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+
7
+
@@ -0,0 +1,16 @@
1
+ # ZipMoney::OrderItem
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **name** | **String** | |
7
+ **amount** | **Float** | |
8
+ **reference** | **String** | | [optional]
9
+ **description** | **String** | | [optional]
10
+ **quantity** | **Integer** | | [optional]
11
+ **type** | **String** | |
12
+ **image_uri** | **String** | | [optional]
13
+ **item_uri** | **String** | | [optional]
14
+ **product_code** | **String** | | [optional]
15
+
16
+
@@ -0,0 +1,10 @@
1
+ # ZipMoney::OrderShipping
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **pickup** | **BOOLEAN** | States if the shipping method is pickup, otherwise the shipping address should be provided | [optional]
7
+ **tracking** | [**OrderShippingTracking**](OrderShippingTracking.md) | | [optional]
8
+ **address** | [**Address**](Address.md) | | [optional]
9
+
10
+