如何从Square Payment中的响应中获取交易ID

时间:2018-03-12 10:29:59

标签: php payment-gateway square

我是方形支付的新手 我在下面得到回复。现在我需要来自此响应的事务ID。 从这种反应中获得它的最佳方法是什么?

#some.component.ts
  RunAsyncUpdates() {
   this._asyncService.getAsyncDataSource(this.model.id)
   .pipe(
    map(
    (resp: any) => {
      # i realy have no idea how to do this, but i am sure code must be here
      return resp.body;
    }),
    repeatWhen(() => Observable.interval(5000)),
    retryWhen(errors => errors.delay(1000).take(3)),
    takeWhile(() => this._alive)
  )
  .subscribe(
    (data: any) => {
      if (!data) { return; }
      console.log(data);
      this._asyncService.data_stream$.next(data);
    }
  );



#some.service.ts
getAsyncDataSource(item): Observable<HttpResponse<any>> {
const uri = `${this.base_service.getBaseUrl()}/async/${item}/`;
return this.httpClient.get<any>(uri, {observe: 'response'});

1 个答案:

答案 0 :(得分:-1)

$result->getTransaction()->getId();