| | |
| | | import com.yeshi.buwan.exception.vip.VIPException; |
| | | import com.yeshi.buwan.exception.vip.VideoBuyRecordException; |
| | | import com.yeshi.buwan.job.OrderJob; |
| | | import com.yeshi.buwan.util.user.VipUtil; |
| | | import com.yeshi.buwan.util.vip.VIPOrderUtil; |
| | | import com.yeshi.buwan.videos.pptv.PPTVVipManager; |
| | | import com.yeshi.buwan.service.inter.order.OrderService; |
| | | import com.yeshi.buwan.service.inter.vip.VIPPriceService; |
| | |
| | | import org.springframework.test.context.ContextConfiguration; |
| | | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; |
| | | import org.springframework.test.context.web.WebAppConfiguration; |
| | | import org.yeshi.utils.alipay.AlipayH5PayUtil; |
| | | import org.yeshi.utils.wx.WXPayV3Util; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Scanner; |
| | | |
| | | @RunWith(SpringJUnit4ClassRunner.class) //使用junit4进行测试 |
| | | @ContextConfiguration(locations = {"classpath:spring.xml"}) |
| | | @WebAppConfiguration |
| | | //@RunWith(SpringJUnit4ClassRunner.class) //使用junit4进行测试 |
| | | //@ContextConfiguration(locations = {"classpath:spring.xml"}) |
| | | //@WebAppConfiguration |
| | | public class VIPTest { |
| | | |
| | | @Resource |
| | |
| | | } |
| | | } |
| | | |
| | | @Test |
| | | public void refoundWX() { |
| | | //退款 |
| | | try { |
| | | Scanner scanner = new Scanner(new FileInputStream(new File("C:\\Users\\Administrator\\Desktop\\wx退款订单.txt"))); |
| | | while (scanner.hasNextLine()) { |
| | | String st = scanner.nextLine(); |
| | | String[] sts = st.split(" "); |
| | | String line = ""; |
| | | line += "buwan_vip_" + sts[0] + ","; |
| | | line += sts[1] + ","; |
| | | line += "影视大全VIP权益终止退回,"; |
| | | line += "buwan_vip_" + sts[0]; |
| | | System.out.println(line); |
| | | } |
| | | |
| | | scanner.close(); |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | @Test |
| | | public void refoundAlipay() { |
| | | //退款 |
| | | try { |
| | | Scanner scanner = new Scanner(new FileInputStream(new File("C:\\Users\\Administrator\\Desktop\\退款\\alipay.txt"))); |
| | | while (scanner.hasNextLine()) { |
| | | String st = scanner.nextLine(); |
| | | String[] sts = st.split(" "); |
| | | String id = sts[0]; |
| | | String money = sts[1]; |
| | | String orderId = VIPOrderUtil.getOutOrderNo(OrderType.vip, id); |
| | | AlipayH5PayUtil.refund(VipUtil.getAlipayApp(), orderId, null, new BigDecimal(money), orderId); |
| | | } |
| | | |
| | | scanner.close(); |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | // |
| | | |
| | | } |
| | | |
| | | |