Merchants in order to integrate Payment Highway need to implement own backend functions.
Here a example of backend functions for multiple projects using AWS lambdas.
For the project paymenthighway-applepay-web-demo there are 2 lambdas implemented:
- session : Request a valid Apple Pay Session from the Apple Pay server.
- applepay : Perfom the actual payment(Debit) via Payment Highway API.
If you want to integrate Payment Highway in a mobile app using iOS or Android SDKs there are 2 lambdas implemented:
- transaction: Request a valid transaction Id from Payment Highway
- tokenizzation: Get the tokenized card token for the given transaction id.
Add the env.session.yml file to the root of the project with the following configuration:
staging:
MERCHANT_IDENTITY_CERT: ${file(path/to/your.pem)}
MERCHANT_IDENTITY_KEY: ${file(path/to/your/private.key)}
Add the env.applepay.yml file to the root of the project with the following configuration:
staging:
PH_SERVICE_URL: 'https://your.paymenthighway.service.url'
PH_KEY: 'your payment highway key'
PH_SECRET: 'your payment highway secret'
PH_ACCOUNT: 'your payment highway account'
PH_MERCHANT: 'your merchant id'
Add the env.sandbox.yml file to the root of the project with the develpment sanbox configuration:
staging:
PH_SERVICE_URL: 'https://v1-hub-staging.sph-test-solinor.com'
PH_KEY: 'testKey'
PH_SECRET: 'testSecret'
PH_ACCOUNT: 'test'
PH_MERCHANT: 'test_merchantId'
To run a function on your local
$ serverless invoke local --function hello
To simulate API Gateway locally using serverless-offline
$ serverless offline start
Deploy your project
$ serverless deploy
Deploy a single function
$ serverless deploy function --function <name of the function>