mangopay 3.0.23 → 3.0.25.pre.alpha.pre.20

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.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +28 -26
  3. data/.rspec +2 -2
  4. data/.travis.yml +13 -0
  5. data/Gemfile +2 -2
  6. data/LICENSE +20 -20
  7. data/README.md +126 -123
  8. data/bin/mangopay +9 -9
  9. data/lib/generators/mangopay/install_generator.rb +60 -60
  10. data/lib/generators/templates/mangopay.rb.erb +5 -5
  11. data/lib/mangopay.rb +225 -158
  12. data/lib/mangopay/authorization_token.rb +88 -88
  13. data/lib/mangopay/bank_account.rb +38 -38
  14. data/lib/mangopay/card.rb +8 -8
  15. data/lib/mangopay/card_registration.rb +9 -9
  16. data/lib/mangopay/client.rb +74 -74
  17. data/lib/mangopay/dispute.rb +130 -130
  18. data/lib/mangopay/errors.rb +61 -61
  19. data/lib/mangopay/event.rb +18 -18
  20. data/lib/mangopay/filter_parameters.rb +46 -0
  21. data/lib/mangopay/hook.rb +9 -9
  22. data/lib/mangopay/http_calls.rb +85 -85
  23. data/lib/mangopay/json.rb +14 -14
  24. data/lib/mangopay/kyc_document.rb +70 -70
  25. data/lib/mangopay/legal_user.rb +15 -15
  26. data/lib/mangopay/mandate.rb +32 -32
  27. data/lib/mangopay/natural_user.rb +14 -14
  28. data/lib/mangopay/pay_in.rb +85 -73
  29. data/lib/mangopay/pay_out.rb +14 -14
  30. data/lib/mangopay/pre_authorization.rb +13 -13
  31. data/lib/mangopay/refund.rb +7 -7
  32. data/lib/mangopay/report.rb +17 -17
  33. data/lib/mangopay/resource.rb +21 -21
  34. data/lib/mangopay/temp.rb +74 -74
  35. data/lib/mangopay/transaction.rb +24 -24
  36. data/lib/mangopay/transfer.rb +9 -9
  37. data/lib/mangopay/user.rb +43 -35
  38. data/lib/mangopay/version.rb +3 -3
  39. data/lib/mangopay/wallet.rb +17 -17
  40. data/mangopay.gemspec +31 -30
  41. data/spec/mangopay/authorization_token_spec.rb +70 -70
  42. data/spec/mangopay/bank_account_spec.rb +97 -97
  43. data/spec/mangopay/card_registration_spec.rb +73 -73
  44. data/spec/mangopay/client_spec.rb +110 -110
  45. data/spec/mangopay/configuration_spec.rb +95 -18
  46. data/spec/mangopay/dispute_spec.rb +262 -262
  47. data/spec/mangopay/event_spec.rb +31 -31
  48. data/spec/mangopay/fetch_filters_spec.rb +63 -63
  49. data/spec/mangopay/hook_spec.rb +37 -37
  50. data/spec/mangopay/idempotency_spec.rb +41 -41
  51. data/spec/mangopay/kyc_document_spec.rb +103 -103
  52. data/spec/mangopay/log_requests_filter_spec.rb +25 -0
  53. data/spec/mangopay/mandate_spec.rb +92 -92
  54. data/spec/mangopay/payin_bankwire_direct_spec.rb +74 -74
  55. data/spec/mangopay/payin_card_direct_spec.rb +68 -68
  56. data/spec/mangopay/payin_card_web_spec.rb +38 -38
  57. data/spec/mangopay/payin_directdebit_direct_spec.rb +37 -37
  58. data/spec/mangopay/payin_directdebit_web_spec.rb +38 -38
  59. data/spec/mangopay/payin_paypal_web_spec.rb +38 -0
  60. data/spec/mangopay/payin_preauthorized_direct_spec.rb +68 -68
  61. data/spec/mangopay/payout_bankwire_spec.rb +54 -54
  62. data/spec/mangopay/preauthorization_spec.rb +42 -42
  63. data/spec/mangopay/refund_spec.rb +21 -21
  64. data/spec/mangopay/report_spec.rb +39 -39
  65. data/spec/mangopay/shared_resources.rb +381 -365
  66. data/spec/mangopay/temp_paymentcard_spec.rb +31 -31
  67. data/spec/mangopay/transaction_spec.rb +54 -54
  68. data/spec/mangopay/transfer_spec.rb +69 -69
  69. data/spec/mangopay/user_spec.rb +137 -122
  70. data/spec/mangopay/wallet_spec.rb +80 -80
  71. data/spec/spec_helper.rb +31 -31
  72. metadata +11 -5
