|
| 1 | +<?php |
| 2 | + |
| 3 | +/** |
| 4 | + * Stripe Fetch Application Fee Request. |
| 5 | + */ |
| 6 | + |
| 7 | +namespace Omnipay\Stripe\Message; |
| 8 | + |
| 9 | +/** |
| 10 | + * Stripe Fetch Application Fee Request. |
| 11 | + * |
| 12 | + * Example -- note this example assumes that an application fee has been successful. |
| 13 | + * |
| 14 | + * <code> |
| 15 | + * // Fetch the transaction so that details can be found for refund, etc. |
| 16 | + * $transaction = $gateway->fetchApplicationFee(); |
| 17 | + * $transaction->setApplicationFeeReference($application_fee_id); |
| 18 | + * $response = $transaction->send(); |
| 19 | + * $data = $response->getData(); |
| 20 | + * echo "Gateway fetchApplicationFee response data == " . print_r($data, true) . "\n"; |
| 21 | + * </code> |
| 22 | + * |
| 23 | + * @see \Omnipay\Stripe\Gateway |
| 24 | + * |
| 25 | + * @link https://stripe.com/docs/api#retrieve_application_fee |
| 26 | + */ |
| 27 | +class FetchApplicationFeeRequest extends AbstractRequest |
| 28 | +{ |
| 29 | + /** |
| 30 | + * Get the application fee reference |
| 31 | + * |
| 32 | + * @return string |
| 33 | + */ |
| 34 | + public function getApplicationFeeReference() |
| 35 | + { |
| 36 | + return $this->getParameter('applicationFeeReference'); |
| 37 | + } |
| 38 | + |
| 39 | + /** |
| 40 | + * Set the application fee reference |
| 41 | + * |
| 42 | + * @param string $value |
| 43 | + * |
| 44 | + * @return AbstractRequest provides a fluent interface. |
| 45 | + */ |
| 46 | + public function setApplicationFeeReference($value) |
| 47 | + { |
| 48 | + return $this->setParameter('applicationFeeReference', $value); |
| 49 | + } |
| 50 | + |
| 51 | + public function getData() |
| 52 | + { |
| 53 | + $this->validate('applicationFeeReference'); |
| 54 | + |
| 55 | + $data = array(); |
| 56 | + |
| 57 | + return $data; |
| 58 | + } |
| 59 | + |
| 60 | + public function getEndpoint() |
| 61 | + { |
| 62 | + return $this->endpoint . '/application_fees/' . $this->getApplicationFeeReference(); |
| 63 | + } |
| 64 | + |
| 65 | + public function getHttpMethod() |
| 66 | + { |
| 67 | + return 'GET'; |
| 68 | + } |
| 69 | +} |
0 commit comments