mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-10-09 00:03:05 -04:00
Merge pull request #180 from stripe/mlm-add-fraud-reporting-methods
Add fraud reporting methods
This commit is contained in:
commit
34a86a241b
@ -25,6 +25,22 @@ module Stripe
|
|||||||
refresh_from(response, api_key)
|
refresh_from(response, api_key)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def mark_as_fraudulent
|
||||||
|
params = {
|
||||||
|
:fraud_details => { :user_report => 'fraudulent' }
|
||||||
|
}
|
||||||
|
response, api_key = Stripe.request(:post, url, @api_key, params)
|
||||||
|
refresh_from(response, api_key)
|
||||||
|
end
|
||||||
|
|
||||||
|
def mark_as_safe
|
||||||
|
params = {
|
||||||
|
:fraud_details => { :user_report => 'safe' }
|
||||||
|
}
|
||||||
|
response, api_key = Stripe.request(:post, url, @api_key, params)
|
||||||
|
refresh_from(response, api_key)
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def refund_url
|
def refund_url
|
||||||
|
@ -36,6 +36,22 @@ module Stripe
|
|||||||
c.save
|
c.save
|
||||||
end
|
end
|
||||||
|
|
||||||
|
should "charges should be able to be marked as fraudulent" do
|
||||||
|
@mock.expects(:get).once.returns(test_response(test_charge))
|
||||||
|
@mock.expects(:post).once.returns(test_response(test_charge))
|
||||||
|
c = Stripe::Charge.new("test_charge")
|
||||||
|
c.refresh
|
||||||
|
c.mark_as_fraudulent
|
||||||
|
end
|
||||||
|
|
||||||
|
should "charges should be able to be marked as safe" do
|
||||||
|
@mock.expects(:get).once.returns(test_response(test_charge))
|
||||||
|
@mock.expects(:post).once.returns(test_response(test_charge))
|
||||||
|
c = Stripe::Charge.new("test_charge")
|
||||||
|
c.refresh
|
||||||
|
c.mark_as_safe
|
||||||
|
end
|
||||||
|
|
||||||
should "charges should have Card objects associated with their Card property" do
|
should "charges should have Card objects associated with their Card property" do
|
||||||
@mock.expects(:get).once.returns(test_response(test_charge))
|
@mock.expects(:get).once.returns(test_response(test_charge))
|
||||||
c = Stripe::Charge.retrieve("test_charge")
|
c = Stripe::Charge.retrieve("test_charge")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user