GithubHelp home page GithubHelp logo

blog's People

blog's Issues

In-App Purchase(苹果内购)

https://support.apple.com/zh-cn/HT202023

1 支付流程

IOS 应用内购( In App Purchase)有两种模式:

  • 单机模式
  • 服务端模式

由于单机模式有安全风险,这里只讲服务器模式,服务端模式的主要流程如下所示:

  1. App 从服务器获取产品标识列表
  2. App 从 App Store 获取产品信息
  3. 用户选择需要购买的产品
  4. App 发送支付请求到App Store
  5. App Store 处理支付请求,返回 transaction 信息
  6. App 将transaction receipt 发送到服务器
  7. 服务器收到收据后发送到 App Stroe 验证收据的有效性
  8. App Store 返回收据的验证结果
  9. 根据 App Store 返回的结果决定用户是否购买成功

2 服务端验证receipt

https://developer.apple.com/library/archive/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html#//apple_ref/doc/uid/TP40010573-CH104-SW1

import requests

receipt = "......"
r = requests.post('https://sandbox.itunes.apple.com/verifyReceipt',json={"receipt-data": receipt,"password": '******'})
r.status_code
r.json()
Status 描述
21000 App Store不能读取你提供的JSON对象
21002 receipt-data域的数据有问题
21003 receipt无法通过验证
21004 提供的shared secret不匹配你账号中的shared secret
21005 receipt服务器当前不可用
21006 receipt合法,但是订阅已过期。服务器接收到这个状态码时,receipt数据仍然会解码并一起发送
21007 receipt是Sandbox receipt,但却发送至生产系统的验证服务
21008 receipt是生产receipt,但却发送至Sandbox环境的验证服务

Yum Cheatsheet (速查表)

升级相关命令:  
yum update : 安装所有更新软件  
yum update xxx : 仅更新指定的软件  
yum check-update : 列出所有可更新的软件清单  
yum list : 列出所有可安裝的软件清单  
  
安装删除相关命令:  
yum install xxx: 仅安装指定的软件  
yum remove xxx: 删除指定的软件包  
  
yum查询相关命令:  
yum search : 使用YUM查找软件包  
yum list : 列出所有可安装的软件包  
yum list updates : 列出所有可更新的软件包  
yum list installed : 列出所有已安装的软件包  
yum list extras : 列出所有已安装但不在 Yum Repository 內的软件包  
yum info xxx: 使用YUM获取软件包信息  
yum info : 列出所有软件包的信息  
yum info updates : 列出所有可更新的软件包信息  
yum info installed : 列出所有已安裝的软件包信息  
yum info extras : 列出所有已安裝但不在 Yum Repository 內的软件包信息  
yum provides : 列出软件包提供哪些文件  
  
yum缓存相关命令:  
yum makecache : 生成元数据缓存  
yum clean packages : 清除缓存目录(/var/cache/yum)下的软件包  
yum clean headers : 清除缓存目录(/var/cache/yum)下的 headers  
yum clean oldheaders : 清除缓存目录(/var/cache/yum)下旧的 headers  
yum clean, yum clean all (= yum clean packages; yum clean oldheaders) : 清除缓存目录(/var/cache/yum)下的软件包及旧的headers  
  
yum -y update : #手动系统更新  
yum install [-y] [rpm包名]:以非交互式(默认选择y)的方式安装指定包  

https://access.redhat.com/articles/yum-cheat-sheet

yum_cheatsheet.pdf

Use Public Key Authentication with SSH (SSH证书登录)

1、创建证书

ssh-keygen -t rsa

cat id_rsa.pub >> authorized_keys
文件名 说明
id_rsa 证书私钥
id_rsa.pub 证书公钥

ssh公钥生效需满足至少下面两个条件:

  • .ssh目录的权限必须是700
  • .ssh/authorized_keys文件权限必须是600
chmod 700 ~/.ssh 
chmod 600 ~/.ssh/authorized_keys

2、配置文件

vi /etc/ssh/sshd_config
# SSH端口
Port 2022

#使用证书登陆 证书公钥文件位于.ssh/authorized_keys
RSAAuthentication yes                 # Centos 7中已废弃,可需要设置PubkeyAuthentication yes
PubkeyAuthentication yes

AuthorizedKeysFile      .ssh/authorized_keys

# 禁止使用密码登陆
PasswordAuthentication no

3、重启服务

systemctl restart sshd.service

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.