diff --git a/.gitignore b/.gitignore index 938de4e..69e1e92 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ /.idea/ /build/ /vendor -phpunit.xml \ No newline at end of file +phpunit.xml + +.DS_Store diff --git a/samples/authentication/authentication.php b/samples/authentication/authentication.php new file mode 100644 index 0000000..5d49481 --- /dev/null +++ b/samples/authentication/authentication.php @@ -0,0 +1,2 @@ +$apiKey = '< YOUR_PRIVATE_KEY >'; +$request = new Paymill\Request($apiKey); diff --git a/samples/clients/create_new_client.php b/samples/clients/create_new_client.php new file mode 100644 index 0000000..e3a7d53 --- /dev/null +++ b/samples/clients/create_new_client.php @@ -0,0 +1,5 @@ +$client = new Paymill\Models\Request\Client(); +$client->setEmail('max.mustermann@example.com') + ->setDescription('Lovely Client') + +$response = $request->create($client); diff --git a/samples/clients/export_clients_list.php b/samples/clients/export_clients_list.php new file mode 100644 index 0000000..28384a7 --- /dev/null +++ b/samples/clients/export_clients_list.php @@ -0,0 +1 @@ +/* Not implemented yet */ diff --git a/samples/clients/get_client_details.php b/samples/clients/get_client_details.php new file mode 100644 index 0000000..4d7aaf9 --- /dev/null +++ b/samples/clients/get_client_details.php @@ -0,0 +1,4 @@ +$client = new Paymill\Models\Request\Client(); +$client->setId('client_88a388d9dd48f86c3136'); + +$response = $request->getOne($client); diff --git a/samples/clients/list_clients.php b/samples/clients/list_clients.php new file mode 100644 index 0000000..42a7f81 --- /dev/null +++ b/samples/clients/list_clients.php @@ -0,0 +1,3 @@ +$client = new Paymill\Models\Request\Client(); + +$response = $request->getAll($client); diff --git a/samples/clients/remove_client.php b/samples/clients/remove_client.php new file mode 100644 index 0000000..ddd2197 --- /dev/null +++ b/samples/clients/remove_client.php @@ -0,0 +1,4 @@ +$client = new Paymill\Models\Request\Client(); +$client->setId('client_88a388d9dd48f86c3136'); + +$response = $request->delete($client); diff --git a/samples/clients/update_client.php b/samples/clients/update_client.php new file mode 100644 index 0000000..049b4f5 --- /dev/null +++ b/samples/clients/update_client.php @@ -0,0 +1,6 @@ +$client = new Paymill\Models\Request\Client(); +$client->setId('client_88a388d9dd48f86c3136') + ->setEmail('updated-client@example.com') + ->setDescription('Updated Client'); + +$response = $request->update($client); diff --git a/samples/offers/create_new_offer.php b/samples/offers/create_new_offer.php new file mode 100644 index 0000000..fa7a6d5 --- /dev/null +++ b/samples/offers/create_new_offer.php @@ -0,0 +1,7 @@ +$offer = new Paymill\Models\Request\Offer(); +$offer->setAmount(4200) + ->setCurrency('EUR') + ->setInterval('1 WEEK') + ->setName('Nerd Special'); + +$response = $request->create($offer); diff --git a/samples/offers/export_offers_list.php b/samples/offers/export_offers_list.php new file mode 100644 index 0000000..28384a7 --- /dev/null +++ b/samples/offers/export_offers_list.php @@ -0,0 +1 @@ +/* Not implemented yet */ diff --git a/samples/offers/get_offer_details.php b/samples/offers/get_offer_details.php new file mode 100644 index 0000000..07f42e8 --- /dev/null +++ b/samples/offers/get_offer_details.php @@ -0,0 +1,4 @@ +$offer = new Paymill\Models\Request\Offer(); +$offer->setId('offer_40237e20a7d5a231d99b'); + +$response = $request->getOne($offer); diff --git a/samples/offers/list_offers.php b/samples/offers/list_offers.php new file mode 100644 index 0000000..9dcb7dc --- /dev/null +++ b/samples/offers/list_offers.php @@ -0,0 +1,3 @@ +$offer = new Paymill\Models\Request\Offer(); + +$response = $request->getAll($offer); diff --git a/samples/offers/remove_offer.php b/samples/offers/remove_offer.php new file mode 100644 index 0000000..88e58f2 --- /dev/null +++ b/samples/offers/remove_offer.php @@ -0,0 +1,5 @@ +$offer = new Paymill\Models\Request\Offer(); +$offer->setId('offer_40237e20a7d5a231d99b') + ->removeWithSubscriptions(true); + +$response = $request->delete($offer) diff --git a/samples/offers/update_offer.php b/samples/offers/update_offer.php new file mode 100644 index 0000000..b2f030c --- /dev/null +++ b/samples/offers/update_offer.php @@ -0,0 +1,10 @@ +$offer = new Paymill\Models\Request\Offer(); +$offer->setId('offer_40237e20a7d5a231d99b') + ->setName('Extended Special') + ->setInterval('1 MONTH') + ->setAmount(3333) + ->setCurrency('USD') + ->setTrialPeriodDays(33) + ->updateSubscriptions(true); + +$response = $request->update($offer) diff --git a/samples/payments/create_new_credit_card_payment_with_token.php b/samples/payments/create_new_credit_card_payment_with_token.php new file mode 100644 index 0000000..eb81231 --- /dev/null +++ b/samples/payments/create_new_credit_card_payment_with_token.php @@ -0,0 +1,4 @@ +$payment = new Paymill\Models\Request\Payment(); +$payment->setToken('098f6bcd4621d373cade4e832627b4f6'); + +$response = $request->create($payment); diff --git a/samples/payments/create_new_credit_card_payment_with_token_and_client.php b/samples/payments/create_new_credit_card_payment_with_token_and_client.php new file mode 100644 index 0000000..64ccb08 --- /dev/null +++ b/samples/payments/create_new_credit_card_payment_with_token_and_client.php @@ -0,0 +1,5 @@ +$payment = new Paymill\Models\Request\Payment(); +$payment->setToken('098f6bcd4621d373cade4e832627b4f6') + ->setClient('client_88a388d9dd48f86c3136'); + +$response = $request->create($payment); diff --git a/samples/payments/create_new_debit_payment_with_token.php b/samples/payments/create_new_debit_payment_with_token.php new file mode 100644 index 0000000..43847fc --- /dev/null +++ b/samples/payments/create_new_debit_payment_with_token.php @@ -0,0 +1,4 @@ +$payment = new Paymill\Models\Request\Payment(); +$payment->setToken('12a46bcd462sd3r3care4e8336ssb4f5'); + +$response = $request->create($payment); diff --git a/samples/payments/create_new_debit_payment_with_token_and_client.php b/samples/payments/create_new_debit_payment_with_token_and_client.php new file mode 100644 index 0000000..2a1a901 --- /dev/null +++ b/samples/payments/create_new_debit_payment_with_token_and_client.php @@ -0,0 +1,5 @@ +$payment = new Paymill\Models\Request\Payment(); +$payment->setToken('12a46bcd462sd3r3care4e8336ssb4f5'); +$payment->setClient('client_88a388d9dd48f86c3136'); + +$response = $request->create($payment); diff --git a/samples/payments/export_payments_list.php b/samples/payments/export_payments_list.php new file mode 100644 index 0000000..28384a7 --- /dev/null +++ b/samples/payments/export_payments_list.php @@ -0,0 +1 @@ +/* Not implemented yet */ diff --git a/samples/payments/get_payment_details.php b/samples/payments/get_payment_details.php new file mode 100644 index 0000000..a369f8d --- /dev/null +++ b/samples/payments/get_payment_details.php @@ -0,0 +1,4 @@ +$payment = new Paymill\Models\Request\Payment(); +$payment->setId('pay_3af44644dd6d25c820a8'); + +$response = $request->getOne($payment); diff --git a/samples/payments/list_payments.php b/samples/payments/list_payments.php new file mode 100644 index 0000000..57c801d --- /dev/null +++ b/samples/payments/list_payments.php @@ -0,0 +1,3 @@ +$payment = new Paymill\Models\Request\Payment(); + +$response = $request->getAll($payment); diff --git a/samples/payments/remove_payment.php b/samples/payments/remove_payment.php new file mode 100644 index 0000000..ae25be4 --- /dev/null +++ b/samples/payments/remove_payment.php @@ -0,0 +1,4 @@ +$payment = new Paymill\Models\Request\Payment(); +$payment->setId('pay_3af44644dd6d25c820a8'); + +$response = $request->delete($payment); diff --git a/samples/preauthorizations/create_new_preauthorization_with_payment.php b/samples/preauthorizations/create_new_preauthorization_with_payment.php new file mode 100644 index 0000000..cbc1e24 --- /dev/null +++ b/samples/preauthorizations/create_new_preauthorization_with_payment.php @@ -0,0 +1,7 @@ +$preAuth = new Paymill\Models\Request\Preauthorization(); +$preAuth->setPayment('pay_d43cf0ee969d9847512b') + ->setAmount(4200) + ->setCurrency('EUR') + ->setDescription('description example'); + +$response = $request->create($preAuth); diff --git a/samples/preauthorizations/create_new_preauthorization_with_token.php b/samples/preauthorizations/create_new_preauthorization_with_token.php new file mode 100644 index 0000000..7c322fb --- /dev/null +++ b/samples/preauthorizations/create_new_preauthorization_with_token.php @@ -0,0 +1,7 @@ +$preAuth = new Paymill\Models\Request\Preauthorization(); +$preAuth->setToken('098f6bcd4621d373cade4e832627b4f6') + ->setAmount(4200) + ->setCurrency('EUR') + ->setDescription('description example'); + +$response = $request->create($preAuth); diff --git a/samples/preauthorizations/export_preauthorizations_list.php b/samples/preauthorizations/export_preauthorizations_list.php new file mode 100644 index 0000000..28384a7 --- /dev/null +++ b/samples/preauthorizations/export_preauthorizations_list.php @@ -0,0 +1 @@ +/* Not implemented yet */ diff --git a/samples/preauthorizations/get_preauthorization_details.php b/samples/preauthorizations/get_preauthorization_details.php new file mode 100644 index 0000000..9dd6b71 --- /dev/null +++ b/samples/preauthorizations/get_preauthorization_details.php @@ -0,0 +1,4 @@ +$preAuth = new Paymill\Models\Request\Preauthorization(); +$preAuth->setId('preauth_31eb90495837447f76b7'); + +$response = $request->getOne($preAuth); diff --git a/samples/preauthorizations/list_preauthorizations.php b/samples/preauthorizations/list_preauthorizations.php new file mode 100644 index 0000000..f567259 --- /dev/null +++ b/samples/preauthorizations/list_preauthorizations.php @@ -0,0 +1,3 @@ +$preAuth = new Paymill\Models\Request\Preauthorization(); + +$response = $request->getAll($preAuth); diff --git a/samples/preauthorizations/remove_preauthorization.php b/samples/preauthorizations/remove_preauthorization.php new file mode 100644 index 0000000..048f63a --- /dev/null +++ b/samples/preauthorizations/remove_preauthorization.php @@ -0,0 +1,4 @@ +$preAuth = new Paymill\Models\Request\Preauthorization(); +$preAuth->setId('preauth_31eb90495837447f76b7'); + +$response = $request->delete($preAuth); diff --git a/samples/refunds/create_new_refund.php b/samples/refunds/create_new_refund.php new file mode 100644 index 0000000..5c775af --- /dev/null +++ b/samples/refunds/create_new_refund.php @@ -0,0 +1,6 @@ +$refund = new Paymill\Models\Request\Refund(); +$refund->setId('tran_023d3b5769321c649435') + ->setAmount(4200) // e.g. "4200" for 42.00 EUR + ->setDescription('Sample Description'); + +$response = $request->create($refund); diff --git a/samples/refunds/export_refunds_list.php b/samples/refunds/export_refunds_list.php new file mode 100644 index 0000000..28384a7 --- /dev/null +++ b/samples/refunds/export_refunds_list.php @@ -0,0 +1 @@ +/* Not implemented yet */ diff --git a/samples/refunds/get_refund_details.php b/samples/refunds/get_refund_details.php new file mode 100644 index 0000000..be9b354 --- /dev/null +++ b/samples/refunds/get_refund_details.php @@ -0,0 +1,4 @@ +$refund = new Paymill\Models\Request\Refund(); +$refund->setId('refund_773ab6f9cd03428953c9'); + +$response = $request->getOne($refund); diff --git a/samples/refunds/list_refunds.php b/samples/refunds/list_refunds.php new file mode 100644 index 0000000..eb7de2d --- /dev/null +++ b/samples/refunds/list_refunds.php @@ -0,0 +1,3 @@ +$refund = new Paymill\Models\Request\Refund(); + +$response = $request->getAll($refund); diff --git a/samples/subscriptions/cancel_subscription.php b/samples/subscriptions/cancel_subscription.php new file mode 100644 index 0000000..e28cf67 --- /dev/null +++ b/samples/subscriptions/cancel_subscription.php @@ -0,0 +1,5 @@ +$subscription = new Paymill\Models\Request\Subscription(); +$subscription->setId('sub_dea86e5c65b2087202e3'); + ->setRemove(false); + +$response = $request->delete($subscription); diff --git a/samples/subscriptions/create_new_subscription_with_an_offer.php b/samples/subscriptions/create_new_subscription_with_an_offer.php new file mode 100644 index 0000000..5ae8710 --- /dev/null +++ b/samples/subscriptions/create_new_subscription_with_an_offer.php @@ -0,0 +1,8 @@ +$subscription = new Paymill\Models\Request\Subscription(); +$subscription->setClient('client_81c8ab98a8ac5d69f749') + ->setOffer('offer_40237e20a7d5a231d99b'); + ->setPayment('pay_5e078197cde8a39e4908f8aa'); + ->setPeriodOfValidity('2 YEAR'); + ->setStartAt(1400575533); + +$response = $request->create($subscription); diff --git a/samples/subscriptions/create_new_subscription_with_an_offer_and_different_values.php b/samples/subscriptions/create_new_subscription_with_an_offer_and_different_values.php new file mode 100644 index 0000000..aa07170 --- /dev/null +++ b/samples/subscriptions/create_new_subscription_with_an_offer_and_different_values.php @@ -0,0 +1,12 @@ +$subscription = new Paymill\Models\Request\Subscription(); +$subscription->setClient('client_81c8ab98a8ac5d69f749') + ->setOffer('offer_40237e20a7d5a231d99b'); + ->setAmount(3000); + ->setPayment('pay_5e078197cde8a39e4908f8aa'); + ->setCurrency('EUR'); + ->setInterval('1 week,monday'); + ->setName('Example Subscription'); + ->setPeriodOfValidity('2 YEAR'); + ->setStartAt('1400575533'); + +$response = $request->create($subscription); diff --git a/samples/subscriptions/create_new_subscription_without_an_offer.php b/samples/subscriptions/create_new_subscription_without_an_offer.php new file mode 100644 index 0000000..4cd1935 --- /dev/null +++ b/samples/subscriptions/create_new_subscription_without_an_offer.php @@ -0,0 +1,11 @@ +$subscription = new Paymill\Models\Request\Subscription(); +$subscription->setClient('client_81c8ab98a8ac5d69f749') + ->setAmount(3000); + ->setPayment('pay_5e078197cde8a39e4908f8aa'); + ->setCurrency('EUR'); + ->setInterval('1 week,monday'); + ->setName('Example Subscription'); + ->setPeriodOfValidity('2 YEAR'); + ->setStartAt('1400575533'); + +$response = $request->create($subscription); diff --git a/samples/subscriptions/delete_subscription.php b/samples/subscriptions/delete_subscription.php new file mode 100644 index 0000000..ee1ba29 --- /dev/null +++ b/samples/subscriptions/delete_subscription.php @@ -0,0 +1,5 @@ +$subscription = new Paymill\Models\Request\Subscription(); +$subscription->setId('sub_dea86e5c65b2087202e3'); + ->setRemove(true); + +$response = $request->delete($subscription); diff --git a/samples/subscriptions/export_subscriptions_list.php b/samples/subscriptions/export_subscriptions_list.php new file mode 100644 index 0000000..28384a7 --- /dev/null +++ b/samples/subscriptions/export_subscriptions_list.php @@ -0,0 +1 @@ +/* Not implemented yet */ diff --git a/samples/subscriptions/get_subscription_details.php b/samples/subscriptions/get_subscription_details.php new file mode 100644 index 0000000..d53a1bd --- /dev/null +++ b/samples/subscriptions/get_subscription_details.php @@ -0,0 +1,4 @@ +$subscription = new Paymill\Models\Request\Subscription(); +$subscription->setId('sub_dc180b755d10da324864'); + +$response = $request->getOne($subscription); diff --git a/samples/subscriptions/list_subscriptions.php b/samples/subscriptions/list_subscriptions.php new file mode 100644 index 0000000..865d9a8 --- /dev/null +++ b/samples/subscriptions/list_subscriptions.php @@ -0,0 +1,3 @@ +$subscription = new Paymill\Models\Request\Subscription(); + +$response = $request->getAll($subscription); diff --git a/samples/subscriptions/pause_subscription.php b/samples/subscriptions/pause_subscription.php new file mode 100644 index 0000000..ba79dff --- /dev/null +++ b/samples/subscriptions/pause_subscription.php @@ -0,0 +1,5 @@ +$subscription = new Paymill\Models\Request\Subscription(); +$subscription->setId('sub_dea86e5c65b2087202e3'); + ->setPause(true); + +$response = $request->update($subscription); diff --git a/samples/subscriptions/update_subscription.php b/samples/subscriptions/update_subscription.php new file mode 100644 index 0000000..9bb2998 --- /dev/null +++ b/samples/subscriptions/update_subscription.php @@ -0,0 +1,13 @@ +$subscription = new Paymill\Models\Request\Subscription(); +$subscription->setId('sub_dea86e5c65b2087202e3'); + ->setClient('client_81c8ab98a8ac5d69f749') + ->setOffer('offer_40237e20a7d5a231d99b'); + ->setAmount(3000); + ->setPayment('pay_95ba26ba2c613ebb0ca8'); + ->setCurrency('USD'); + ->setInterval('1 month,friday'); + ->setName('Changed Subscription'); + ->setPeriodOfValidity('14 MONTH'); + ->setTrialEnd(false); + +$response = $request->update($subscription); diff --git a/samples/subscriptions/update_subscription_amount.php b/samples/subscriptions/update_subscription_amount.php new file mode 100644 index 0000000..a64e5c2 --- /dev/null +++ b/samples/subscriptions/update_subscription_amount.php @@ -0,0 +1,6 @@ +$subscription = new Paymill\Models\Request\Subscription(); +$subscription->setId('sub_dea86e5c65b2087202e3'); + ->setAmount(1234); + ->setAmountChangeType(0); + +$response = $request->update($subscription); diff --git a/samples/subscriptions/update_subscription_offer.php b/samples/subscriptions/update_subscription_offer.php new file mode 100644 index 0000000..a022584 --- /dev/null +++ b/samples/subscriptions/update_subscription_offer.php @@ -0,0 +1,6 @@ +$subscription = new Paymill\Models\Request\Subscription(); +$subscription->setId('sub_dea86e5c65b2087202e3'); + ->setOffer('offer_d7e9813a25e89c5b78bd'); + ->setOfferChangeType(2); + +$response = $request->update($subscription); diff --git a/samples/transactions/create_new_transaction_with_app_fee.php b/samples/transactions/create_new_transaction_with_app_fee.php new file mode 100644 index 0000000..d2e4a59 --- /dev/null +++ b/samples/transactions/create_new_transaction_with_app_fee.php @@ -0,0 +1,10 @@ +$transaction = new Paymill\Models\Request\Transaction(); +$transaction->setAmount(4200) // e.g. "4200" for 42.00 EUR + ->setCurrency('EUR') + ->setToken('098f6bcd4621d373cade4e832627b4f6') + ->setDescription('Test Transaction') + ->setFeeAmount(420) + ->setFeePayment('pay_3af44644dd6d25c820a8') + ->setFeeCurrency('EUR'); + +$response = $request->create($transaction); diff --git a/samples/transactions/create_new_transaction_with_client_and_payment.php b/samples/transactions/create_new_transaction_with_client_and_payment.php new file mode 100644 index 0000000..e225186 --- /dev/null +++ b/samples/transactions/create_new_transaction_with_client_and_payment.php @@ -0,0 +1,8 @@ +$transaction = new Paymill\Models\Request\Transaction(); +$transaction->setAmount(4200) // e.g. "4200" for 42.00 EUR + ->setCurrency('EUR') + ->setClient('client_c781b1d2f7f0f664b4d9') + ->setPayment('pay_2f82a672574647cd911d') + ->setDescription('Test Transaction'); + +$response = $request->create($transaction); diff --git a/samples/transactions/create_new_transaction_with_payment.php b/samples/transactions/create_new_transaction_with_payment.php new file mode 100644 index 0000000..a7b9436 --- /dev/null +++ b/samples/transactions/create_new_transaction_with_payment.php @@ -0,0 +1,7 @@ +$transaction = new Paymill\Models\Request\Transaction(); +$transaction->setAmount(4200) // e.g. "4200" for 42.00 EUR + ->setCurrency('EUR') + ->setPayment('pay_2f82a672574647cd911d') + ->setDescription('Test Transaction'); + +$response = $request->create($transaction); diff --git a/samples/transactions/create_new_transaction_with_preauthorization.php b/samples/transactions/create_new_transaction_with_preauthorization.php new file mode 100644 index 0000000..a8a1dd3 --- /dev/null +++ b/samples/transactions/create_new_transaction_with_preauthorization.php @@ -0,0 +1,7 @@ +$transaction = new Paymill\Models\Request\Transaction(); +$transaction->setAmount(4200) // e.g. "4200" for 42.00 EUR + ->setCurrency('EUR') + ->setPreauthorization('preauth_ec54f67e52e92051bd65') + ->setDescription('Test Transaction'); + +$response = $request->create($transaction); diff --git a/samples/transactions/create_new_transaction_with_token.php b/samples/transactions/create_new_transaction_with_token.php new file mode 100644 index 0000000..e88d6be --- /dev/null +++ b/samples/transactions/create_new_transaction_with_token.php @@ -0,0 +1,7 @@ +$transaction = new Paymill\Models\Request\Transaction(); +$transaction->setAmount(4200) // e.g. "4200" for 42.00 EUR + ->setCurrency('EUR') + ->setToken('098f6bcd4621d373cade4e832627b4f6') + ->setDescription('Test Transaction'); + +$response = $request->create($transaction); diff --git a/samples/transactions/export_transactions_list.php b/samples/transactions/export_transactions_list.php new file mode 100644 index 0000000..28384a7 --- /dev/null +++ b/samples/transactions/export_transactions_list.php @@ -0,0 +1 @@ +/* Not implemented yet */ diff --git a/samples/transactions/get_transaction_details_by_id.php b/samples/transactions/get_transaction_details_by_id.php new file mode 100644 index 0000000..ff66109 --- /dev/null +++ b/samples/transactions/get_transaction_details_by_id.php @@ -0,0 +1,4 @@ +$transaction = new Paymill\Models\Request\Transaction(); +$transaction->setId('tran_023d3b5769321c649435'); + +$response = $request->getOne($transaction); diff --git a/samples/transactions/get_transaction_details_by_slv.php b/samples/transactions/get_transaction_details_by_slv.php new file mode 100644 index 0000000..cdf91bc --- /dev/null +++ b/samples/transactions/get_transaction_details_by_slv.php @@ -0,0 +1,4 @@ +$transaction = new Paymill\Models\Request\Transaction(); +$transaction->setId('slv_4125875679'); + +$response = $request->getOne($transaction); diff --git a/samples/transactions/list_transactions.php b/samples/transactions/list_transactions.php new file mode 100644 index 0000000..31e6f04 --- /dev/null +++ b/samples/transactions/list_transactions.php @@ -0,0 +1,3 @@ +$transaction = new Paymill\Models\Request\Transaction(); + +$response = $request->getAll($transaction); diff --git a/samples/transactions/upate_transaction.php b/samples/transactions/upate_transaction.php new file mode 100644 index 0000000..54829c3 --- /dev/null +++ b/samples/transactions/upate_transaction.php @@ -0,0 +1,5 @@ +$transaction = new Paymill\Models\Request\Transaction(); +$transaction->setId('tran_023d3b5769321c649435') + ->setDescription('My updated transaction description'); + +$response = $request->update($transaction); diff --git a/samples/webhooks/create_new_email_webhook.php b/samples/webhooks/create_new_email_webhook.php new file mode 100644 index 0000000..a72698d --- /dev/null +++ b/samples/webhooks/create_new_email_webhook.php @@ -0,0 +1,8 @@ +$webhook = new Paymill\Models\Request\Webhook(); +$webhook->setEmail('') + ->setEventTypes(array( + 'transaction.succeeded', + 'transaction.failed' + )); + +$response = $request->create($webhook); diff --git a/samples/webhooks/create_new_url_webhook.php b/samples/webhooks/create_new_url_webhook.php new file mode 100644 index 0000000..8e0a836 --- /dev/null +++ b/samples/webhooks/create_new_url_webhook.php @@ -0,0 +1,8 @@ +$webhook = new Paymill\Models\Request\Webhook(); +$webhook->setUrl('') + ->setEventTypes(array( + 'transaction.succeeded', + 'transaction.failed' + )); + +$response = $request->create($webhook); diff --git a/samples/webhooks/export_webhooks_list.php b/samples/webhooks/export_webhooks_list.php new file mode 100644 index 0000000..28384a7 --- /dev/null +++ b/samples/webhooks/export_webhooks_list.php @@ -0,0 +1 @@ +/* Not implemented yet */ diff --git a/samples/webhooks/get_webhook_details.php b/samples/webhooks/get_webhook_details.php new file mode 100644 index 0000000..a5a7e94 --- /dev/null +++ b/samples/webhooks/get_webhook_details.php @@ -0,0 +1,4 @@ +$webhook = new Paymill\Models\Request\Webhook(); +$webhook->setId('hook_40237e20a7d5a231d99b'); + +$response = $request->getOne($webhook); diff --git a/samples/webhooks/list_webhooks.php b/samples/webhooks/list_webhooks.php new file mode 100644 index 0000000..4dc1142 --- /dev/null +++ b/samples/webhooks/list_webhooks.php @@ -0,0 +1,7 @@ +$webhook = new Paymill\Models\Request\Webhook(); +$webhook->setFilter(array( + 'count' => 2, + 'offset' => 0 +)); + +$response = $request->getAll($webhook); diff --git a/samples/webhooks/remove_webhook.php b/samples/webhooks/remove_webhook.php new file mode 100644 index 0000000..ab6a60b --- /dev/null +++ b/samples/webhooks/remove_webhook.php @@ -0,0 +1,4 @@ +$webhook = new Paymill\Models\Request\Webhook(); +$webhook->setId('hook_40237e20a7d5a231d99b'); + +$response = $request->delete($webhook); diff --git a/samples/webhooks/update_webhook.php b/samples/webhooks/update_webhook.php new file mode 100644 index 0000000..559b96a --- /dev/null +++ b/samples/webhooks/update_webhook.php @@ -0,0 +1,9 @@ +$webhook = new Paymill\Models\Request\Webhook(); +$webhook->setId('hook_40237e20a7d5a231d99b') + ->setUrl('') + ->setEventTypes(array( + 'transaction.failed', + 'subscription.failed' + )); + +$response = $request->update($webhook);