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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4dbbb7c0fc6bd86ab7308612d53253225cd1a99e
4
- data.tar.gz: 6bfbd8cf31e41ec241dcf47c1cf65f4a4ad96a5f
3
+ metadata.gz: 0137d4292d71750130b0e716a9f50d1796299c04
4
+ data.tar.gz: 4b8c91f49179e0cce897b7b1744a8fba2f9683c5
5
5
  SHA512:
6
- metadata.gz: 67aef33499c381da810352387eea781ba522fa20a0a3c02b3be50067923ab7f966c63e27732647f1f0537b350cf4314b8267a6213b922a5a49fb12ed7a861a55
7
- data.tar.gz: 742a5738f22ffd2d9e6a4e1f1959f3e71fcdaf2bfa742c5901c20d7512bb1ae111e0fbd57af2aec7a3b0ee4344a94569ff26751eccc2054597b720fae1feb4ef
6
+ metadata.gz: 28dd5642ebc9a4622971829bf28c041ad465347102030a63a94547c6512d8b23248105f7320cbf78784b233d0045c12042255b8de24cab4a7708002fe47ddf16
7
+ data.tar.gz: f1203b1abcdbd7b0fd104745630ace197212bbf8d3dadf6388bd30a7ecc2f1b3a8d45d9cc4befc438354e8f137895453f8400315e226f7072ee8c3809c84b200
data/.travis.yml CHANGED
@@ -2,4 +2,8 @@ sudo: false
2
2
  language: ruby
3
3
  rvm:
4
4
  - 2.4.0
5
+ - 2.3.0
6
+ - 2.2.0
7
+ - 2.1.0
8
+ - 2.0.0
5
9
  before_install: gem install bundler -v 1.14.6
data/CHANGELOG.md CHANGED
@@ -13,4 +13,8 @@
13
13
 
14
14
  ####v0.2.2
15
15
  * Bankcard support Added
16
- * Codebase Improved
16
+ * Codebase Improved
17
+
18
+ ####v0.2.3
19
+ * Currency Support Added to Deposits
20
+ * Added Tests Coverage
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
- result = deposit.charge(1.99,{walletno: '0244124550', provider: 'MTN'})
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
@@ -1,3 +1,5 @@
1
+ require 'hashie'
2
+
1
3
  module Bygpay
2
4
  class BygResponse
3
5
  SUCCESS = 'success'
@@ -5,6 +5,7 @@ module Bygpay
5
5
  # {
6
6
  # "walletno" : "0276967627",
7
7
  # "provider": "TIGO",
8
+ # "currency": "USD",
8
9
  # "extrnx_code": null
9
10
  # }
10
11
  # Perform a mobile deposit request
@@ -1,3 +1,3 @@
1
1
  module Bygpay
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
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.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-20 00:00:00.000000000 Z
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.10
132
+ rubygems_version: 2.6.12
133
133
  signing_key:
134
134
  specification_version: 4
135
135
  summary: Bygpay Payment Gateway Ruby SDK