From f05d705fe599646790a6ab4c8b9bfdae3d119017 Mon Sep 17 00:00:00 2001 From: PCM Date: Wed, 31 Jul 2019 23:40:11 -0700 Subject: [PATCH 1/2] adding in hooks and model for Purchases --- src/Models/Purchase.php | 23 +++++++++ src/Ontraport.php | 8 ++++ src/Purchases.php | 102 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 133 insertions(+) create mode 100644 src/Models/Purchase.php create mode 100644 src/Purchases.php diff --git a/src/Models/Purchase.php b/src/Models/Purchase.php new file mode 100644 index 0000000..b57174a --- /dev/null +++ b/src/Models/Purchase.php @@ -0,0 +1,23 @@ +getApi("Products"); } + + /** + * @return Products + */ + public function purchase() + { + return $this->getApi("Purchases"); + } /** * @return Offers diff --git a/src/Purchases.php b/src/Purchases.php new file mode 100644 index 0000000..56a0d0e --- /dev/null +++ b/src/Purchases.php @@ -0,0 +1,102 @@ + Date: Wed, 31 Jul 2019 23:44:09 -0700 Subject: [PATCH 2/2] renaming from Transaction cloning --- src/Models/Purchase.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Models/Purchase.php b/src/Models/Purchase.php index b57174a..1775aea 100644 --- a/src/Models/Purchase.php +++ b/src/Models/Purchase.php @@ -4,14 +4,10 @@ use OntraportAPI\Exceptions as Exceptions; -class Transaction +class Purchase { /** - * Transaction constructor - * - * @param int $contact_id The id of the contact this transaction is for. - * @param int $charge_now Binary integer flag indicating if this transaction should be charged now or logged - * @param int $gateway_id The id of the gateway this transaction is going through. + * Purchase constructor * * @throws Exceptions\OntraportAPIException No gateway id provided for charge now *