Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions lib/ibanity/api/isabel_connect/payment_notification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@ def self.list(access_token:, **query_params)
list_by_uri(uri: notifications_uri, query_params: query_params, customer_access_token: access_token)
end

def self.destroy(id:, access_token:)
uri = Ibanity.isabel_connect_api_schema["bulkPaymentInitiationRequests"]
.sub("{bulkPaymentInitiationRequestId}", "notifications/#{id}")
Ibanity.client.delete(uri: uri, customer_access_token: access_token)
true
end

private_class_method def self.notifications_uri
Ibanity.isabel_connect_api_schema["bulkPaymentInitiationRequests"]
.sub("{bulkPaymentInitiationRequestId}", "notifications")
Expand Down
19 changes: 0 additions & 19 deletions spec/lib/ibanity/api/isabel_connect/payment_notification_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,5 @@
end
end

describe ".destroy" do
before do
allow(client).to receive(:delete)
.with(uri: "#{notifications_uri}/#{notification_id}", customer_access_token: access_token)
.and_return("")
end

it "returns true" do
result = described_class.destroy(id: notification_id, access_token: access_token)
expect(result).to be true
end

it "calls DELETE on the correct URI" do
expect(client).to receive(:delete)
.with(uri: "#{notifications_uri}/#{notification_id}", customer_access_token: access_token)
.and_return("")

described_class.destroy(id: notification_id, access_token: access_token)
end
end
end
Loading