@@ -1,15 +1,15 @@
1
- module MangoPay
2
-
3
- # See http://docs.mangopay.com/api-references/users/legal-users/
4
- # See also parent class MangoPay::User
5
- class LegalUser < User
6
-
7
- def self.url(id = nil)
8
- if id
9
- "#{MangoPay.api_path}/users/legal/#{CGI.escape(id.to_s)}"
10
- else
11
- "#{MangoPay.api_path}/users/legal"
12
- end
13
- end
14
- end
15
- end
1
+ module MangoPay
2
+
3
+ # See http://docs.mangopay.com/api-references/users/legal-users/
4
+ # See also parent class MangoPay::User
5
+ class LegalUser < User
6
+
7
+ def self.url(id = nil)
8
+ if id
9
+ "#{MangoPay.api_path}/users/legal/#{CGI.escape(id.to_s)}"
10
+ else
11
+ "#{MangoPay.api_path}/users/legal"
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,32 +1,32 @@
1
- module MangoPay
2
-
3
- # See https://docs.mangopay.com/api-references/mandates/
4
- class Mandate < Resource
5
- include HTTPCalls::Fetch
6
-
7
- class << self
8
-
9
- # +params+: hash; see https://docs.mangopay.com/api-references/mandates/
10
- def create(params, idempotency_key = nil)
11
- url = "#{MangoPay.api_path}/mandates/directdebit/web"
12
- MangoPay.request(:post, url, params, {}, idempotency_key)
13
- end
14
-
15
- def cancel(id)
16
- url = "#{MangoPay.api_path}/mandates/#{id}/cancel"
17
- MangoPay.request(:put, url)
18
- end
19
-
20
- def fetch_for_user(user_id, filters = {})
21
- url = "#{MangoPay.api_path}/users/#{user_id}/mandates"
22
- MangoPay.request(:get, url, {}, filters)
23
- end
24
-
25
- def fetch_for_user_bank_account(user_id, bank_account_id, filters = {})
26
- url = "#{MangoPay.api_path}/users/#{user_id}/bankaccounts/#{bank_account_id}/mandates"
27
- MangoPay.request(:get, url, {}, filters)
28
- end
29
-
30
- end
31
- end
32
- end
1
+ module MangoPay
2
+
3
+ # See https://docs.mangopay.com/api-references/mandates/
4
+ class Mandate < Resource
5
+ include HTTPCalls::Fetch
6
+
7
+ class << self
8
+
9
+ # +params+: hash; see https://docs.mangopay.com/api-references/mandates/
10
+ def create(params, idempotency_key = nil)
11
+ url = "#{MangoPay.api_path}/mandates/directdebit/web"
12
+ MangoPay.request(:post, url, params, {}, idempotency_key)
13
+ end
14
+
15
+ def cancel(id)
16
+ url = "#{MangoPay.api_path}/mandates/#{id}/cancel"
17
+ MangoPay.request(:put, url)
18
+ end
19
+
20
+ def fetch_for_user(user_id, filters = {})
21
+ url = "#{MangoPay.api_path}/users/#{user_id}/mandates"
22
+ MangoPay.request(:get, url, {}, filters)
23
+ end
24
+
25
+ def fetch_for_user_bank_account(user_id, bank_account_id, filters = {})
26
+ url = "#{MangoPay.api_path}/users/#{user_id}/bankaccounts/#{bank_account_id}/mandates"
27
+ MangoPay.request(:get, url, {}, filters)
28
+ end
29
+
30
+ end
31
+ end
32
+ end
@@ -1,14 +1,14 @@
1
- module MangoPay
2
-
3
- # See http://docs.mangopay.com/api-references/users/natural-users/
4
- class NaturalUser < User
5
-
6
- def self.url(id = nil)
7
- if id
8
- "#{MangoPay.api_path}/users/natural/#{CGI.escape(id.to_s)}"
9
- else
10
- "#{MangoPay.api_path}/users/natural"
11
- end
12
- end
13
- end
14
- end
1
+ module MangoPay
2
+
3
+ # See http://docs.mangopay.com/api-references/users/natural-users/
4
+ class NaturalUser < User
5
+
6
+ def self.url(id = nil)
7
+ if id
8
+ "#{MangoPay.api_path}/users/natural/#{CGI.escape(id.to_s)}"
9
+ else
10
+ "#{MangoPay.api_path}/users/natural"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -1,73 +1,85 @@
1
- module MangoPay
2
-
3
- # See http://docs.mangopay.com/api-references/payins/
4
- class PayIn < Resource
5
- include HTTPCalls::Fetch
6
- include HTTPCalls::Refund
7
-
8
- module Card
9
-
10
- # See http://docs.mangopay.com/api-references/payins/payins-card-web/
11
- class Web < Resource
12
- include HTTPCalls::Create
13
- def self.url(*)
14
- "#{MangoPay.api_path}/payins/card/#{CGI.escape(class_name.downcase)}"
15
- end
16
- end
17
-
18
- # See http://docs.mangopay.com/api-references/payins/payindirectcard/
19
- class Direct < Resource
20
- include HTTPCalls::Create
21
- def self.url(*)
22
- "#{MangoPay.api_path}/payins/card/#{CGI.escape(class_name.downcase)}"
23
- end
24
- end
25
-
26
- end
27
-
28
- module PreAuthorized
29
-
30
- # See http://docs.mangopay.com/api-references/payins/preauthorized-payin/
31
- class Direct < Resource
32
- include HTTPCalls::Create
33
- def self.url(*)
34
- "#{MangoPay.api_path}/payins/preauthorized/direct"
35
- end
36
- end
37
-
38
- end
39
-
40
- module BankWire
41
-
42
- # See http://docs.mangopay.com/api-references/payins/payinbankwire/
43
- class Direct < Resource
44
- include HTTPCalls::Create
45
- def self.url(*)
46
- "#{MangoPay.api_path}/payins/bankwire/direct"
47
- end
48
- end
49
-
50
- end
51
-
52
- module DirectDebit
53
-
54
- # See http://docs.mangopay.com/api-references/payins/direct-debit-pay-in-web/
55
- class Web < Resource
56
- include HTTPCalls::Create
57
- def self.url(*)
58
- "#{MangoPay.api_path}/payins/directdebit/#{CGI.escape(class_name.downcase)}"
59
- end
60
- end
61
-
62
- # See https://docs.mangopay.com/api-references/payins/direct-debit-pay-in-direct/
63
- class Direct < Resource
64
- include HTTPCalls::Create
65
- def self.url(*)
66
- "#{MangoPay.api_path}/payins/directdebit/#{CGI.escape(class_name.downcase)}"
67
- end
68
- end
69
-
70
- end
71
-
72
- end
73
- end
1
+ module MangoPay
2
+
3
+ # See http://docs.mangopay.com/api-references/payins/
4
+ class PayIn < Resource
5
+ include HTTPCalls::Fetch
6
+ include HTTPCalls::Refund
7
+
8
+ module Card
9
+
10
+ # See http://docs.mangopay.com/api-references/payins/payins-card-web/
11
+ class Web < Resource
12
+ include HTTPCalls::Create
13
+ def self.url(*)
14
+ "#{MangoPay.api_path}/payins/card/#{CGI.escape(class_name.downcase)}"
15
+ end
16
+ end
17
+
18
+ # See http://docs.mangopay.com/api-references/payins/payindirectcard/
19
+ class Direct < Resource
20
+ include HTTPCalls::Create
21
+ def self.url(*)
22
+ "#{MangoPay.api_path}/payins/card/#{CGI.escape(class_name.downcase)}"
23
+ end
24
+ end
25
+
26
+ end
27
+
28
+ module PreAuthorized
29
+
30
+ # See http://docs.mangopay.com/api-references/payins/preauthorized-payin/
31
+ class Direct < Resource
32
+ include HTTPCalls::Create
33
+ def self.url(*)
34
+ "#{MangoPay.api_path}/payins/preauthorized/direct"
35
+ end
36
+ end
37
+
38
+ end
39
+
40
+ module BankWire
41
+
42
+ # See http://docs.mangopay.com/api-references/payins/payinbankwire/
43
+ class Direct < Resource
44
+ include HTTPCalls::Create
45
+ def self.url(*)
46
+ "#{MangoPay.api_path}/payins/bankwire/direct"
47
+ end
48
+ end
49
+
50
+ end
51
+
52
+ module DirectDebit
53
+
54
+ # See http://docs.mangopay.com/api-references/payins/direct-debit-pay-in-web/
55
+ class Web < Resource
56
+ include HTTPCalls::Create
57
+ def self.url(*)
58
+ "#{MangoPay.api_path}/payins/directdebit/#{CGI.escape(class_name.downcase)}"
59
+ end
60
+ end
61
+
62
+ # See https://docs.mangopay.com/api-references/payins/direct-debit-pay-in-direct/
63
+ class Direct < Resource
64
+ include HTTPCalls::Create
65
+ def self.url(*)
66
+ "#{MangoPay.api_path}/payins/directdebit/#{CGI.escape(class_name.downcase)}"
67
+ end
68
+ end
69
+
70
+ end
71
+
72
+ module PayPal
73
+
74
+ # See https://docs.mangopay.com/api-references/payins/paypal-payin/
75
+ class Web < Resource
76
+ include HTTPCalls::Create
77
+ def self.url(*)
78
+ "#{MangoPay.api_path}/payins/paypal/#{CGI.escape(class_name.downcase)}"
79
+ end
80
+ end
81
+
82
+ end
83
+
84
+ end
85
+ end
@@ -1,14 +1,14 @@
1
- module MangoPay
2
- class PayOut < Resource
3
- include HTTPCalls::Fetch
4
-
5
- # See http://docs.mangopay.com/api-references/pay-out-bank-wire/
6
- class BankWire < Resource
7
- include HTTPCalls::Create
8
-
9
- def self.url(*)
10
- "#{MangoPay.api_path}/payouts/bankwire"
11
- end
12
- end
13
- end
14
- end
1
+ module MangoPay
2
+ class PayOut < Resource
3
+ include HTTPCalls::Fetch
4
+
5
+ # See http://docs.mangopay.com/api-references/pay-out-bank-wire/
6
+ class BankWire < Resource
7
+ include HTTPCalls::Create
8
+
9
+ def self.url(*)
10
+ "#{MangoPay.api_path}/payouts/bankwire"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -1,13 +1,13 @@
1
- module MangoPay
2
-
3
- # See http://docs.mangopay.com/api-references/payins/preauthorized-payin/
4
- class PreAuthorization < Resource
5
- include HTTPCalls::Update
6
- include HTTPCalls::Fetch
7
-
8
- def self.create(params, idempotency_key = nil)
9
- MangoPay.request(:post, "#{url}/card/direct", params, {}, idempotency_key)
10
- end
11
-
12
- end
13
- end
1
+ module MangoPay
2
+
3
+ # See http://docs.mangopay.com/api-references/payins/preauthorized-payin/
4
+ class PreAuthorization < Resource
5
+ include HTTPCalls::Update
6
+ include HTTPCalls::Fetch
7
+
8
+ def self.create(params, idempotency_key = nil)
9
+ MangoPay.request(:post, "#{url}/card/direct", params, {}, idempotency_key)
10
+ end
11
+
12
+ end
13
+ end
@@ -1,7 +1,7 @@
1
- module MangoPay
2
-
3
- # See http://docs.mangopay.com/api-references/refund/
4
- class Refund < Resource
5
- include HTTPCalls::Fetch
6
- end
7
- end
1
+ module MangoPay
2
+
3
+ # See http://docs.mangopay.com/api-references/refund/
4
+ class Refund < Resource
5
+ include HTTPCalls::Fetch
6
+ end
7
+ end
@@ -1,17 +1,17 @@
1
- module MangoPay
2
-
3
- # See https://docs.mangopay.com/endpoints/v2.01/reporting
4
- class Report < Resource
5
- include HTTPCalls::Fetch
6
-
7
- class << self
8
-
9
- # +params+: hash; see https://docs.mangopay.com/endpoints/v2.01/reporting#e825_create-a-transaction-report
10
- def create(params, idempotency_key = nil)
11
- url = url() + '/transactions/'
12
- MangoPay.request(:post, url, params, {}, idempotency_key)
13
- end
14
-
15
- end
16
- end
17
- end
1
+ module MangoPay
2
+
3
+ # See https://docs.mangopay.com/endpoints/v2.01/reporting
4
+ class Report < Resource
5
+ include HTTPCalls::Fetch
6
+
7
+ class << self
8
+
9
+ # +params+: hash; see https://docs.mangopay.com/endpoints/v2.01/reporting#e825_create-a-transaction-report
10
+ def create(params, idempotency_key = nil)
11
+ url = url() + '/transactions/'
12
+ MangoPay.request(:post, url, params, {}, idempotency_key)
13
+ end
14
+
15
+ end
16
+ end
17
+ end
@@ -1,21 +1,21 @@
1
- module MangoPay
2
- # @abstract
3
- class Resource
4
- class << self
5
- def class_name
6
- name.split('::').last
7
- end
8
-
9
- def url(id = nil)
10
- if self == Resource
11
- raise NotImplementedError.new('Resource is an abstract class. Do not use it directly.')
12
- end
13
- if id
14
- "#{MangoPay.api_path}/#{CGI.escape(class_name.downcase)}s/#{CGI.escape(id.to_s)}"
15
- else
16
- "#{MangoPay.api_path}/#{CGI.escape(class_name.downcase)}s"
17
- end
18
- end
19
- end
20
- end
21
- end
1
+ module MangoPay
2
+ # @abstract
3
+ class Resource
4
+ class << self
5
+ def class_name
6
+ name.split('::').last
7
+ end
8
+
9
+ def url(id = nil)
10
+ if self == Resource
11
+ raise NotImplementedError.new('Resource is an abstract class. Do not use it directly.')
12
+ end
13
+ if id
14
+ "#{MangoPay.api_path}/#{CGI.escape(class_name.downcase)}s/#{CGI.escape(id.to_s)}"
15
+ else
16
+ "#{MangoPay.api_path}/#{CGI.escape(class_name.downcase)}s"
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
data/lib/mangopay/temp.rb CHANGED
@@ -1,74 +1,74 @@
1
- module MangoPay
2
-
3
- module Temp
4
-
5
- # As part of our migration project to allow users
6
- # to move from v1 to v2 of our API,
7
- # we have added a couple of temporary calls to the v2 API.
8
- #
9
- # They are not documented in normal way, but the calls are related to:
10
- # - registering a card (POST & GET /temp/paymentcards)
11
- # - and doing a web card payin with this card (POST /temp/immediate-payins)
12
- # For the latter, a GET or refunds are done
13
- # via the previously existing resources.
14
- #
15
- # !!! WARNING !!!
16
- # These are TEMPORARY functions and WILL BE REMOVED in the future!
17
- # You should CONTACT SUPPORT TEAM before using these features
18
- # or if you have any questions.
19
- class PaymentCard < Resource
20
-
21
- # POST /temp/paymentcards
22
- #
23
- # Sent data:
24
- # - UserId e.g. "12424242"
25
- # - Tag e.g. "my tag"
26
- # - Culture e.g. "FR"
27
- # - ReturnURL e.g. "http://mysite.com/return"
28
- # - TemplateURL e.g. "http://mysite.com/template"
29
- #
30
- # Received data:
31
- # - UserId e.g. "12424242"
32
- # - Tag e.g. "my tag"
33
- # - Culture e.g. "FR"
34
- # - ReturnURL e.g. "http://mysite.com/return"
35
- # - TemplateURL e.g. "http://mysite.com/template"
36
- # - RedirectURL e.g. "http://payline.com/redirect"
37
- # - Alias e.g. null (but would be e.g. 497010XXXXXX4422 once the user has inputed their info and the card has been successfully registered"
38
- # - Id: "1213131"
39
- # - CreationDate: "13452522657"
40
- include HTTPCalls::Create
41
-
42
- # GET /temp/paymentcards
43
- # Received data: as above
44
- include HTTPCalls::Fetch
45
-
46
- # POST /temp/immediate-payins
47
- #
48
- # Sent data:
49
- # - AuthorId e.g. "121412"
50
- # - CreditUserId e.g. "121412"
51
- # - PaymentCardId e.g. "322311"
52
- # - Tag e.g. "my tag"
53
- # - CreditedWalletId e.g. "123134"
54
- # - DebitedFunds e.g. normal Money object of Currency and Amount
55
- # - Fees e.g. normal Money object of Currency and Amount
56
- #
57
- # Received data:
58
- # Normal card web payin transaction, with the addition of:
59
- # - PaymentCardId e.g. "322311"
60
- def self.immediate_payin(params, idempotency_key = nil)
61
- url = "#{MangoPay.api_path}/temp/immediate-payins"
62
- MangoPay.request(:post, url, params, {}, idempotency_key)
63
- end
64
-
65
- def self.url(id = nil)
66
- if id
67
- "#{MangoPay.api_path}/temp/paymentcards/#{CGI.escape(id.to_s)}"
68
- else
69
- "#{MangoPay.api_path}/temp/paymentcards"
70
- end
71
- end
72
- end
73
- end
74
- end
1
+ module MangoPay
2
+
3
+ module Temp
4
+
5
+ # As part of our migration project to allow users
6
+ # to move from v1 to v2 of our API,
7
+ # we have added a couple of temporary calls to the v2 API.
8
+ #
9
+ # They are not documented in normal way, but the calls are related to:
10
+ # - registering a card (POST & GET /temp/paymentcards)
11
+ # - and doing a web card payin with this card (POST /temp/immediate-payins)
12
+ # For the latter, a GET or refunds are done
13
+ # via the previously existing resources.
14
+ #
15
+ # !!! WARNING !!!
16
+ # These are TEMPORARY functions and WILL BE REMOVED in the future!
17
+ # You should CONTACT SUPPORT TEAM before using these features
18
+ # or if you have any questions.
19
+ class PaymentCard < Resource
20
+
21
+ # POST /temp/paymentcards
22
+ #
23
+ # Sent data:
24
+ # - UserId e.g. "12424242"
25
+ # - Tag e.g. "my tag"
26
+ # - Culture e.g. "FR"
27
+ # - ReturnURL e.g. "http://mysite.com/return"
28
+ # - TemplateURL e.g. "http://mysite.com/template"
29
+ #
30
+ # Received data:
31
+ # - UserId e.g. "12424242"
32
+ # - Tag e.g. "my tag"
33
+ # - Culture e.g. "FR"
34
+ # - ReturnURL e.g. "http://mysite.com/return"
35
+ # - TemplateURL e.g. "http://mysite.com/template"
36
+ # - RedirectURL e.g. "http://payline.com/redirect"
37
+ # - Alias e.g. null (but would be e.g. 497010XXXXXX4422 once the user has inputed their info and the card has been successfully registered"
38
+ # - Id: "1213131"
39
+ # - CreationDate: "13452522657"
40
+ include HTTPCalls::Create
41
+
42
+ # GET /temp/paymentcards
43
+ # Received data: as above
44
+ include HTTPCalls::Fetch
45
+
46
+ # POST /temp/immediate-payins
47
+ #
48
+ # Sent data:
49
+ # - AuthorId e.g. "121412"
50
+ # - CreditUserId e.g. "121412"
51
+ # - PaymentCardId e.g. "322311"
52
+ # - Tag e.g. "my tag"
53
+ # - CreditedWalletId e.g. "123134"
54
+ # - DebitedFunds e.g. normal Money object of Currency and Amount
55
+ # - Fees e.g. normal Money object of Currency and Amount
56
+ #
57
+ # Received data:
58
+ # Normal card web payin transaction, with the addition of:
59
+ # - PaymentCardId e.g. "322311"
60
+ def self.immediate_payin(params, idempotency_key = nil)
61
+ url = "#{MangoPay.api_path}/temp/immediate-payins"
62
+ MangoPay.request(:post, url, params, {}, idempotency_key)
63
+ end
64
+
65
+ def self.url(id = nil)
66
+ if id
67
+ "#{MangoPay.api_path}/temp/paymentcards/#{CGI.escape(id.to_s)}"
68
+ else
69
+ "#{MangoPay.api_path}/temp/paymentcards"
70
+ end
71
+ end
72
+ end
73
+ end
74
+ end