dekiru2022 / dekiru

0 stars 0 forks source link

決済画面実装 #33

Closed dekiru2022 closed 2 years ago

dekiru2022 commented 2 years ago

①サイトへ直接リンクをソースコードに実装 ⇨板坂 ②貴社サーバは[5]の弊社からの決済データの受け取り、DynamoDBに反映 レスポンスとして"SuccessOK"の文字列を出力してください ⇨ワカさん

dekiru2022 commented 2 years ago

決済データの受け取り テストイベント>

Tab

{ "clientip": "00000", "money": "1000", "sendId": "2c6e0181-53cc-4768-902e-1837731a0a4e", "telho": "09011111111", "email": "waka", "username": "waka", "rel": "yes", "cont":"yes" }

dekiru2022 commented 2 years ago

Tab

/**

package com.amazonaws.codesamples.gsg;

import java.util.Arrays;

import com.amazonaws.client.builder.AwsClientBuilder; import com.amazonaws.services.dynamodbv2.AmazonDynamoDB; import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClientBuilder; import com.amazonaws.services.dynamodbv2.document.DynamoDB; import com.amazonaws.services.dynamodbv2.document.Table; import com.amazonaws.services.dynamodbv2.document.UpdateItemOutcome; import com.amazonaws.services.dynamodbv2.document.spec.UpdateItemSpec; import com.amazonaws.services.dynamodbv2.document.utils.ValueMap; import com.amazonaws.services.dynamodbv2.model.ReturnValue;

public class MoviesItemOps03 {

public static void main(String[] args) throws Exception {

    AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard()
        .withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration("http://localhost:8000", "us-west-2"))
        .build();

    DynamoDB dynamoDB = new DynamoDB(client);

    Table table = dynamoDB.getTable("Movies");

    int year = 2015;
    String title = "The Big New Movie";

    UpdateItemSpec updateItemSpec = new UpdateItemSpec().withPrimaryKey("year", year, "title", title)
        .withUpdateExpression("set info.rating = :r, info.plot=:p, info.actors=:a")
        .withValueMap(new ValueMap().withNumber(":r", 5.5).withString(":p", "Everything happens all at once.")
            .withList(":a", Arrays.asList("Larry", "Moe", "Curly")))
        .withReturnValues(ReturnValue.UPDATED_NEW);

    try {
        System.out.println("Updating the item...");
        UpdateItemOutcome outcome = table.updateItem(updateItemSpec);
        System.out.println("UpdateItem succeeded:\n" + outcome.getItem().toJSONPretty());

    }
    catch (Exception e) {
        System.err.println("Unable to update item: " + year + " " + title);
        System.err.println(e.getMessage());
    }
}

}

dekiru2022 commented 2 years ago

https://docs.aws.amazon.com/ja_jp/amazondynamodb/latest/developerguide/GettingStarted.Java.03.html

dekiru2022 commented 2 years ago

①サイトへ直接リンクをソースコードに実装 ⇨完了 money.jsx

import React, { useState, useEffect, useMemo } from 'react';
import Grid from "@material-ui/core/Grid";
import Moneycard from "./Moneycard";
import Typography from '@material-ui/core/Typography';

import { Auth } from 'aws-amplify'

export default function Money(props) {
    const userId = props.match.params.userId;
    const [userMail, setUserMail] = useState([]);

    useEffect(() => {
        getUserDateAws();
    }, [])

    const getUserDateAws = async () => {
        let user1 = await Auth.currentAuthenticatedUser();
        const mail = user1.attributes.email;
        setUserMail(mail);
    }

    return (
        <>
        <Grid container justify="center">
            <Grid item>
        <Typography component="h1" variant="h5" >
              Point購入
            </Typography>
        <Typography component="h1" variant="h6">
              説明
            </Typography>
            </Grid>
            </Grid>
        <Grid container spacing={2}>

        <Grid item xs={3}> 
            <Moneycard
            title="Free 200p"
            point="200"
            money="200"
            content="一般"
            URL={`https://secure.telecomcredit.co.jp/inetcredit/secure/order.pl?clientip=00043&money=200&sendid=${userId}&usrmail=${userMail}`}

             />
        </Grid>
        <Grid item xs={3}> 
            <Moneycard 
            title="Free 400p"
            point="400"
            money="400"
            content="400pお得"
            URL={`https://secure.telecomcredit.co.jp/inetcredit/secure/order.pl?clientip=00043&money=400&sendid=${userId}&usrmail=${userMail}`}
            />
        </Grid>
        <Grid item xs={3}> 
            <Moneycard
            title="Free 600p"
            point="600"
            money="600"
            content="600pお得"
            URL={`https://secure.telecomcredit.co.jp/inetcredit/secure/order.pl?clientip=00043&money=600&sendid=${userId}&usrmail=${userMail}`}
             />
        </Grid>
        <Grid item xs={3}> 
            <Moneycard
            title="Free 800p"
            point="800"
            money="800"
            content="800pお得"
            URL={`https://secure.telecomcredit.co.jp/inetcredit/secure/order.pl?clientip=00043&money=800&sendid=${userId}&usrmail=${userMail}`}
             />
        </Grid>
        <Grid item xs={3}> 
            <Moneycard
            title="Free 1000p"
            point="1000"
            money="1000"
            content="1000pお得"
            URL={`https://secure.telecomcredit.co.jp/inetcredit/secure/order.pl?clientip=00043&money=1000&sendid=${userId}&usrmail=${userMail}`}
             />
        </Grid>
        <Grid item xs={3}> 
            <Moneycard
            title="Free 2000p"
            point="2000"
            money="2000"
            content="2000pお得"
            URL={`https://secure.telecomcredit.co.jp/inetcredit/secure/order.pl?clientip=00043&money=2000&sendid=${userId}&usrmail=${userMail}`}
             />
        </Grid>
        <Grid item xs={3}> 
            <Moneycard
            title="Free 4000p"
            point="4000"
            money="4000"
            content="400pお得"
            URL={`https://secure.telecomcredit.co.jp/inetcredit/secure/order.pl?clientip=00043&money=4000&sendid=${userId}&usrmail=${userMail}`}
             />
        </Grid>
        <Grid item xs={3}> 
            <Moneycard
            title="Free 400p"
            point="5000"
            money="5000"
            content="400pお得"
            URL={`https://secure.telecomcredit.co.jp/inetcredit/secure/order.pl?clientip=00043&money=5000&sendid=${userId}&usrmail=${userMail}`}
             />
        </Grid>
    </Grid>
    </>
    );
  }