在 Xpages (9.0.1FP9) 中。我正在使用 extlib 从支付网关 (Braintree) 接收 webhook。REST 服务/serviceBean。我从 webhook 获取包并且可以解析信息。但我无法获取 JAVA 内部 Domino 会话的句柄,因此我无法创建或更新 Notes 文档。我的 JAVA 技能有限,所以我被困住了。任何帮助,将不胜感激。Xpage{ <xe:restService id="JSONSearch" pathInfo="test1" state="false"> <xe:this.service> <xe:customRestService contentType="application/json" serviceBean="com.mydomain.bt_Webhook1"> </xe:customRestService> </xe:this.service> </xe:restService>}package com.mydomain;import java.io.IOException;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import com.ibm.domino.services.ServiceException;import com.ibm.domino.services.rest.RestServiceEngine;import com.ibm.xsp.extlib.component.rest.CustomService;import com.ibm.xsp.extlib.component.rest.CustomServiceBean;import com.braintreegateway.*;import lotus.domino.*;public class bt_Webhook1 extends CustomServiceBean{//===================================================================== String btMerchantID = "abcdefgh1i2jk3lm"; String btPrivateKey = "abcdefghijkl2mnopq3rstuv4wxyz"; String btPublicKey = "zyxwvutsr1qpo2nm"; BraintreeGateway gateway = new BraintreeGateway( Environment.SANDBOX, //Environment.SANDBOX or Environment.PRODUCTION btMerchantID, //Merchant ID btPublicKey, //Public Key btPrivateKey //Private Key ); //===================================================================== );
1 回答
www说
TA贡献1775条经验 获得超8个赞
您可以通过session
从 XPage 运行时解析对象来获取它,例如Session s = (Session) ExtLibUtil.resolveVariable("session");
ExtLibUtil
给出了他使用FacesContext
.
添加回答
举报
0/150
提交
取消