From a69f40a2070814c7329ee4770d00440f1fcfe4cc Mon Sep 17 00:00:00 2001 From: Dominik Skerhak Date: Mon, 29 Jun 2020 11:22:26 +0000 Subject: [PATCH] Adding webhook for Apple's ServerToServerNotifications processing - Processor checks and renews Apple subscription based on the received notification. - Since there's no way how to pass user-related data to payment payload, user is matched against original transaction ID that should be stored in payment_meta. Module expects app to call an internal API that sets this meta value for selected user. - Receipt validation was also added to internal `verify-purchase` API handler. --- src/model/Repositories/PaymentMetaRepository.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/model/Repositories/PaymentMetaRepository.php b/src/model/Repositories/PaymentMetaRepository.php index 2081713..33f83b5 100644 --- a/src/model/Repositories/PaymentMetaRepository.php +++ b/src/model/Repositories/PaymentMetaRepository.php @@ -82,6 +82,16 @@ final public function findByMeta(string $key, string $value) ])->fetch(); } + final public function findAllByMeta(string $key, string $value) + { + return $this->getTable()->where([ + 'key' => $key, + 'value' => $value + ]) + ->order('id DESC') + ->fetchAll(); + } + /** * @param ActiveRow $payment * @param string $key