| @@ 20-71 (lines=52) @@ | ||
| 17 | * @author Vuong Minh <[email protected]> |
|
| 18 | * @since 1.0.0 |
|
| 19 | */ |
|
| 20 | class AppInAppGateway extends AbstractGateway |
|
| 21 | { |
|
| 22 | use Concerns\Parameters; |
|
| 23 | ||
| 24 | /** |
|
| 25 | * {@inheritdoc} |
|
| 26 | */ |
|
| 27 | public function getName(): string |
|
| 28 | { |
|
| 29 | return 'MoMo AIA'; |
|
| 30 | } |
|
| 31 | ||
| 32 | /** |
|
| 33 | * {@inheritdoc} |
|
| 34 | * @return \Omnipay\Common\Message\RequestInterface|PurchaseRequest |
|
| 35 | */ |
|
| 36 | public function purchase(array $options = []): PurchaseRequest |
|
| 37 | { |
|
| 38 | return $this->createRequest(PurchaseRequest::class, $options); |
|
| 39 | } |
|
| 40 | ||
| 41 | /** |
|
| 42 | * Tạo yêu cầu xác nhận hoàn thành hoặc hủy bỏ giao dịch đến MoMo. |
|
| 43 | * |
|
| 44 | * @param array $options |
|
| 45 | * @return \Omnipay\Common\Message\RequestInterface|PayConfirmRequest |
|
| 46 | */ |
|
| 47 | public function payConfirm(array $options = []): PayConfirmRequest |
|
| 48 | { |
|
| 49 | return $this->createRequest(PayConfirmRequest::class, $options); |
|
| 50 | } |
|
| 51 | ||
| 52 | /** |
|
| 53 | * Tạo yêu cầu truy vấn thông tin giao dịch đến MoMo. |
|
| 54 | * |
|
| 55 | * @param array $options |
|
| 56 | * @return \Omnipay\Common\Message\RequestInterface|PayQueryStatusRequest |
|
| 57 | */ |
|
| 58 | public function queryTransaction(array $options = []): PayQueryStatusRequest |
|
| 59 | { |
|
| 60 | return $this->createRequest(PayQueryStatusRequest::class, $options); |
|
| 61 | } |
|
| 62 | ||
| 63 | /** |
|
| 64 | * {@inheritdoc} |
|
| 65 | * @return \Omnipay\Common\Message\RequestInterface|PayRefundRequest |
|
| 66 | */ |
|
| 67 | public function refund(array $options = []): PayRefundRequest |
|
| 68 | { |
|
| 69 | return $this->createRequest(PayRefundRequest::class, $options); |
|
| 70 | } |
|
| 71 | } |
|
| 72 | ||
| @@ 20-71 (lines=52) @@ | ||
| 17 | * @author Vuong Minh <[email protected]> |
|
| 18 | * @since 1.0.0 |
|
| 19 | */ |
|
| 20 | class POSGateway extends AbstractGateway |
|
| 21 | { |
|
| 22 | use Concerns\Parameters; |
|
| 23 | ||
| 24 | /** |
|
| 25 | * {@inheritdoc} |
|
| 26 | */ |
|
| 27 | public function getName(): string |
|
| 28 | { |
|
| 29 | return 'MoMo POS'; |
|
| 30 | } |
|
| 31 | ||
| 32 | /** |
|
| 33 | * {@inheritdoc} |
|
| 34 | * @return \Omnipay\Common\Message\RequestInterface|PurchaseRequest |
|
| 35 | */ |
|
| 36 | public function purchase(array $options = []): PurchaseRequest |
|
| 37 | { |
|
| 38 | return $this->createRequest(PurchaseRequest::class, $options); |
|
| 39 | } |
|
| 40 | ||
| 41 | /** |
|
| 42 | * Tạo yêu cầu xác nhận hoàn thành hoặc hủy bỏ giao dịch đến MoMo. |
|
| 43 | * |
|
| 44 | * @param array $options |
|
| 45 | * @return \Omnipay\Common\Message\RequestInterface|PayConfirmRequest |
|
| 46 | */ |
|
| 47 | public function payConfirm(array $options = []): PayConfirmRequest |
|
| 48 | { |
|
| 49 | return $this->createRequest(PayConfirmRequest::class, $options); |
|
| 50 | } |
|
| 51 | ||
| 52 | /** |
|
| 53 | * Tạo yêu cầu truy vấn thông tin giao dịch đến MoMo. |
|
| 54 | * |
|
| 55 | * @param array $options |
|
| 56 | * @return \Omnipay\Common\Message\RequestInterface|PayQueryStatusRequest |
|
| 57 | */ |
|
| 58 | public function queryTransaction(array $options = []): PayQueryStatusRequest |
|
| 59 | { |
|
| 60 | return $this->createRequest(PayQueryStatusRequest::class, $options); |
|
| 61 | } |
|
| 62 | ||
| 63 | /** |
|
| 64 | * {@inheritdoc} |
|
| 65 | * @return \Omnipay\Common\Message\RequestInterface|PayRefundRequest |
|
| 66 | */ |
|
| 67 | public function refund(array $options = []): PayRefundRequest |
|
| 68 | { |
|
| 69 | return $this->createRequest(PayRefundRequest::class, $options); |
|
| 70 | } |
|
| 71 | } |
|
| 72 | ||
| @@ 20-73 (lines=54) @@ | ||
| 17 | * @author Vuong Minh <[email protected]> |
|
| 18 | * @since 1.0.0 |
|
| 19 | */ |
|
| 20 | class QRCodeGateway extends AbstractGateway |
|
| 21 | { |
|
| 22 | use Concerns\Parameters; |
|
| 23 | ||
| 24 | /** |
|
| 25 | * {@inheritdoc} |
|
| 26 | */ |
|
| 27 | public function getName(): string |
|
| 28 | { |
|
| 29 | return 'MoMo QRCode'; |
|
| 30 | } |
|
| 31 | ||
| 32 | /** |
|
| 33 | * Tạo request notification gửi từ MoMo. |
|
| 34 | * |
|
| 35 | * @param array $options |
|
| 36 | * @return \Omnipay\Common\Message\RequestInterface|NotificationRequest |
|
| 37 | */ |
|
| 38 | public function notification(array $options = []): NotificationRequest |
|
| 39 | { |
|
| 40 | return $this->createRequest(NotificationRequest::class, $options); |
|
| 41 | } |
|
| 42 | ||
| 43 | /** |
|
| 44 | * Tạo yêu cầu xác nhận hoàn thành hoặc hủy bỏ giao dịch đến MoMo. |
|
| 45 | * |
|
| 46 | * @param array $options |
|
| 47 | * @return \Omnipay\Common\Message\RequestInterface|PayConfirmRequest |
|
| 48 | */ |
|
| 49 | public function payConfirm(array $options = []): PayConfirmRequest |
|
| 50 | { |
|
| 51 | return $this->createRequest(PayConfirmRequest::class, $options); |
|
| 52 | } |
|
| 53 | ||
| 54 | /** |
|
| 55 | * Tạo yêu cầu truy vấn thông tin giao dịch đến MoMo. |
|
| 56 | * |
|
| 57 | * @param array $options |
|
| 58 | * @return \Omnipay\Common\Message\RequestInterface|PayQueryStatusRequest |
|
| 59 | */ |
|
| 60 | public function queryTransaction(array $options = []): PayQueryStatusRequest |
|
| 61 | { |
|
| 62 | return $this->createRequest(PayQueryStatusRequest::class, $options); |
|
| 63 | } |
|
| 64 | ||
| 65 | /** |
|
| 66 | * {@inheritdoc} |
|
| 67 | * @return \Omnipay\Common\Message\RequestInterface|PayRefundRequest |
|
| 68 | */ |
|
| 69 | public function refund(array $options = []): PayRefundRequest |
|
| 70 | { |
|
| 71 | return $this->createRequest(PayRefundRequest::class, $options); |
|
| 72 | } |
|
| 73 | } |
|
| 74 | ||