WeChat Pay website integration using Postman with no programming skills - Please Help!


#1

Hi there,

I am in the process of integrating WeChat Pay (via Stripe) into my online shop (Wordpress). I have absolutely zero coding experience and asked Stripe support for some guidance.

I was advised to use Postman to make integration easier and was given some links to reading material. I have read through the documents but I still find it really confusing and hard to understand what it is I need to do, in what order and how. Also, I am completely unfamiliar with Postman, I have been looking at some tutorials on youtube to familiarise myself with the program.

Please see below the guidance I was given by Stripe support:

Run an API request to create a WeChat Pay source [1, & 2] using your test API keys [3]. In the creation response, we’ll include a link in the source[wechat][qr_code_url] attribute that you can follow to either authorize or decline the test payment. Once you’ve done that, the source object’s status will transition from “pending” to “chargeable” [4] and you can then create a charge using the source object’s ID number for the source argument that’s passed when creating a charge [5, & 6]. The easiest way to do this without any coding would be to send this request using a program like Postman [7].

[0] https:// docs . woocommerce . c o m / document / stripe / #section-8
[1] https:// stripe . c o m / docs / sources / wechat-pay#create-source
[2] https:// stripe. c o m / docs / api /sources / create
[3] https:// stripe . c o m / docs / keys
[4] https:// stripe . c o m / docs / sources / wechat-pay#charge-request
[5] https:// stripe . c o m / docs / sources / wechat-pay#make-a-charge-request-using-the-source
[6] https:// stripe . c o m / docs / api / charges / create#create_charge-source
[7] https:// www . getpostman . c o m /

I appreciate any help anyone would be willing to offer as I am facing a huge learning curve.

Many thanks in advance


#2

Hi @postkitty and welcome. The learning curve is not bad when it comes to Postman, the curve is probably more on the side of API’s but once you get the hang of both you will be a wiz in no time.
Personally I have never worked with the Stripe API but I am happy to get you started and we can build from there as needed.

So it seem that the instructions are not overly clear if you are new to API’s but makes sense once you start to dig in. I have mapped out the first call for you here but you would need to fill in some blanks.

So in Postman, you can try importing the following call. Click the ‘Import’ button on the top and select the ‘Paste Raw Text’ tab, then past the call in there and hit ‘Import’.

curl -X GET \
  'https://api.stripe.com/v1/sources?type=wechat&amount=1099&currency=cad&statement_descriptor=myTest' \
  -H 'Authorization: Basic bXlVc2VybmFtZTo=' \
  -H 'cache-control: no-cache'

You should now see the call open in a tab within Postman. Next you are going to need to update a few things to make this work for you, providing you know this information.

Update any of these values to something you would like, for a simple test the current values should be fine I believe.

The next part is going to be the key to your success. Based on their documentation …

Authentication to the API is performed via HTTP Basic Auth. Provide your API key as the basic auth username value. You do not need to provide a password.

If you know your API Key you would insert it in the Username field like I have below. If you dont, you will need to follow their documentation and create one.

After you have done these steps. You should be able to successfully make the call by pressing the ‘Send’ button on the upper right hand corner of the application.
If it was successful, you sould see a status of 200 OK and there would be something in the ‘Body’ of the response. It would look something like this …

{
  "id": "src_18eYalAHEMiOZZp1l9ZTjSU0",
  "object": "source",
  "amount": 1099,
  "client_secret": "src_client_secret_UfwvW2WHpZ0s3QEn9g5x7waU",
  "created": 1445277809,
  "currency": "usd",
  "flow": "none",
  "livemode": true,
  "metadata": {},
  "owner": {
    "address": null,
    "email": null,
    "name": "null",
    "phone": null,
    "verified_address": null,
    "verified_email": null,
    "verified_name": null,
    "verified_phone": null
  },
  "status": "pending",
  "type": "wechat",
  "usage": "single_use",
  "wechat": {
    "qr_code_url": "weixin://wxpay/bizpayurl?pr=RaXzhu4",
  }
}

Once you have that, you can start building upon this. Stripe has some great documentation that can be found here https://stripe.com/docs/api
Feel free to reply here or PM me if you need any more help or clarification. I will try to respond as quickly as possible.


#3

Hi there! You can try doing this using Integromat, it allows you to connect to an API using any authentication method over HTTP. Moreover, there are some inbuilt endpoints for Stripe and WordPress which you might find helpful.