Skip to content

Commit

Permalink
Add acknowledge_product_purchase method to Acknowledger
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Schmidt committed Dec 11, 2020
1 parent 8500c32 commit 89fa629
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/candy_check/play_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
require "candy_check/play_store/product_acknowledgements/acknowledgement"
require "candy_check/play_store/product_acknowledgements/response"
require "candy_check/play_store/subscription_purchases/subscription_verification"
require "candy_check/play_store/subscription_acknowledgements/acknowledgement"
require "candy_check/play_store/subscription_acknowledgements/response"
require "candy_check/play_store/verification_failure"
require "candy_check/play_store/verifier"
require "candy_check/play_store/acknowledger"
Expand Down
9 changes: 9 additions & 0 deletions lib/candy_check/play_store/acknowledger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ def acknowledge_product_purchase(package_name:, product_id:, token:)
)
acknowledger.call!
end

def acknowledge_subscription_purchase(package_name:, subscription_id:, token:)
CandyCheck::PlayStore::SubscriptionAcknowledgements::Acknowledgement.new(
package_name: package_name,
subscription_id: subscription_id,
token: token,
authorization: @authorization,
).call!
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def acknowledge!
service = CandyCheck::PlayStore::AndroidPublisherService.new

service.authorization = @authorization
service.acknowledge_subscription_purchase(package_name, subscription_id, token) do |result, error_data|
service.acknowledge_purchase_subscription(package_name, subscription_id, token) do |result, error_data|
@response = { result: result, error_data: error_data }
end
end
Expand Down

0 comments on commit 89fa629

Please sign in to comment.