fawry 1.3.0 → 1.3.1

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
  SHA256:
3
- metadata.gz: 5015952a24c3ab03377aae7d4d17abccbb7800c00c5ed6a02b4becabe5aa42a6
4
- data.tar.gz: 337289fe3666ac8fd7f7ff9886d5a6d5e33ebc542000c624771f338278160634
3
+ metadata.gz: 67bf2df195ce85382e7bd0d9f6d6b2111e5204d59fbc4091a5d9b31b7dde9a5f
4
+ data.tar.gz: 8a1ebb82a2b6a4937358193ae8c843f7dfcab971ed82c757171a1387c711d9d8
5
5
  SHA512:
6
- metadata.gz: 53a9057c10dda83db87042cce4dae0d7d76155c3bcffaeb5369403517d33613b10fb3d7a057db7cd39f368a2f4b3988ca06277db9de1e6ac9ab5c7d636ae026c
7
- data.tar.gz: 8fb2747e2050270ea3514b6c7967e60d41268f2469bf6060188c532d4a2688387edcbaea741d567321b107ebb876adac7f7c79ec3375eeca91c9c007e6c6127a
6
+ metadata.gz: 61914bd40afa7f491abc7f4f65b98e4f4b5e7e384335a7359028c548ec683a88035fef1799e844084e706ca7856828534a72f8a637676d4217510f008db2dfd3
7
+ data.tar.gz: 16b0687a4eee80795b08f1f71697c25619318b0b1fad49ca455f55527892aa97ea87e95e3edda5d3544433cbc33647a4e2e1524256874737ec8eb1d543c248e4
data/CHANGELOG.md CHANGED
@@ -1,4 +1,7 @@
1
1
  # Fawry Changelog
2
2
 
3
+ ## [v1.3.1](https://github.com/fawry-api/fawry/releases/tag/v1.3.1) (15.08.2021)
4
+ - Add language param to charge request params
5
+
3
6
  ## [v1.2.1](https://github.com/fawry-api/fawry/releases/tag/v1.2.1) (14.03.2021)
4
7
  - Update gem and dependencies to support Ruby 3.0
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fawry (1.3.0)
4
+ fawry (1.3.1)
5
5
  dry-validation (~> 1.3, >= 1.3.1)
6
6
  faraday (~> 0.17.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- addressable (2.7.0)
11
+ addressable (2.8.0)
12
12
  public_suffix (>= 2.0.2, < 5.0)
13
13
  ast (2.4.2)
14
14
  byebug (11.1.3)
data/README-ar.md CHANGED
@@ -27,13 +27,15 @@ gem 'fawry'
27
27
  ## تهيئة فوري للاستخدام
28
28
 
29
29
  لبرنامجك لتهيئة المكتبة `fawry.rb` أضف مهيئ
30
+
30
31
  ```ruby
31
32
  Fawry.configure do |config|
32
- config.sandbox = Rails.env.staging? ? true : false
33
+ config.sandbox = Rails.env.staging?
33
34
  config.fawry_secure_key = 'fawry_secure_key'
34
35
  config.fawry_merchant_code = 'fawry_merchant_code'
35
36
  end
36
37
  ```
38
+
37
39
  `FAWRY_SANDBOX`, `FAWRY_SECURE_KEY`, `FAWRY_MERCHANT_CODE` _(environment variables)_ او يمكنك بدلا من ذلك، استخدام المتغيرات البيئية
38
40
 
39
41
  ## طريقة الإستعمال
@@ -48,6 +50,7 @@ params = { "merchant_code": 'merchant_code',
48
50
  "payment_method": 'PAYATFAWRY',
49
51
  "currency_code": 'EGP',
50
52
  "amount": 20,
53
+ "language": "ar-eg",
51
54
  "fawry_secure_key": 'fawry_secure_key',
52
55
  "description": 'the charge request description',
53
56
  "charge_items": [{ "item_id": 'fk3fn9flk8et9a5t9w3c5h3oc684ivho',
data/README.md CHANGED
@@ -27,17 +27,19 @@ And then execute:
27
27
  Or install it yourself as:
28
28
 
29
29
  $ gem install fawry
30
-
30
+
31
31
  ## Configuration
32
32
 
33
33
  Add an initializer `fawry.rb` in your application to configure the library:
34
+
34
35
  ```ruby
35
36
  Fawry.configure do |config|
36
- config.sandbox = Rails.env.staging? ? true : false
37
+ config.sandbox = Rails.env.staging?
37
38
  config.fawry_secure_key = 'fawry_secure_key'
38
39
  config.fawry_merchant_code = 'fawry_merchant_code'
39
40
  end
40
41
  ```
42
+
41
43
  Alternatively, you could use the environment variables: `FAWRY_SANDBOX`, `FAWRY_SECURE_KEY`, and `FAWRY_MERCHANT_CODE`.
42
44
 
43
45
  ## Usage
@@ -52,6 +54,7 @@ params = { "merchant_code": 'merchant_code',
52
54
  "payment_method": 'PAYATFAWRY',
53
55
  "currency_code": 'EGP',
54
56
  "amount": 20,
57
+ "language": "ar-eg",
55
58
  "fawry_secure_key": 'fawry_secure_key',
56
59
  "description": 'the charge request description',
57
60
  "charge_items": [{ "item_id": 'fk3fn9flk8et9a5t9w3c5h3oc684ivho',
@@ -17,6 +17,7 @@ module Fawry
17
17
  required(:price).value(:decimal)
18
18
  required(:quantity).value(:integer)
19
19
  end
20
+ optional(:language).value(included_in?: %w[ar-eg en-gb])
20
21
  optional(:merchant_code).value(:string)
21
22
  optional(:fawry_secure_key).value(:string)
22
23
  optional(:currency_code).value(:string)
@@ -5,7 +5,7 @@ require 'digest'
5
5
  module Fawry
6
6
  module Requests
7
7
  module ChargeRequest
8
- DEFAULTS = { payment_method: 'PAYATFAWRY', currency_code: 'EGP' }.freeze
8
+ DEFAULTS = { payment_method: 'PAYATFAWRY', currency_code: 'EGP', language: 'ar-eg' }.freeze
9
9
 
10
10
  def fire_charge_request
11
11
  fawry_api_response = Connection.post(request[:path], request[:params], request[:body], request[:options])
@@ -45,6 +45,7 @@ module Fawry
45
45
  paymentExpiry: request_params[:payment_expiry],
46
46
  chargeItems: charge_items,
47
47
  currencyCode: request_params[:currency_code],
48
+ language: request_params[:language],
48
49
  signature: charge_request_signature
49
50
  }.compact
50
51
  end
data/lib/fawry/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Fawry
4
- VERSION = '1.3.0'
4
+ VERSION = '1.3.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fawry
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amr El Bakry
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-02 00:00:00.000000000 Z
11
+ date: 2021-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-validation