amplifypay_ruby 1.0.0 → 1.0.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 +11 -3
- data/lib/amplifypay_ruby/checkout/redirect_invoice.rb +1 -1
- data/lib/amplifypay_ruby/setup.rb +3 -2
- data/lib/amplifypay_ruby/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f87f7c7cd7e2cc68e08a12f997b93567e51bed4
|
4
|
+
data.tar.gz: 1e015159dd4a4f2a6a8754164c8322615d1a4758
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99751c696967ef6057977b4354ef603c54ce11546dc11b940aee7e1c3395d97d5fc3654bb41ac66f0185ead8c6aca29cb72e6c52d49fa851edee0d229735246e
|
7
|
+
data.tar.gz: 93780ec4b36f86f3dc1d6f0e6676958b990ba116331cad6fbe303c950b8de8a85899d574c4350c40f44c94a06f5e53ace150fe06e40d1fee6948702e6e7398f5
|
data/README.md
CHANGED
@@ -29,14 +29,18 @@ If you are using rails you may create an file under `RAILS_ROOT/config/initializ
|
|
29
29
|
|
30
30
|
AmplifypayRuby::Setup.merchant_id = "YOUR_MERCHANT_ID"
|
31
31
|
AmplifypayRuby::Setup.private_key = "YOUR_API_PRIVATE_KEY"
|
32
|
+
AmplifypayRuby::Setup.redirect_url = "http://example.com/order"
|
33
|
+
|
32
34
|
|
33
35
|
## Create your Checkout Invoice
|
34
36
|
|
35
37
|
co = AmplifypayRuby::Checkout::Invoice.new
|
36
38
|
|
37
|
-
## Set
|
39
|
+
## Set transaction details ! Important
|
38
40
|
|
39
41
|
co.total_amount = 1200.99
|
42
|
+
co.customer = {"email" => "john.doe@mail.com", "name" => "John Doe"}
|
43
|
+
co.trans_id = 23437888888
|
40
44
|
|
41
45
|
|
42
46
|
## Redirecting to your checkout invoice page
|
@@ -47,8 +51,12 @@ If you are using rails you may create an file under `RAILS_ROOT/config/initializ
|
|
47
51
|
@message = co.response_text
|
48
52
|
end
|
49
53
|
|
50
|
-
|
51
|
-
|
54
|
+
## Verifying transactions
|
55
|
+
|
56
|
+
if co.confirm(transactionRef)
|
57
|
+
//your logic e.g
|
58
|
+
@message = co.response_text
|
59
|
+
end
|
52
60
|
|
53
61
|
|
54
62
|
## Contributing
|
@@ -52,7 +52,7 @@ module AmplifypayRuby
|
|
52
52
|
customerEmail: @customer["email"],
|
53
53
|
customerName: @customer["name"],
|
54
54
|
Amount: @total_amount,
|
55
|
-
redirectUrl:
|
55
|
+
redirectUrl: AmplifypayRuby::Setup.redirect_url,
|
56
56
|
paymentDescription: @paymentDescription
|
57
57
|
}
|
58
58
|
end
|
@@ -2,8 +2,7 @@ module AmplifypayRuby
|
|
2
2
|
module Setup
|
3
3
|
@@merchant_id = nil
|
4
4
|
@@private_key = nil
|
5
|
-
@@
|
6
|
-
@@token = nil
|
5
|
+
@@redirect_url = nil
|
7
6
|
@@mode = "test"
|
8
7
|
|
9
8
|
ROOT_URL_BASE = "https://api.amplifypay.com"
|
@@ -17,6 +16,8 @@ module AmplifypayRuby
|
|
17
16
|
def self.merchant_id; @@merchant_id; end
|
18
17
|
def self.private_key=(private_key); @@private_key = private_key; end
|
19
18
|
def self.private_key; @@private_key; end
|
19
|
+
def self.redirect_url=(redirect_url); @@redirect_url = redirect_url; end
|
20
|
+
def self.redirect_url; @@redirect_url; end
|
20
21
|
|
21
22
|
|
22
23
|
def self.mode=(mode); @@mode = mode; end
|