bygpay 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -0
- data/CHANGELOG.md +5 -1
- data/README.md +56 -3
- data/lib/bygpay/byg_response.rb +2 -0
- data/lib/bygpay/deposit/mobile.rb +1 -0
- data/lib/bygpay/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0137d4292d71750130b0e716a9f50d1796299c04
|
4
|
+
data.tar.gz: 4b8c91f49179e0cce897b7b1744a8fba2f9683c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28dd5642ebc9a4622971829bf28c041ad465347102030a63a94547c6512d8b23248105f7320cbf78784b233d0045c12042255b8de24cab4a7708002fe47ddf16
|
7
|
+
data.tar.gz: f1203b1abcdbd7b0fd104745630ace197212bbf8d3dadf6388bd30a7ecc2f1b3a8d45d9cc4befc438354e8f137895453f8400315e226f7072ee8c3809c84b200
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[![Gem Version](https://badge.fury.io/rb/bygpay.svg)](https://badge.fury.io/rb/bygpay) [![Code Climate](https://codeclimate.com/github/nukturnal/bygpay/badges/gpa.svg)](https://codeclimate.com/github/nukturnal/bygpay) [![codebeat badge](https://codebeat.co/badges/8db86406-18f8-4c2d-bacf-58ac1c700c0a)](https://codebeat.co/projects/github-com-nukturnal-bygpay-master)
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/bygpay.svg)](https://badge.fury.io/rb/bygpay) [![Code Climate](https://codeclimate.com/github/nukturnal/bygpay/badges/gpa.svg)](https://codeclimate.com/github/nukturnal/bygpay) [![codebeat badge](https://codebeat.co/badges/8db86406-18f8-4c2d-bacf-58ac1c700c0a)](https://codebeat.co/projects/github-com-nukturnal-bygpay-master) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/7425ac54e6484723a5482a92fc7f35ef)](https://www.codacy.com/app/nukturnal/bygpay?utm_source=github.com&utm_medium=referral&utm_content=nukturnal/bygpay&utm_campaign=Badge_Grade) [![Build Status](https://travis-ci.org/nukturnal/bygpay_ruby.svg?branch=master)](https://travis-ci.org/nukturnal/bygpay_ruby)
|
2
2
|
|
3
3
|
# Bygpay Ruby SDK
|
4
4
|
|
@@ -53,12 +53,20 @@ Bygpay gateway uses four types of status messages to mark transactions.
|
|
53
53
|
|
54
54
|
#### Mobile Money
|
55
55
|
|
56
|
-
Currently SDK supports MTN, AIRTEL, TIGO, VODAFONE, you may refer to your Bygpay Gateway documentations for more provider options.
|
56
|
+
Currently SDK supports MTN, AIRTEL, TIGO, VODAFONE, you may refer to your Bygpay Gateway documentations for more provider options.
|
57
|
+
|
58
|
+
Mobile Money transactions are not onetime requests because of their inherent nature, need to rely on checking the transaction status or callback POST from Bygpay Gateway to verify the status of the transaction.
|
57
59
|
|
58
60
|
```ruby
|
59
61
|
# Making a Mobile Money Deposit Request
|
60
62
|
deposit = Bygpay::Deposit::Mobile.new
|
61
|
-
|
63
|
+
mobile_payload = {
|
64
|
+
walletno: '0244124550',
|
65
|
+
provider: 'MTN',
|
66
|
+
currency: 'USD', # optional
|
67
|
+
extrnx_code: nil # optional
|
68
|
+
}
|
69
|
+
result = deposit.charge(1.99, mobile_payload)
|
62
70
|
if result
|
63
71
|
puts deposit.uuid
|
64
72
|
puts deposit.status # accepted, :pending, :fail, :success
|
@@ -75,6 +83,51 @@ Query Transaction status
|
|
75
83
|
# You always need the transaction UUID to get status response
|
76
84
|
deposit = Bygpay::Deposit::Mobile.new
|
77
85
|
result = deposit.transaction_status('e81216aa-9ef7-4c5c-aed0-6e5ff1fe')
|
86
|
+
if result
|
87
|
+
puts deposit.uuid # need uuid to check transacion status
|
88
|
+
puts deposit.status # accepted, :pending, :fail, :success
|
89
|
+
puts deposit.transaction_id
|
90
|
+
else
|
91
|
+
puts deposit.response_text
|
92
|
+
puts deposit.status
|
93
|
+
end
|
94
|
+
```
|
95
|
+
#### Debit/Credit Card
|
96
|
+
|
97
|
+
Supports VISA, MasterCard and any other cards based on the processors available on Bygpay Gateway. This is a onetime transaction and immediate response is the final status of the transaction. However transaction status request is still available
|
98
|
+
|
99
|
+
```ruby
|
100
|
+
# Making a Mobile Money Deposit Request
|
101
|
+
# Please note that some of the optional fields might be required base on
|
102
|
+
# which processors the BygPay Gateway is using.
|
103
|
+
deposit = Bygpay::Deposit::Card.new
|
104
|
+
card_data = {
|
105
|
+
card_number: '4111111111111111',
|
106
|
+
amount: 0.10,
|
107
|
+
expiry_month: 6,
|
108
|
+
expiry_year: 2017,
|
109
|
+
cvv: 123,
|
110
|
+
country: 'GH', # Optional country ISO code
|
111
|
+
currency: 'USD', # Optional currency ISO code
|
112
|
+
card_name: 'Gifty Cobbinah' # Optional Card Hold Name
|
113
|
+
}
|
114
|
+
result = deposit.charge(1.99, card_data)
|
115
|
+
if result
|
116
|
+
puts deposit.uuid
|
117
|
+
puts deposit.status # accepted, :pending, :fail, :success
|
118
|
+
puts deposit.transaction_id
|
119
|
+
else
|
120
|
+
puts deposit.response_text
|
121
|
+
puts deposit.status
|
122
|
+
end
|
123
|
+
```
|
124
|
+
|
125
|
+
Query Transaction status
|
126
|
+
```ruby
|
127
|
+
# Checking transaction status
|
128
|
+
# You always need the transaction UUID to get status response
|
129
|
+
deposit = Bygpay::Deposit::Card.new
|
130
|
+
result = deposit.transaction_status('e81216aa-9ef7-4c5c-aed0-6e5ff1fe')
|
78
131
|
if result
|
79
132
|
puts deposit.uuid
|
80
133
|
puts deposit.status # accepted, :pending, :fail, :success
|
data/lib/bygpay/byg_response.rb
CHANGED
data/lib/bygpay/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bygpay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alfred Rowe
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
129
|
version: '0'
|
130
130
|
requirements: []
|
131
131
|
rubyforge_project:
|
132
|
-
rubygems_version: 2.6.
|
132
|
+
rubygems_version: 2.6.12
|
133
133
|
signing_key:
|
134
134
|
specification_version: 4
|
135
135
|
summary: Bygpay Payment Gateway Ruby SDK
|