Skip to content

qpay-sdk/qpay-spring-boot-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QPay Spring Boot Starter

CI Maven Central License: MIT

QPay V2 payment integration for Spring Boot.

Install

Maven:

<dependency>
    <groupId>mn.qpay</groupId>
    <artifactId>qpay-spring-boot-starter</artifactId>
    <version>1.0.0</version>
</dependency>

Configuration

qpay.base-url=https://merchant.qpay.mn
qpay.username=your_username
qpay.password=your_password
qpay.invoice-code=your_invoice_code
qpay.callback-url=https://yoursite.com/qpay/webhook

Usage

@Autowired
private QPayTemplate qpay;

InvoiceResponse invoice = qpay.createSimpleInvoice("ORDER-001", 10000);
// invoice.getQrImage(), invoice.getUrls()

Webhook Events

@EventListener
public void onPayment(QPayWebhookEvent event) {
    String invoiceId = event.getInvoiceId();
    // handle payment
}

Thymeleaf

<div th:replace="~{fragments/qpay :: qr-code(${invoice.qrImage}, 256)}"></div>
<div th:replace="~{fragments/qpay :: payment-buttons(${invoice.urls})}"></div>

License

MIT

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors