razorpay_integration 0.1.1 → 0.1.2

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: acaed634c6363fe96630a632a2fa348f4a318532469e8cd64cb1a0d0a244e810
4
- data.tar.gz: cee4bb99a05e15e2cc448efb0410c31b8db3b917aefcd7e5e040be674fa8bf82
3
+ metadata.gz: de3365f96bea4118c35b3010301109885b0d70b8a76772c30494abce3a62c828
4
+ data.tar.gz: 6ca8846bcc64e5856cf0ced63f61a17c52326659a7d3794381ac6e934b78616c
5
5
  SHA512:
6
- metadata.gz: 7fc5c80eb07b802a40a152f2ef112b5c297487c4fb8140a0a764f3f61647527ac79560d6a8a6d582038a831f02714c03d306f0c4c57a2c088af246d928c282ff
7
- data.tar.gz: 88ee07c6edb0c1c75885555bbcfcf99cbd5ccf0d1728a9afd370e01959c31e22fed75267caed744a8006728e76d275882c0f9c976c2f11ce365139cfcb1f47ff
6
+ metadata.gz: 7275dacb6de8cce8d869e8df381c628d1a2b0b35d4dca15e84b5d7af30898a9e83d1270dca87a6c94c6e6c0a5a2714804acbc03069f9e24252dce14e2e8dcf29
7
+ data.tar.gz: 31daa2c2b63cc88f10b0ec20b1c986b655366ce715705e644c37a4e9cee500d3c2ec23803a94fec2850bc423cafa88f6980680497df45a2272eb532e5fdc57bd
data/README.md CHANGED
@@ -33,11 +33,31 @@ end
33
33
 
34
34
  Here's how you can create a new customer:
35
35
 
36
+ **Create a new customer**
37
+
36
38
  ```ruby
37
39
  customer = RazorpayIntegration::Customer.new
38
40
  response = customer.create('Customer Name', 'Customer Contact', 'customer@email.com')
39
41
  ```
40
42
 
43
+ **Edit an existing customer**
44
+
45
+ ```ruby
46
+ response = customer.edit('customer_id', 'New Customer Name', 'New Customer Contact', 'new_customer@email.com')
47
+ ```
48
+
49
+ **List customers**
50
+
51
+ ```ruby
52
+ response = customer.list(10, 0)
53
+ ```
54
+
55
+ **Get a customer by ID**
56
+
57
+ ```ruby
58
+ response = customer.get('customer_id')
59
+ ```
60
+
41
61
  ## Directory Structure
42
62
 
43
63
  - **lib/:**
@@ -49,16 +69,13 @@ response = customer.create('Customer Name', 'Customer Contact', 'customer@email.
49
69
  - **razorpay_integration/:**
50
70
  Contains the classes that form the core functionality of the gem.
51
71
 
52
- - **version.rb:**
72
+ - **version.rb:**
53
73
  Contains the version number of the gem.
54
-
55
- - **configuration.rb:**
74
+ - **configuration.rb:**
56
75
  Contains the Configuration class for configuring the gem.
57
-
58
- - **base.rb:**
76
+ - **base.rb:**
59
77
  Contains the Base class for making HTTP requests.
60
-
61
- - **customer.rb:**
78
+ - **customer.rb:**
62
79
  Contains the Customer class for creating customers.
63
80
 
64
81
  ## Contributing
@@ -24,5 +24,36 @@ module RazorpayIntegration
24
24
 
25
25
  handle_response(response)
26
26
  end
27
+
28
+ def edit(customer_id, name, contact, email)
29
+ end_point = "/customers/#{customer_id}"
30
+
31
+ body = {
32
+ name: name,
33
+ email: email,
34
+ contact: contact
35
+ }.to_json
36
+
37
+ response = HTTParty.put("#{BASE_URL}#{end_point}", options.merge(body: body))
38
+
39
+ handle_response(response)
40
+ end
41
+
42
+ def list(count = 10, skip = 0)
43
+ end_point = "/customers?count=#{count}&skip=#{skip}"
44
+
45
+ response = HTTParty.get("#{BASE_URL}#{end_point}", options)
46
+
47
+ handle_response(response)
48
+ end
49
+
50
+
51
+ def get(customer_id)
52
+ end_point = "/customers/#{customer_id}"
53
+
54
+ response = HTTParty.get("#{BASE_URL}#{end_point}", options)
55
+
56
+ handle_response(response)
57
+ end
27
58
  end
28
59
  end
@@ -1,3 +1,3 @@
1
1
  module RazorpayIntegration
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: razorpay_integration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abhishek Verma