All Downloads are FREE. Search and download functionalities are using the official Maven repository.

matrix.business.pay.controller.ForwardPayController Maven / Gradle / Ivy

There is a newer version: 2.1.11
Show newest version
package matrix.business.pay.controller;

import matrix.boot.based.utils.WebUtil;
import matrix.business.pay.selector.PayTemplateSelector;
import matrix.business.pay.templates.AbstractTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * 转向接口,统一对外封装
 *
 * @author wangcheng
 */
@RestController
public class ForwardPayController {

    /**
     * 获取返回地址或信息
     *
     * @param name  模板名称
     * @param payId 支付ID
     * @return 地址或信息
     * @throws IOException 异常
     */
    @GetMapping("/forward-pay/{name}/{payId}")
    public String pay(@PathVariable String name, @PathVariable String payId) throws IOException {
        AbstractTemplate template = WebUtil.getBean(PayTemplateSelector.class).get(name);
        return template.obtainSDKPayInfo(payId);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy