小编Jas*_*ran的帖子

react.js的paypal按钮

所以我试图让paypal按钮显示在我的应用程序上,但我无法让它工作.我基于这个jsfiddle. https://jsfiddle.net/rbacekkb/

我试图放入我的应用程序,但按钮没有显示在我想要的页面上.我不知道我做错了什么.

paypal.jsx

import React from 'react';



class PayPalButton extends React.Component {
    constructor() {
        super();
        // you can take this value from a config.js module for example.
        this.merchantId = '6XF3MPZBZV6HU';
    }

    componentDidMount() {
        let container = this.props.id;
        let merchantId = this.merchantId;
        window.paypalCheckoutReady = function() {
            paypal.checkout.setup(merchantId, {
                locale: 'en_US',
                environment: 'sandbox',
                container: container,
            });
        }
    }

    render() {
        return(
            <a id={this.props.id} href="/checkout" />
        );
    }
}

module.exports = PayPalButton;
Run Code Online (Sandbox Code Playgroud)

试图让它出现在这个目前正在测试的页面中.

home.jsx

import React from "react";
import {Grid,Row,Col,Button,Jumbotron, Carousel, Panel} …
Run Code Online (Sandbox Code Playgroud)

javascript paypal reactjs

1
推荐指数
1
解决办法
5575
查看次数

$ http.get(...).成功不是一个功能

所以我正在开发一个带角度1的小应用程序,文件上传,我发现有些变化我不知道,因为控制器中编码https的方式现在不同了.由于旧的方式现在导致http.get.success不是一个函数.我需要帮助了解从1.4角度1到我现在必须使用我的控制器执行的当前版本的更改,以便我的其余API中的数据显示在我的HTML上.因为我得到$ http.get(..).成功现在不是函数错误.

  gallerycontroller

       var galleryCtrl = angular.module('galleryCtrl', []);
galleryCtrl.controller('galleryController', function($scope, $http) {
    $scope.superheroes= [];
    //Retrieve all the superheroes to show the gallery
    $http({
        method: 'GET',
        url: '/superhero'
    })
        .success(function (data, status, headers, config) {
            console.log(data);
        })
        .error(function (data, status, headers, config) {
            console.log(data)
        })
});

gallery.html 
    <!-- view the gallery of all the superheroes in the db -->
    <div class="row">
        <div ng-repeat="superhero in superheroes">
            <div class="col-md-4 col-xs-6  col-sm-offset-0">
                <div class="thumbnail">
                    <img ng-src="{{superhero.picture.url | fpConvert: {filter:'sharpen', w:300, h:150} }}" />
                    <div …
Run Code Online (Sandbox Code Playgroud)

node.js angularjs

0
推荐指数
1
解决办法
919
查看次数

标签 统计

angularjs ×1

javascript ×1

node.js ×1

paypal ×1

reactjs ×1