Android付费整合

时间:2017-05-22 06:05:40

标签: android in-app-billing android-pay

我想在我的应用程序中集成Android pay集成,我从这个repo获得了源代码:https://github.com/android-pay/androidpay-quickstart

我的问题是:

 - (void)viewDidLoad
{
[super viewDidLoad];

[self addWavesToView];
[self addAnimationsToLayers];
}

- (void)addWavesToView
 {
    CGRect rect = CGRectMake(0.0f, 0.0f, 300.0f, 300.0f);
    UIBezierPath *circlePath = [UIBezierPath 
    bezierPathWithOvalInRect:rect];

for (NSInteger i = 0; i < 10; ++i) {
    CAShapeLayer *waveLayer = [CAShapeLayer layer];
    waveLayer.bounds = rect;
    waveLayer.position = CGPointMake(100, 100);
    waveLayer.strokeColor = [[UIColor lightGrayColor] CGColor];
    waveLayer.fillColor = [[UIColor clearColor] CGColor];
    waveLayer.lineWidth = 5.0f;
    waveLayer.path = circlePath.CGPath;


    waveLayer.transform = CATransform3DMakeTranslation(0.0f, i*25, 0.0f);
    waveLayer.strokeStart = 0.25- ((i+1) * 0.01f);
    waveLayer.strokeEnd = 0.25+((i+1) * 0.01f);

    [self.view.layer addSublayer:waveLayer];
}
 }

 - (void)addAnimationsToLayers
 {
NSInteger timeOffset = 10;
for (CALayer *layer in self.view.layer.sublayers) {
    CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"strokeColor"];
    animation.duration = 10.0f;

    // Stagger the animations so they don't begin until the
    // desired time in each
    animation.timeOffset = timeOffset--;
    animation.toValue = (id)[[UIColor lightGrayColor] CGColor];
    animation.fromValue = (id)[[UIColor darkGrayColor] CGColor];

    // Repeat forever
    animation.repeatCount = HUGE_VALF;

    // Run it at 10x. You can adjust this to taste.
    animation.speed = 10;

    // Add to the layer to start the animation
    [layer addAnimation:animation forKey:@"strokeColor"];
}

在哪里可以获得<resources> <string name="public_key">BO39Rh43UGXMQy5PAWWe7UGWd2a9YRjNLPEEVe+zWIbdIgALcDcnYCuHbmrrzl 7h8FZjl6RCzoi5/cDrqXNRVSo=</string> <string name="stripe_publishable_key">REPLACE_ME</string> <string name="stripe_version">REPLACE_ME</string> </resources> stripe_publishable_key测试模式Android Pay?

1 个答案:

答案 0 :(得分:0)

如果您检查源代码,那么这两个字符串是only used in one location

...
if (mUseStripe) {
    // Stripe integration
    maskedWalletRequest = WalletUtil.createStripeMaskedWalletRequest(
            Constants.ITEMS_FOR_SALE[mItemId],
            getString(R.string.stripe_publishable_key),
            getString(R.string.stripe_version));
} else {
    ...

换句话说,只有当Stripe是您的付款处理者时,它们才有意义。它们的含义在Stripe documentation

中有解释
  

可发布的 API密钥仅用于识别您的帐户   条纹,他们不是秘密。换句话说,他们可以安全地   发布在诸如Stripe.js JavaScript代码之类的地方,或者在   Android或iPhone应用程序。可发布的密钥只能创建   令牌。

     

秘密 API密钥应保密,仅存储在您的密码上   自己的服务器您帐户的秘密API密钥可以执行任何API请求   条纹没有限制。